Memory will be the real performance bottleneck on your VPS

This well-done benchmark comparison of several Virtual Private Server vendors gives me warm and fuzzies that I chose Linode for my new hosting provider. However, the benchmarks chosen mostly test CPU performance and the bottleneck when hosting a dynamic web site is likely to be memory capacity.

The number of requests per second that your server can handle is determined by the maximum concurrent requests possible divided by the time in seconds to handle each request. Each Apache process running WordPress PHP scripts via mod_php consumes about 20 MB on my Linode. This means I can only run about 10 Apache processes and therefore handle 10 concurrent requests. If each request takes 150 milliseconds to process, 50 milliseconds transfer time and 100 milliseconds processing time, my server can handle 10 / .15 = 66.67 requests per second. Let’s assume another VPS vendor provides the same 360 MB as my Linode account but the CPU is half as fast. The requests might take 250 milliseconds so the server could handle 10 / .25 = 40 requests per second. In this situation, the faster CPU is a clear win. But several of the vendors in the review provide significantly more memory than my Linode account. If that slower processor came with 1024 MB memory, it could maybe run 45 Apache processes and serve 45 / .25 = 180 requests per second, far outstripping my supposedly faster Linode.

As you add memory to a server, CPU will eventually become the bottleneck again, but my Linode rarely goes above 1% CPU utilization while serving 66 requests per second, so I think that number is probably quite high. There are also other web servers and Apache configurations that are a bit more memory efficient than what I am talking about, but with all of them you will still be limited by the number of 10-20 MB PHP processes you can fit in memory.

I don’t regret choosing Linode as my VPS provider, they have great support and nice management tools. I also don’t expect to get anywhere near the traffic levels I talked about above. But if you are evaluating VPS vendors based on how much traffic you handle for the money you are paying, be sure to consider memory capacity.

GPLed Java

CRN says Sun will license Java under the GPL. All of the noises Sun has been making about wanting to prevent Java forks made me think they would use another [not-really-free]( license so, if true, this is very good news.

Blog Publishing Models

Tim Bray explains why he doesn’t want to use a database with the comment system that he is writing for his blog. It turns out he’s talking more about the publishing model, dynamic or static, than the data store.

Serving static files generated when you post something is much faster than generating the page every time a user visits, so you can handle many more concurrent visitors. I like the dynamic model, though, because I think it offers a better user experience. I used Blogger and MovableType before I switched to WordPress and the publishing step always seemed problematic. Site-wide changes required regenerating every blog post, which took a long time and was error-prone. Dynamic publishing doesn’t have this problem and has a simpler mental model, too. If you need performance, you can use the [WP-Cache]( plugin, although I’m sure it’s not quite as fast as a fully static site.