The April, 2007 Netcraft Web Server Survey
Posted Apr 3, 2007 12:27 UTC (Tue) by
eklitzke (subscriber, #36426)
In reply to:
The April, 2007 Netcraft Web Server Survey by jmtapio
Parent article:
The April, 2007 Netcraft Web Server Survey
I probably don't need to point out that accounting for memory usage is a tricky business, and that the numbers given by ps and other programs aren't useful without more information, but here goes anyway.
Right now my home server is using 137 MB of RAM (reported by free -buffers/cache). ps aux would have me believe that mysqld is using 127 MB of RAM, and that each apache process (and there are about a dozen) is using about 24 MB of RAM (these are the VSZ columns). Obviously a lot of memory is being overreported. If I look at the numbers with ps -lyef I see that the SZ column for mysqld is about 31 MB, and 6 MB for each Apache process (4 for the master), which seems more in line with what I would expect the numbers to be.
I'm not really sure how the numbers for MySQL got so high, but in the case of Apache the explanation is fairly simple. In the preforking model the main process starts up and then forks a bunch of times to allow its children to handle new requests. On a server that isn't too loaded, most of the forks will end up sharing nearly all of their memory. If I go off of the numbers in the SZ column, this is basically confirmed -- each child only consumes about 6 MB of new memory, so altogether Apache is being fairly reasonable.
With respect to communicating with external processes for complicated requests, this is of course very slow. The primary reason that you use Apache is exactly because it doesn't need to do this. I think that you will find that mod_{php,perl,python} is much faster than any sort of CGI alternative, and of course Apache's model enables it to scale with concurrency very, very well. If you don't have a lot of traffic and can deal with a slightly slower HTTP server, you'll definitely find that lighttpd and the alternatives are a lot more friendly on memory, but this of course comes with a definite cost in terms of overall speed and the ability to scale with concurrency.
(
Log in to post comments)