On Thu, Jan 10, 2013 at 1:23 PM, Roberto De Ioris <[email protected]> wrote:
>
>> We've recently migrated from Apache which does round-robin
>> distribution to its workers to uWSGI which does it on a
>> first-worker-not-busy basis.
>
> ???
>
> apache (as the vast majority of preforking daemons) works in the same way
> as uWSGI, there is a shared socket on which various processes/threads
> wait() and accept(). The only solution using round robin is passenger so i
> suppose you are referring to it ?
Sorry I should have clarified that. Before we were running Apache with
mod_perl, with mod_perl (at least with our previous configuration)
you'd have a worker pool which would get assigned requests in
round-robin fashion.
>>
>> Some parts of our application cache things per-child assuming that
>> that cache isn't going to live for very long, since we have a max
>> request limit per child (implemented with childs doing harakiri) under
>> Apache any given worker wouldn't live for more than 5-10m.
>
>
> --max-requests is the equivalent of apache MaxRequestPerChild
Noted, for various reasons (mainly special logging in the last
request) we do this with harakiri instead of with
--max-requests. I.e. we'd like to run special code on the very last
request before we kill the child.
>>
>> But under uWSGI it's possible to have a server with say 16 child
>> procceses, where normally only the first 8 serve requests.
>
> if this is the standard state, well you are spawning too much processes :)
Indeed. I think that's the whole issue here, just an unoptimal
processes configuration on our part. We'll try to play with that.
>>
>> So e.g. if you get a daily request peak and use child 9-16 for a a few
>> minutes every day those children will continue to live until the next
>> day, having some per-process cache that's very out of date
>
> i am not sure to understand what you mean with per-process cache, can you
> clarify that ?
That the code we're having the childs running has stuff like:
cache = [];
if (!cache) {
populate(cache);
}
Where "cache" is something we'd like to load on the first request for
that child that needs it, but don't want it to stick around for too
long because the values in the cache might go stale.
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi