opcache would ideally check meaningful operation, not just installation
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Admin Status page's existing PHP opcache installation check and compare it with the phpinfo() cache hits and cache misses values described in the issue. Define how a fresh or flushed cache should be handled, then verify that the completed change warns when opcache is installed but not meaningfully caching and points administrators toward PHP handler documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100