Inline:

On Thu, Nov 4, 2010 at 2:15 AM, Paul Graydon <p...@paulgraydon.co.uk> wrote:
> On 11/3/2010 6:32 PM, da...@lang.hm wrote:
>> On Wed, 3 Nov 2010, Paul Graydon wrote:
>>
>>> I'm facing an interesting challenge at the moment.  Our Apache httpd
>>> based load balancers are starting to show signs of strain.  Nothing too
>>> bad but a good indicator that as the amount of traffic to our sites
>>> increases there will come a point when they can't cope.  I've been
>>> expecting this but at the moment as a "Standalone" sysadmin I've got too
>>> much on my plate to even get on to anything pro-active that requires
>>> more than a few hours work.. with inevitable consequences, though I'm
>>> making favourable progress.  Load is now reaching a stage where it's
>>> spawning enough httpd sessions to be of some concern and at a level that
>>> seems to be resulting in latency for requests.
>>
>> a couple quick comments
>>
>> 1. Nginx is single-threaded, so while it's screaming fast, it won't
>> use more than one core.

This is correct and incorrect at the same time :)  Nginx doesn't use
threads, but it can use > 1 core.  See
http://wiki.nginx.org/HttpMainModule#worker_cpu_affinity
http://wiki.nginx.org/HttpMainModule#worker_processes

> I couldn't give you an solid figure, but based on memory usage compared
> to current I'd guesstimate at 120+ and I swear we're not doing that much
> traffic.  I've added that to zabbix so I'll have a better idea
> tomorrow.  Even now during what is a quiet time for us I'm bouncing
> between 50 and 80, tuned:

We've just deployed Nginx to production, but we're lucky enough to be
able to do it in phases.  The first phase was just to move all
requests for static content (images, js, css, pdf, etc) to the Nginx
boxes.  Doing this alone has allowed us to free up enough resources on
the Apache boxes to allow us to get through holiday without any
bolstering of Apache resources, which we've had to do every year until
this one.

It's pretty incredible - when Nginx is hit with 500 - 1000 *real*
requests per second, load avg on the box is at .24, and memory usage
is under 50MB.  To do that with Apache, we needed 16GB of RAM in the
box, and load averages were higher due to process overhead.  This is
an Apache compiled from source and tweaked to within an inch of its
life.  Nginx overall appears to be quicker, but I think that's because
since Nginx uses so little RAM, all of our content is being served
from RAM caches instead of from the disk.

I'm not doing any proxying (yet), so I can't attest to it's
effectiveness there, but based on what I've seen, you owe it to
yourself to tinker with it for awhile.

There's a Packt book out on Nginx - I bought the ebook and ripped
through that in a day - it may not be the best written book out there,
but it was an excellent resource to use to get up and running in short
manner.

Justin
_______________________________________________
Tech mailing list
Tech@lists.lopsa.org
http://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to