Variable Workloads and Elastic Elixir Deployments

Hey all –

I have an application with predictably variable workloads. Hundreds of thousands of requests each evening, and no activity from after midnight through around 2PM.

To make matters worse, the application is stateful – making extensive use of GenServers, and it uses WebSockets.

Right now I’m paying for the full resources required to scale all day – however, I know that if this were a stateless service that didn’t need sockets (basically if it were structured the way I would have structured it if it were a NodeJS app), I could put it behind a dynamic load balancer or use a service like Google App Engine for auto-scaling, or use Lambda/GCloud Functions/Azure functions.

What is the best thing to do in this circumstance for an Elixir app?