On Mon, Jun 6, 2011 at 10:15 AM, Aryeh Leib Taurog <[email protected]>wrote:
> On Mon, June 6, 2011 04:28, Roger Hoover wrote: > >>> 1. can dynamically start fcgi processes to meet demand > >>> > > > > if you're using nginx, there's a plugin that i believe will do this > > > > http://labs.frickle.com/nginx_ngx_supervisord/ > > Looks interesting. The documentation (at least what I see on the site) is > really quite sparse, though. Can you give me an example configuration? > Wish I had more details but I haven't had a need to try this yet. > > >>> 2. kills each process after it has served a specified number of > >>> requests > > > > supervisord itself is not aware at all of requests (it just forks fcgi > > processes with an open socket) but you can certainly implement this > > pattern with supervisord. you can probably reuse the same code that > exits > > after a certain number of requests b/c that piece of the equation > > shouldn't have any dependency on how the process was forked. for our own > > system, we used a special exit code when processes exited on purpose (b/c > > they completed a certain number of requests). Then in our supervisord > > config, we listed that exit code as "expected" so that it can be > > distinguished from unexpected errors that cause the process to die. > > You mean code my fcgi process to exit after serving the determined number > of requests? Yes > Where is that code for re-use? In the django management > command? I'm guessing so, yeah. > Also, what difference does it make if supervisord knows that > this is "expected?" Wouldn't I want it to spawn a new process in any > case? > It doesn't matter unless you have an event listener setup for supervisord, such as crashmailbatch ( https://github.com/Supervisor/superlance/blob/master/superlance/crashmailbatch.py) that will send you alerts when processes die unexpectedly. > > That frickle project also mentions "Dynamic rotation" of fcgi processes. > Does that address my second interest as well? As noted, the documentation > (for frickle, not supervisor) really seems quite meager. I would love to > see more complete supervisord/frickle examples for achieving these goals. > Great question. It sounds like it does but I don't know. > > Thanks for your help. > > regards, > Aryeh Leib Taurog > > > >> ---------- Forwarded message ---------- > >> From: Aryeh Leib Taurog <[email protected]> > >> To: [email protected] > >> Date: Sun, 05 Jun 2011 21:20:35 +0300 > >> Subject: Limit number of fcgi requests each process serves > >> Hi, > >> > >> > >> I have a django app and I'm looking into using fcgi-program under > >> supervisord to manage it. The advantage that the standard "manage.py > >> runfcgi" approach provided by django/flup seems to have over supervisor > >> is that it > >> > >> 1. can dynamically start fcgi processes to meet demand > >> 2. kills each process after it has served a specified number of requests > >> > >> > >> Is there any way to do this with supervisor? I'm particularly > >> interested in the second option. > >> > >> Thanks, > >> Aryeh Leib Taurog > >> > > > >
_______________________________________________ Supervisor-users mailing list [email protected] http://lists.supervisord.org/mailman/listinfo/supervisor-users
