4. What Is High Concurrency?
PV = 2,000,000 (200w)
QPS = (200w x 0.8) / (24 x 3600 x 0.2)
93 QPS 😀
5. What Is High Concurrency?
2,000,000 (200w) in 1 minute
QPS = 200w / 60
33333 QPS 😭
6. What Is High Concurrency?
Read in High Concurrency
• Vertical Scaling
• Horizontal Scaling
• Content Delivery Network
• Data Caching
• Single Point Optimization
Write in High Concurrency
• Message Queue
• Rate Limit
• Maximum Serving Limit
• Wait in Line
• Rules Optimization
19. Cache (Not Limited to Database)
• Discover Hotspot Data (Hit Rate)
• Proper TTL for Cached Data
• Avoid Expiring Cache at The Same Time
• Revoke Cache when Data Changes
• Avoid Cache Missing
• Hierarchical Cache Design
• High Available Cache System
• Warm Up the Cache
40. Benchmark Comparison
• Benchmark with Preloading
Benchmark
Preloaded
files
Server
startup time
Opcache
memory used
Per request
memory used
QPS
No
preloading
0 0.06 s
16 MB after
warmup
1,825 KB 596 rq/s
Preload hot
classes
878 0.26 s 21 MB 869 KB 695 rq/s
Preload
everything
14541 1.56 s 105 MB 881 KB 675 rq/s
https://github.com/composer/composer/issues/7777
54. AATIX
• Avoid large amount of write requests at the same time
• Queue
• Rate Limit
• Reduce repeated requests from clients
• Service isolation for hotspot data
• Circuit breaking for high availability
55. • Large amount of webhook calls
• High availability for webhooks
• Instant response time
• Chat service for live streaming