Comments (7)
@gordalina Removing these two lines fixes the problem, not sure why:
; php.ini
opcache.preload=/var/www/html/preload.php
; required for opcache.preload:
opcache.preload_user=www-data
Content of preload.php:
https://github.com/symfony/recipes/blob/main/symfony/framework-bundle/5.4/config/preload.php
Edit: Problem solved, I had to put the preload.php file inside my project not in a random spot on the filesystem..... (i used /var/www/html/preload.php before, now I used /var/www/symfony/preload.php
Thank you for the assistance.
from cachetool.
Run these commands with a warm cache and show me the output.
Locally I can see that num_cached_keys
went from ~1800 to 0, showing that opcache_reset()
was successful.
bin/cachetool php:eval --run='return var_export(opcache_get_status()["opcache_statistics"], true);'
bin/cachetool php:eval --run='opcache_reset();'
bin/cachetool php:eval --run='return var_export(opcache_get_status()["opcache_statistics"], true);'
from cachetool.
Output for cachetool opcache:status
:
+----------------------+---------------------------------+
| Name | Value |
+----------------------+---------------------------------+
| Enabled | Yes |
| Cache full | No |
| Restart pending | No |
| Restart in progress | No |
| Memory used | 102.39 MiB |
| Memory free | 153.61 MiB |
| Memory wasted (%) | 0 b (0%) |
| Strings buffer size | 12 MiB |
| Strings memory used | 8.38 MiB |
| Strings memory free | 3.62 MiB |
| Number of strings | 120684 |
+----------------------+---------------------------------+
| Cached scripts | 11472 |
| Cached keys | 12476 |
| Max cached keys | 32531 |
| Start time | Thu, 28 Sep 2023 22:55:59 +0200 |
| Last restart time | Thu, 28 Sep 2023 23:12:44 +0200 |
| Oom restarts | 0 |
| Hash restarts | 0 |
| Manual restarts | 2 |
| Hits | 4527408 |
| Misses | 7807 |
| Blacklist misses (%) | 0 (0%) |
| Opcache hit rate | 99.827858216204 |
+----------------------+---------------------------------+
cachetool php:eval --run='return var_export(opcache_get_status()["opcache_statistics"], true);'
array (
'num_cached_scripts' => 11472,
'num_cached_keys' => 12476,
'max_cached_keys' => 32531,
'hits' => 4528098,
'start_time' => 1695934559,
'last_restart_time' => 1695935564,
'oom_restarts' => 0,
'hash_restarts' => 0,
'manual_restarts' => 2,
'misses' => 7808,
'blacklist_misses' => 0,
'blacklist_miss_ratio' => 0.0,
'opcache_hit_rate' => 99.82786239397377,
)
cachetool php:eval --run='opcache_reset();'
cachetool php:eval --run='return var_export(opcache_get_status()["opcache_statistics"], true);'
array (
'num_cached_scripts' => 3705,
'num_cached_keys' => 3705,
'max_cached_keys' => 32531,
'hits' => 0,
'start_time' => 1695934559,
'last_restart_time' => 1696492288,
'oom_restarts' => 0,
'hash_restarts' => 0,
'manual_restarts' => 3,
'misses' => 1,
'blacklist_misses' => 0,
'blacklist_miss_ratio' => 0.0,
'opcache_hit_rate' => 0.0,
)
Also, it seems like that opcache_reset()
does not reset opcache. Maybe it does for one php-fpm process only (bug) in my case ?
from cachetool.
@Herz3h it does seem that it cleaned the cache, see the cached keys is the same as cached scripts, and the hit counter was reset.
There seem to be some cached scripts which you can check which ones by running cachetool opcache:status:scripts
.
from cachetool.
I have a php file where I add (let's call it test.php):
var_dump('test');
die;
After which I run cachetool opcache:reset
but it's acting as if I didn't add anything to that file and upon running (cachetool opcache:status:scripts
after cachetool opcache:reset
), the file where I added the var_dump (test.php) has a HIT value of 0
from cachetool.
You need to have the FPM call the file test.php
so it can cache it. It should only have a hit=1 on the second call to the file.
from cachetool.
I'm loading the page through the browser, and even after it is being cached, it doesn't take into account the code I changed, how should I further debug this ? I have tried upgrading to php 8.1.24, same thing
from cachetool.
Related Issues (20)
- FastCGI.php line 114: Error: File not found. (when using configuration file) HOT 8
- Support for monolog/monolog ^3.0 HOT 1
- Exclude path not working with absolute path HOT 1
- PHP 8.2: ${var} string interpolation deprecated HOT 1
- apcu regex format validation HOT 1
- continuous updating message HOT 3
- Question: Can you install cachetool on 1 specific domain/subdomain instead of entire server HOT 2
- Question: About invalidation of specific scripts HOT 3
- Question: Getting weird errors HOT 2
- Heads up: This fails to work as of Rocky Linux 9.2 (In FastCGI.php line 114: Access Denied) HOT 22
- Invalid version string "@package_version@" with consolidation/self-update 2.2.0 HOT 5
- Tag 8.6.0 was removed, but still referenced in Packagist HOT 4
- opcache:reset FastCGI error: Unable to connect to FastCGI application: Permission denied (/run/php/php8.2-fpm.sock) HOT 1
- Question: Version compatibility HOT 1
- Apcu key fetch problem
- Add support for Symfony 7 HOT 4
- Question/request: Split cache library from CLI tool?
- It would be useful if output from opcache:status:scripts could be sorted by hits or memory HOT 1
- apcu get keys by regex HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cachetool.