Jan
Jan

Reputation: 186

How to calculate costs on AWS?

We are currently building an application and need to calculate/estimate our server costs. We are building our service on AWS EC2 instances. Currently, we are using the free-tier. Unfortunately, we cannot estimate our future costs using Amazons SIMPLE MONTHLY CALCULATOR, because we don’t know which instances are suitable for our project. We have two instances. One runs an API which provides endpoints for iOS, Android and a web application. The other one runs the web application. The application is comparable to a regional social network. Both applications are built upon NODEJS. Furthermore, we use a Postgres installation on RDS. Is there any tool or any experience report on that based on user counts? Is someone out there who did something similar? Thanks!

Upvotes: 0

Views: 863

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269101

The only way to know how many resources you require is to actually configure and run the application against simulated (or real!) usage and measure factors such as CPU, memory and disk. There will never be a magical formula that tells you what you need... unless you write the formula yourself based on actual testing and measurement of your own application.

Therefore, you have two general approaches:

  • Simulate it, or
  • Run it in production

In both cases, you'll need to deploy the fully-configured app, run load against it (real or simulated) and then measure all the parts you consider important.

Given that the cloud is pay-as-you-go, testing in Production could be a perfectly valid approach. You should over-provision resources to ensure your customers are not impacted, then run and measure your app over a period of time. Once you confirm that it is over-provisioned, reduce resources to save costs. The extra cost for this testing period is minor compared to the historical need to buy actual hardware, which was expensive to get wrong.

With good measurement data, you could also configure Auto Scaling, such that your application is provisioned on more instances when it is busy and less instances during quiet periods. This allows you to support more users when required, but save money when not required.

And finally, you can always consider using serverless architectures (eg AWS Lambda functions) that automatically scale based on usage, so you only pay for what you use.

Upvotes: 1

Related Questions