Re: Kill fastcgi process

Bryan White <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
On Tue, Jul 28, 2009 at 7:32 AM, Jean-Christophe Roux<jcxxr-/[email protected]> wrote:
> Aron,
>
>>> (2) Does it make a difference that the process is a static or a dynamic
>>> one in order to make sure the older version of my app is completely removed?
>>Normally no ...
> Once I have killed the running processes, what prevents the FastCgi Manager
> from spawning new processes which could be the older version of my program.
> Isn't there a way to send a message straight to the  FastCgi Process Manager
> for Apache who would do the job (better than me most probably).
>
> How do you guys handle that step of switching to a newer version of your
> app?

What I do is at application startup I record the modtime of the
executable.  Then before handling each request I compare that with the
current modtime.  If it has changed the app terminates before
accepting the connection.  I perform the check between the time that
the listen socket becomes readable and accepting the connection.  The
process manager restarts the app and does not seem to miss a beat.

When I have a new version is install by just moving the new version
into place.  Note, a 'mv' is atomic.  A 'cp' could cause all sorts of
problems.

This approach has been working for me for 9 years.


-- 
Bryan White
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.