unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.46k stars 691 forks source link

Have master spawn Spool workers as needed #904

Closed funkybob closed 9 years ago

funkybob commented 9 years ago

Is there any reason the master task can't monitor the spool dir, and when there are jobs it spawn spool workers up to the limit.

This would avoid the spool workers occupying memory when not needed, and also have a single, serialised point for handing out spool jobs.

Clearly the downside is slower start up on jobs, but given the default polling period is 30 seconds, this will only be an issue when spawn cost is great due to yawn-and-stretch costs.

unbit commented 9 years ago

Prototype of --spooler-cheap:

--spooler-cheap --spooler /foo --spooler /bar --spooler-processes 4

will start with 0 spoolers, and will rise up to 8 (4 for /foo, 4 for /bar)

unbit commented 9 years ago

Pushed an implementation in 2.1, it is not invasive so we could backport it to 2.0 too.

Let me know how it works for you

ultrabug commented 9 years ago

Very handy implementation, will give it a try and report !

xrmx commented 9 years ago

So it looks like there's no request to have it backported, closing then. Feel free to reopen.

oliveiraev commented 5 years ago

Could you please backport it to 2.0 branch? I've tried but failed :disappointed: