If you’re able, the solution to the cost problem can be more involved than just running an instance 24/7.
AWS offers tools like auto-scaling groups/clusters, that can scale down to 0 active instances when appropriate…
In other words, when there’s no traffic, there are no servers. This has one major implication however - a new server must be spawned on first request. That takes a few minutes.
Work arounds to this include:
- if your traffic is predictable, schedule your instance to shut-down when not in use (i.e. night-time).
- use auto-scaling with ‘spot instances’. Spot instances are instances you ‘bid’ on. Typically, the costs of these are at least 50% of on-demand instances, but they can be terminated on short notice, and only last 6 hours max
- using auto-scaling with a minimum 1 micro instance. This means the cluster will still respond, albeit a bit slowly on the first few requests. Once a small instance has fired up (as part of your auto-scaling configuration), your elastic load balancer can direct traffic to the small instance.
- purchase a reserved instance for 1-3 years. Cost savings here are also significant.
Deploying applications on AWS in a cost-effective manner usually entails some infrastructure administration and automation.
Note, you should DYOR here - I’m recalling this off the top of my head.