[FASTCGI] Kill fastcgi process
Bryan White
nicktook at gmail.com
Thu Jul 30 11:47:24 EDT 2009
On Tue, Jul 28, 2009 at 7:32 AM, Jean-Christophe Roux<jcxxr at yahoo.com> 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
More information about the FastCGI-developers
mailing list