2009/2/13 Brett Hoerner <[email protected]>: > > On Mon, Feb 9, 2009 at 8:27 PM, Graham Dumpleton > <[email protected]> wrote: >> I already warned in that group that 25 processes was a rather rediculous >> number. > > I'm curious, why is this automatically true? > > For most sites I would totally agree, but what about the case of an > active site, where even without any long-lived requests you might > expect 20+ concurrent requests (or a lot more, this could be one of > many app servers behind a load balancer). When that's the case, is 25 > processes still a ridiculous number? > > Just trying to understand. ;)
I guess what I was reacting to was that the configuration was being passed around without explanation as to what sort of setup it was appropriate for. My concern is that if people post around such a configuration that you are going to have all these people who like to use a VPS with very minimal memory trying to use is, thinking that they have to. In practice though, multiple 25 by 40MB process size for reasonable Django application and you get about a 1GB, which is quite a bit more than the minimal 128MB slices that people who don't want to pay money for something bigger want to use. Even then, 10 process would be too much for that sort of setup anyway. Although I disagree with some of his conclusions, Collin Grady posted a recent blog entry which is quite informative in some ways. http://collingrady.wordpress.com/2009/01/06/mod_python-versus-mod_wsgi/ He moved from mod_python to mod_wsgi. For mod_wsgi he used daemon mode with a single process and single thread. From what he has said, his site receives quite a bit of traffic, yet a single request handler thread was sufficient in general. What you need to remember is that the daemon processes aren't handling static requests, only dynamic requests, and if you have tuned your Django application well you requests should complete in well under a second. As such, you are going to have quite a lot of slots within a second period for handling requests. Thus even a single process and single thread should be able to handle enough requests for small, and perhaps up to average sites. In other words, 25 processes is going to be overkill for the majority. To try and gauge how much you can probably handle, set things up for a single process and single thread and run 'ab' against a typical URL with average response time, just don't use keep alive. From 'ab' statistics output you can get an idea of how long a request takes and thus how many requests per second. This can then be a guide as to how many processes may be needed, although do be guarded in thinking that this will scale completely linearly, as generally not the case. In summary, as a recommendation if your application isn't multithread safe, I would go as far as saying to start out with only 2 (maybe 3) processes. This will still work for most VPS systems with out killing it. Then look at the actual performance of your system and gauge how much extra capacity you need. So yes, some systems may need quite a lot more processes, as well as use horizontal scaling across machines, but to give any advice that 25 processes is a starting point is probably not a good idea and give people the wrong impression when it crashes their memory limited systems. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
