https://github.com/unbit/uwsgi/pull/125
I've added 2 new options (well one of them is not that new, I already did that in https://github.com/unbit/uwsgi/pull/90 but it was waiting for merge): --min-worker-lifetime - every worker will run for at least N seconds, so that You can have --max-request 1 without reloading workers every second. Also it can protect You from memory usage spikes, if You have --reload-on-rss enabled and (for example) You add new gem or module to Your app it might start to eat more memory and in the end it will be reloaded more often. This option will ensure that this will not happen too often. This works with combination of --reload-on-rss, --reload-on-as and --max-requests --max-worker-lifetime - as requested, every second master will check if any worker was running more than allowed. It will be reloaded if so. 2013/1/21 demerphq <[email protected]> > On 21 January 2013 15:46, Łukasz Mierzwa <[email protected]> wrote: > > 2013/1/21 Roberto De Ioris <[email protected]> > >> > >> > >> > I get that, but having a cache that over which You have zero control > >> > does > >> > seems hackish to me. This is of course subjective and there might be > >> > cases > >> > when this is valid and solid solution. > >> > It should be easy to add option that will inform uWSGI about worker > max > >> > lifetime, specially if this will make someone happy. > >> > >> > >> That info is already available in last_spawn field of the uwsgi_worker > >> structure. > >> > >> The master can simply check if uwsgi_now()-last_spawn > X and set > >> manage_request to 0 + SIGWINCH to drop it. (SIGWINCH is required in case > >> the worker is blocked in epoll_wait()/kevent()) > > > > > > I'll make a pull request with such option, should be done soon. > > Thanks a lot! That is very cool. > > FWIW, I share your general distaste that this is necessary, but in at > least of couple of cases I am aware of it really is a good option. > > cheers, > Yves > > -- > perl -Mre=debug -e "/just|another|perl|hacker/" > _______________________________________________ > uWSGI mailing list > [email protected] > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi > -- Łukasz Mierzwa
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
