in reply to Plack/FastCGI: how to make workers periodically die?

My research

perl plack server kill
perl plack server timeout
Starman
Signals
Supports HUP for graceful restarts, and TTIN/TTOU to dynamically increase or decrease the number of worker processes.
Superdaemon aware
Supports Server::Starter for hot deploy and graceful restarts.
Server::Starter
To gracefully restart the server program, send SIGHUP to the superdaemon. The superdaemon spawns a new server program, and if (and only if) it starts up successfully, sends SIGTERM to the old server program.
perl plack timer
Plack::Middleware::Debug::Timer - Debug panel to time the request

So you could create a middleware (like Debug::Timer), that based upon a time interval being exceeded, sends SIGHUP to $$, and hopefully the server you're using knows how to restart itself

  • Comment on Re: Plack/FastCGI: how to make workers periodically die?

Replies are listed 'Best First'.
Re^2: Plack/FastCGI: how to make workers periodically die?
by Anonymous Monk on Oct 15, 2011 at 07:22 UTC
Re^2: Plack/FastCGI: how to make workers periodically die?
by Anonymous Monk on Oct 15, 2011 at 07:18 UTC

    After consulting with [irc://irc.perl.org/#plack], there is a flag for that

    00:07 mst : have your application set $env->{'psgix.harakiri'} e +very N requests should do the trick

    Its mentioned in http://search.cpan.org/~miyagawa/PSGI-1.09_3/PSGI/Extentions.pod

    psgix.harakiri: A boolean which is true if the PSGI server supports harakiri mode, that kills a worker (typically a forked child process) after the current request is complete.

    psgix.harakiri.commit: A boolean which is set to true by the PSGI application or middleware when it wants the server to kill the worker after the current request.