Upgrade EC2 instance type when high load is expected #3477
Labels
feature
Issues regarding a complete new feature
optimization
Issues regarding slowness
priority: medium
A new feature or a bugfix that is non-critical.
server
Server related issues
What?
We can change the EC2 instance type of our server with just a simple reboot. We can use this to upgrade from a t3a.small to e.g. a t3a.2xlarge, so that we can handle short periods of high load (such as when event registrations open) better, without permanently paying for big servers.
Why?
We need to not crash on e.g. weekend registration opening. The most extreme event registration openings are easy to predict.
How?
When event registration is about to open, temporarily change the instance type in terraform. With terraform apply we can be back online in about 1-2 minutes if we skip the currently slow
collectstatic
step (see #3290). Doing this manually is probably fine.I tried this out on staging. As a t3a.small, it handles +- 16 request per second to the homepage (unauthenticated). Upgrading to a 2xlarge (8 vcpus instead of 2), it handles 64. So scaling is pretty much perfectly linear.
We should think about how we can be sure to apply this in time. For example, it would be nice to upgrade early in the morning and downgrade again in the evening, so we should be aware of upcoming opening registrations a few days in advance to plan it.
The text was updated successfully, but these errors were encountered: