Re-searchr is a small site with modest needs, it is also 100% bootstrapped and therefore I keep a sharp eye out for the best deal on hosting. After first going with shared hosting (unsatisfactory for a lot of reasons, but that is a different post), I switched to cloud hosting and have enjoyed the benefits of having root access on all my servers.
Lately I have been doing my quarterly review of my hosting options and this time I thought I would share it with the world, since I am betting there are a LOT of websites similar to Re-searchr, who are starting slow, but want to be able to scale in the cloud when needed.
So here is the architecture I spec out for Re-searchr: 2 Application (Web) Servers, and 1 DB Server. Some sort of load balancing is necessary between the 2 application servers, but it can be handled by Squid or Apache, it doesn’t have to be specialized hardware.
I’ll start my calculations w/ the following, assume 720 hours of time per month, and though I don’t monitor it closely, I’ll assume 20GB upload bandwidth, and 20GB download bandwidth.
GoGrid
For GoGrid, one can choose to go 100% on demand, or choose one of the pre-paid plans. For Re-searchr, which is meant to be up all the time, a pre-paid plan was obviously a good choice. For $100/month the Busines plan seems to align best with my usage. This plan gives me 800 RAM-GB-hrs per month, w/ additional hours being charged at $0.10/RAM-hr. For 3 512MB RAM servers I can then use up a total of: 1.5GB*720 hrs = 1080 GB-hrs. That is over my max, by 220 GB-hrs, which means an overage charge of: $22.00. So the total GoGrid cost for 3 512 MB servers is $122/month. Inbound bandwidth for GoGrid is free of charge, a very nice feature, but outbound bandwidth is charged at $0.5/GB, this adds on $0.5/GB*20GB = $10 to the total. So for one month the total GoGrid charge is right around $132.
GoGrid has a free F5 load balancer (though it doesn’t do much more than just the most simple balancing algorithms).
Mosso
Mosso offers servers in increments of RAM going from 256MB to 15GB (wow!) for different price-points per hour on the way. The 256MB servers are a very cheap $0.015/hr, 512MB servers are $0.03/hr, and 1GB servers are $0.06/hr.
To match GoGrid, lets compute the 512MB servers. For a month we have 720 hrs * 0.03/hr * 3 servers= $65. Bandwidth costs at Mosso are $0.1/GB, both upload and download, coming to to a total of $0.1*2*20=$4.
The total cost for Mosso comes out to $69/month.
Mosso does not offer a hardware load balancer, so load balancing would be done on one of the web nodes (though a 256MB server to run it would only cost ~$12).
Since that is significantly lower than GoGrid, lets compute the next server size up as well (1GB RAM). The monthly server charge is 720 hrs * $0.06/hr * 3 servers = $129.60. Bandwidth costs remain the same, so the total would be $133.60.
Amazon EC2
EC2 offers servers in several sizes, small, medium and large. For Re-searchr the small servers would probably be sufficient. Small servers have 1GB of RAM and are charged at a rate of 0.10/hr . The relevant server cost for 3 servers if therefore $0.10/hr * 3 servers * 720 hrs = $216.00. Amazon offers the option of “reserving” a server for $325/yr and thereby reducing the computing costs to $0.03/hr, per month the total cost for reserving 3 small instances and running them would be: $0.03/hr * 3 servers * 720 hrs + $27 reserve fee = $91.80/month.
Bandwidth costs for Amazon EC2 are $0.10/GB upload and $0.17/GB download, total costs would be: $0.10/GB*20 + $0.17/GB *20 = $5.40.
Amazon EC2 has just recently started load balancing (for a nominal fee). Estimating the load balancing requires knowing how many request per month, etc. This will not be estimated now.
Worst case costs for Amazon are $221.40/month, while w/ reserved instanes, the costs could be as low as $97.20/month
It is of course important to note, not just the RAM values for the servers given above, but also the CPU capacity of the servers. GoGrid claims to supply 512MB servers with “a ratio of 1 Xeon core (equivalent to a P4 2.0 chip) to 4 GB of RAM” (1/8 of P4 2.0), while Mosso supplies a “Fair-weighted Quad Core processors (Guaranteed minimum. Weighting scales up with memory)”, EC2 supplies “the equivalent of a 1.0-1.2 GHZ 2007 Opteron or 2007 Xeon processor”.
All 3 services offer both 32 bit and 64 bit OS’es in a variety of flavors.
What to choose?
My opinion is that it depends… yes that is not much of an opinion. Really one needs to evaluate their application based on whether it will operate better with a large CPU or more RAM. In a lot of cases RAM is more important than CPU because RAM is basically equivalent to caching in memory (either thru MEMCACHE, or other). Lots of site are very DB heavy, meaning that the Web Servers do very little work besides asking the DB for data and then maybe looping through it (not extremely CPU intensive). This is almost the default for the Web Server because most folks want their urls to return in a timely manner, so not too much processing can take place. Then again the heftier a CPU you have the more you can do… but truly most sites probably need a hefty cpu for their DB server, b/c that is where a lot of joining and sorting etc. are really done.
So what does all this mean for Re-searchr, well it means I probably need to try out Mosso, since I am currently on GoGrid. Mosso would be cheaper for 1GB servers, and I could even bump up my DB server to a 1.5GB or 2GB server, and get the best of both worlds. However Mosso also does not publish what CPU levels the various RAM levels they give (I asked them on Twitter, and they said they do not give out that information), so I’d have to load test in order to look at overall performance. Somewhat surprisingly to me, EC2 doesn’t really compete; they are massively more expensive except when agreeing to a year’s term, which is unacceptable for a bootstrapped startup.
Subscribe to:
Post Comments (Atom)
Very nice write up! Now I feel like doing something with GAE because I am looking at doing something on GAE and if successful, I might be paying...
ReplyDeleteWith django GAE is supposed be fairly easy, I mostly write in Turbogears, where it does work, but is a bit more difficult. I'd like to take a look at it too, what are you planning on writing?
ReplyDeleteA very important thing you forgot it disk i/o which might seem unmeaningfull but it's a showstopper. In GoGrid for instance I have encountred such horrible i/o that i was forced to leave them (that was on a 2gb server). Besides thier low level of support, they just wouldn't admit there was a problem and after over a week of sending them screenshots of files being copied localy at <1kb/s they just told me to delete and recreate the server (for the second time, I did it before with a 1gb instance).
ReplyDeleteBy what i've read about Amazon they have very good i/o performance, and about Mosso i couldn't find any i/o reviews.
Beware of GoGrid !