Giter Club home page Giter Club logo

Comments (8)

gordalina avatar gordalina commented on July 19, 2024

There is no way to do this, what is your precise use case? It would be ineteresting to have this in cachetool

from cachetool.

bodiski avatar bodiski commented on July 19, 2024

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.

gordalina avatar gordalina commented on July 19, 2024

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.

bodiski avatar bodiski commented on July 19, 2024

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.

gordalina avatar gordalina commented on July 19, 2024

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.

bodiski avatar bodiski commented on July 19, 2024

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.

gordalina avatar gordalina commented on July 19, 2024

That looks like a opcache issue, not really sure what is it though.

from cachetool.

gordalina avatar gordalina commented on July 19, 2024

Closing this issue, feel free to reopen if you have anything else new.

from cachetool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.