Clear OPcache and realpath cache on PHP-FPM reload
| From: | William Edwards | Date: | Sat, 29 Jan 2022 16:36:32 +0000 |
| Subject: | Clear OPcache and realpath cache on PHP-FPM reload | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-327897@lists.php.net to get a copy of this message | ||
Hi,
This question is about PHP-FPM.
Is a graceful reload (SIGUSR2) a reliable way to clear OPcache and the realpath cache?
Currently, I restart PHP-FPM pools to clear OPcache and realpath cache when
opcache.validate_timestamps = Off. This causes 503s for users. I'd like to queue waiting requests instead by using SIGUSR2, which does a graceful reload.
I've found that sending SIGUSR2 to the master process clears OPcache. php-fpm(8) says:
SIGUSR2
graceful reload of all workers + reload of fpm conf/binary
Technically, OPcache is held in the master process. So does 'graceful reload of all workers' also mean the master process?
--
With kind regards,
William Edwards