2011-10-12 - [GRASE-Hotspot] Alternative web servers - Nginx

Header Data

From: Tim White <ti***8@gmail.com>
Message Hash: 653cc926dcab73e4998195f5f06967240086a387c25df81a60373660ee13591a
Message ID: <4E965195.3050707@gmail.com>
Reply To: N/A
UTC Datetime: 2011-10-12 19:48:53 UTC
Raw Date: Thu, 13 Oct 2011 12:48:53 +1000

Raw message

Because I am always working towards the day when I can make the Grase 
Hotspot a nice little hardware package (hardware is actually on the way 
from the US now!), I have recently been working with alternative web 
servers.
In particular, I'm looking at nginx, which requires me to run the php as 
a cgi. I've just managed to get it somewhat working, and the results are in!

Note, that I'm measuring the RSS memory, so it's actually memory used, 
not swapped and not allocated but not yet used. The results are also 
biased given how many processes apache needs to start, but that's one 
reason why nginx is doing so well on servers.

The setup is apache2 default setup, port 80, with grase config files.
The nginx setup is same machine, basically default setup plus some new 
grase config files, on port 81.

Page loading times doesn't seem to be any different, and this is to be 
expected as most of the content is dynamic so php is the bottleneck. (I 
am looking at ways we can cache more, but that's probably going to be 
more on the portal login pages than the radmin interface.)

The difference is in memory usage.
Apache2 with mod_php, sum of all process RSS memory is 178892  Kbytes.
Nginx with php-cgi (fastcgi), sum of php process + nginx processes is 
32088 Kbytes.
That's a difference of about 140Mb's in memory usage!

So, to see the real effects, I've stopped the swap on my machine, 
shutdown all extra's, and will run each server by itself and load up the 
radmin interface from a remote machine and click through every page and 
then measure memory usage. (Restarting mysql between sessions).

So the simple results are:
nginx + php-cgi
12Mb After loading
20Mb After clicking through pages

Apache
11Mb After loading
60Mb After clicking through pages

This was measured by using 'free -m' to record the before and after, the 
total memory used on the machine.

It might not seem like a big difference, but on smaller older hardware 
it might well be! I'm going to investigate how to package this so it can 
be used with ether Apache2 or nginx as the user wishes.

If you have older hardware, how about showing us how much memory the 
whole hotspot package is using, for how many users?
Thanks

Tim





Thread