Something missing from many online courses out there, and often learnt-on-the-job, is how to scale a web app up to more users – 100K, 1M or even more than 11M. Due to the COVID-19 situation and with school closures forcing kids to stay at home, Khan Academy scaled to 2.5x their web traffic in a week by using serverless architecture and CDN caching of all static data. They also extensively cached common queries, user preferences and session data.
You can also adopt a bottleneck-centric approach to scaling, by checking your resource monitoring to identify the bottlenecks. It is usually the database first. But bottlenecks can be memory, CPU, Network I/O or Disk I/O.
As a principle, make the web stack do less work for the most common requests.
Some ideas:
Cache database queries
Index the database
Move session storage to an in-memory caching tool
HTML fragment caching
Use queues and more workers
Use HTTP caching headers
Add a Content Delivery Network in front of a static file host
Here's a guide for scaling up to 11M users, stage by stage:
--
I'm not allowed to share the multiple links to the guides here, but you can find all the links to the original guides in this post.
I haven't even needed vertical scaling at 10k-100k users. It's fine on a bottom-tier VPS.
What kind of app are you running?