Skip to content

opcache would ideally check meaningful operation, not just installation #40324

@James-Oakley

Description

@James-Oakley

The Admin Status page helpfully shows a warning if you try to run NextCloud server without php opcache.

However, it only check to see that opcache is installed, not that it is doing anything.

I recently made a mistake setting up an instance: I was running PHP as a CGI wrapper, not running a persistent fcgi daemon. I made sure opcache was installed, and the warning went away. However (and the mistake was entirely mine), a fresh process was being launched for each call to PHP, so opcache was installed but not actually making anything any faster.

I finally spotted the problem looking at the output of phpinfo(), and seeing that the cache hits figure was zero. Then I saw my mistake, changed the PHP setup to persist a process, and everything got a lot faster.

Is there any way the admin status report can check the cache hits counter, and if it's too low (absolutely, or relative to cache misses) issue a warning that opcache may not be serving cached files. The advice could be to reload the page and see if the warning goes away (because if the webserver has just been restarted or the cache flushed, a correctly running opcache would show no cache hits the first time a page is loaded), with a link to documentation on different PHP handlers if there's still no real caching happening.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions