Clear OPcache and realpath cache on PHP-FPM reload

[email protected] (William Edwards)
Newsgroups php.general
Message-ID <[email protected]>
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
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.