call rotation → We only get paged a few times a year for really minor outages 18 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023
app written in Ruby... There are limits to what a full-featured web app can serve 30 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023
Fastly edge POP →cache, close to client → Fastly shield POP →cache, all request to backend flow through a single POP → S3 →static content store → nginx →buffering, rules for rate-limiting → puma →serves the rails app 33 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023
the same → Old (really, really old) bundler versions fell back to the "full index" →Which involves downloading https://rubygems.org/ specs.4.8.gz →And also https://index.rubygems.org/quick/ Marshal.4.8/rails-7.0.8.gemspec.rz 41 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023
to https://index.rubygems.org/info/ rails → ... which were being served by complex queries in the rails app →Only on very rare cache misses 47 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023
Pre-calculate responses → Upload responses to S3 → Have Fastly serve those requests from S3 52 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023
serve traffic, let someone else do it → Please don't DDoS yourself → Find appropriate places to do different kinds of work → Do all the "normal" optimization work 54 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023
database tables → Set cache-control headers → Scale up your DB & web server instances → Add rate limiting 55 — Handling 225k requests per second to RubyGems.org @ RubyConf TW 2023