amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

file_cache_only=1 improvements #41

Open wasshuber opened 4 years ago

wasshuber commented 4 years ago

I am forced to use file_cache_only=1 due to PHP being run as FastCGI without any multi-process management such as (PHP-FPM). In other words no shared memory cache for me. It would be great if in this case your tool could show the files that have been cached on disk, how many these are, and allow invalidation/removal of individual files. I don't think there is a possibility to glean some cache stats like hits, etc., as is the case for the shared memory situation, but if there is those would be great.

If anybody has an idea how to evaluate how well a file only opcache is working, I would love to hear ideas. All I can do right now is to check if opcode files are being written to disk. There is no information if they are actually being used or how often they have been used, etc.

amnuts commented 4 years ago

Hmm, that's interesting. When I last tried the opcache_get_statistics function with file_cache_only=1, it didn't bring back any of the files that had been cached at all. So anything that the gui does would need to be a manual traversal of the file system which might make it a little slow when lots of files are cached. I'd also need to plumb that into the file list and all that functionality.

I'll have a look at some point and see if it's feasible - shame the core functions don't support this, though!