简体   繁体   中英

how many websites should i host on EC2 nano instance

I am developing a couple of websites, but I only have paid for an EC2 nano instance on AWS. How many websites could I possible host there, assuming the websites will only have minimum traffic? Most of the websites are for personal use only.

Only one way to find out ;)

No definite answer possible because it depends on a lot of factors.

But if traffic is really low you will only be limited by the amount of disk space and as t2.nano runs on EBS storage this can be as big as you want. So you could fit a lot of websites!

t2.nano has only 512Mb memory so best to pick a not-so-memory-hungry webserver such as ngnix.

I run five very low traffic websites on my t2 nano - four of them Wordpress, one custom PHP. I run Nginx, PHP5.6, and MySQl 5.6 on the same instance. Traffic is extremely light, in the region of 2000 pages a day, which is about a page every 30 seconds. If you include static resources it'll be higher. CloudFlare runs as the CDN, which reduces static resource consumption significantly, but doesn't cache pages.

I have MySQL on the instance configured to use very little memory, currently 141MB physical RAM. Nginx takes around 10MB RAM. I have four PHP workers, each taking 150MB RAM, but of that 130MB is shared, so it's really 20MB per worker after the first.

Here's the output of a quick performance test on the t2.nano. Note that the Nginx page cache will be serving all of the pages.

siege -c 50 -t10s https://www.example.com -i -q -b

Lifting the server siege...      done.

Transactions:                   2399 hits
Availability:                 100.00 %
Elapsed time:                   9.60 secs
Data transferred:              14.82 MB
Response time:                  0.20 secs
Transaction rate:             249.90 trans/sec ***
Throughput:                     1.54 MB/sec
Concurrency:                   49.42
Successful transactions:        2399
Failed transactions:               0
Longest transaction:            0.36
Shortest transaction:           0.14

Here it is with nginx page caching turned off

siege -c 5 -t10s https://www.example.com -i -q -b

Lifting the server siege...      done.

Transactions:                    113 hits
Availability:                 100.00 %
Elapsed time:                   9.99 secs
Data transferred:               0.70 MB
Response time:                  0.44 secs
Transaction rate:              11.31 trans/sec ***
Throughput:                     0.07 MB/sec
Concurrency:                    4.95
Successful transactions:         113
Failed transactions:               0
Longest transaction:            0.70
Shortest transaction:           0.33

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM