tags:

views:

28

answers:

1

Currently, when we update our PHP code for our website, we have a script that calls apc_clear_cache on all servers, so that the new code will be used.

We also have some PHP scripts that run in the background on a separate server, processing some slower queries, and the like. The same script that calls apc_clear_cache also notifies the scripts to exit when they reach a reasonable stopping point. The problem is that apc_clear_cache takes effect immediately, and some of the scripts that are not at a stopping point will reproducibly hang.

Does anyone know of a way around this problem aside from stopping all of these scripts (at the appropriate time), THEN calling apc_clear_cache, THEN restarting them all?

+1  A: 
  1. Tell scripts to stop.
  2. Clear APC cache.
  3. Tell scripts to start.
Brendan Long