I'm working on a project of mine and I'm expecting about ~500-750k unique pings per month.
I'm curious to hear if there's any better way (in terms of latency) to host a static website than my idea below.
Idea:
- EC2 instance running NGINX with gzip enabled
- CloudFront for CDN
What I'm hosting:
- HTML (3 pages in total)
- CSS
- SVG/PNG images
Also, if my idea above is OK, which EC2 instance would you go for? I'm thinking a micro instance would do just fine, I don't see why I would need the extra RAM/CPU.
Edit: Or how about something simpler like S3 w/ CloudFront?
Can I be late to the party and also suggest S3. Here are some metrics of actual performance
This is a graph showing S3 latency with a reasonably high load
As you can see the average time to first byte over each hour ranges from 30 to 60ms
We also found that the total amount of traffic did not affect the latency, in fact there seemed to be an inverse relationship between averaged latency and total request count. I assume this was due to autoscaling "under the hood" at the AWS end
According to AWS documentation the S3 part of the static website setup is good for 800 GET requests per second, see http://docs.aws.amazon.com/AmazonS3/latest/dev/request-rate-perf-considerations.html
Sorry I have no ngnix statistics to compare this with. We don't use ngnix for this type of workload
Cost effective , high-available, fully managed , secure and fault-tolerant solution for your case is AWS S3 :
Create S3 Bucket (mybucket) and enable website static properties on it.
Create IAM user with a permission of read/write on that bucket.
(Keep secret key and access key and the region where you create the bucket)
Configure your secret key and access key in your laptop
Then upload your static website :
Congrats! your website is hosted : http://[BUCKETNAME].s3-website.[REGIONMAME].amazonaws.com
If you want to :
map the website to another domain
or/and use SSL
or/and integrate with WAF.
or/and so on...
Use also AWS CloudFront.