Comments (8)
There is no way to do this, what is your precise use case? It would be ineteresting to have this in cachetool
from cachetool.
We have an nginx server configured with an upstream pool of 6 php-fpm servers listening on [IP]:9001. I'd like to be able to flush opcache on all of them easily.
from cachetool.
Do you have 6 instances of php-fpm or one instance of php-fpm with 6 workers?
If you have 6 instances, are they listening on the same port or not?
If you have one instance with 6 workers, cachetool will affect all of these.
from cachetool.
6 instances of php-fpm (php v5.5) (running on 6 virtual servers/VMs - 1 php-fpm instance on each server)
they're all listening on the same port e.g. 192.168.0.10:9001
The 7th VM runs nginx which is configured to connect to those php-fpm's using this config
upstream backend {
server 192.168.0.10:9001;
server 192.168.0.11:9001;
server 192.168.0.12:9001;
server 192.168.0.13:9001;
server 192.168.0.14:9001;
server 192.168.0.15:9001;
}
Ideally I'd like to be able to flush opcache from the nginx VM. Maybe cachetool.phar could use a config similar to "upstream backend" one. I know it can use a config at the moment but I don't think it supports multiple IPs in it.
from cachetool.
Right know cachetool needs to be on the server with php-fpm as it requires it dump the code for execution.
There could be a solution: Where cachetool would be installed in all servers and the master one would execute cachetool to execute commands on these servers by connecting with ssh.
How do you connect to those servers from the nginx VM?
from cachetool.
Yeah, I ended up writing a small shell script that connects to all those VMs via ssh and runs
ssh phpfarm-a "php cachetool.phar opcache:reset --fcgi=192.168.0.10:9001"
opcache:status
works fine on all of them.
The problem I'm having right now is when I try to opcache:reset
in production most of the time the opcache gets disabled and it's state is Restart pending = Yes. Sometimes, very rarely the reset works. Any ideas why?
This is what I get on opcache:status on a "locked" opcache. The php-fpm server is still working and responding to requests, it's just not using opcache anymore.
+----------------------+---------------------------------+
| Name | Value |
+----------------------+---------------------------------+
| Enabled | No |
| Cache full | No |
| Restart pending | Yes |
| Restart in progress | No |
| Memory used | 92.8 MiB |
| Memory free | 163.2 MiB |
| Memory wasted (%) | 0 b (0%) |
| Strings buffer size | 12 MiB |
| Strings memory used | 9.64 MiB |
| Strings memory free | 2.36 MiB |
| Number of strings | 93741 |
+----------------------+---------------------------------+
| Cached scripts | 2642 |
| Cached keys | 4663 |
| Max cached keys | 16229 |
| Start time | Wed, 20 May 2015 16:21:41 +0000 |
| Last restart time | Never |
| Oom restarts | 0 |
| Hash restarts | 0 |
| Manual restarts | 0 |
| Hits | 1244282 |
| Misses | 2644 |
| Blacklist misses (%) | 0 (0%) |
| Opcache hit rate | 99.78795854766 |
+----------------------+---------------------------------+
from cachetool.
That looks like a opcache issue, not really sure what is it though.
from cachetool.
Closing this issue, feel free to reopen if you have anything else new.
from cachetool.
Related Issues (20)
- 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
- Not clearing cache after upgrading to php 8.1.13 + cachetool 9.1 HOT 7
- Apcu key fetch problem
- Add support for Symfony 7 HOT 6
- 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
- DX: success response 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.