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
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
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
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
HandsUp Facebook Webhooks Message Load Balancer Server Server Server Queue PubNub Service Analysis Service Swoole Service PubSub Many to Many Queue Workers