Limitations of S3 Website Hosting

December 10, 2019

<< >>

Hosting a website in S3 is quite straight forward but how about the costs? Usage of S3 is billed based on e.g. storage, data transfer and number of requests. Let’s consider following scenario as basis of our calculation:

  • 1 GB of Storage
  • 100000 POST requests
  • 100000 GET requests
  • Average response size 10 kB
  • 1 GB of data transfer out

Based on AWS Simple Monthly Calculator this scenario would generate ca. $ 0.57 (plus tax) costs per month which is not too bad.

Let’s then consider that somebody would be causing 50 TPS load to my website for a day. This is quite easily achievable with single machine and fast enough network connection without any fancy botnets. If we assume that all these requests would be HTTP GET requests, it would mean over 4 million requests per day and with our average request size of 10 kB this would mean ca. 40 GB of data transfer out. So our one day of 50 TPS scenario would be:

  • 1 GB of Storage
  • 100000 POST requests
  • 43200000 GET requests
  • Average response size 10 kB
  • 40 GB of data transfer out

AWS Simple Mothly Calculator gives me cost of $ 21.31 which is just barely over my intended budget of $ 20. Let’s calculate from another angle. How high TPS rate would be required to generate $ 500 costs in a day? With 400 million requests and resulting 4 TB of data transfer AWS Simple Monthly Calculator gives me costs of $ 520.44. There are 60 * 60 * 24 = 86 400 seconds in a day. 400 million requests / day would therefore entitle 4629 TPS. This is definetely doable with some fancy botnets.

Base on these findings it is clear that I need to build something to protect myself from unexpected costs.

<< >>

comments powered by Disqus