atomic deployments with Nginx and PHP FPM The 2019 Stack Overflow Developer Survey Results Are InBlank Page: wordpress on nginx+php-fpmnginx not able to connect to php-fpm socketchrooting php-fpm with nginxA complicated nginx/php-fpm chroot setupNginx php-fpm pool being blocked and stop respondingnginx php5-fpm path_info urls and root locationNGINX don't parse .php5 as .phpnginx and php-fpm permissionnginx and php-fpm “Primary script unknown”What's the Relationship Between an nginx worker_process and PHP-FPM

One word riddle: Vowel in the middle

What is the closest word meaning "respect for time / mindful"

What does ひと匙 mean in this manga and has it been used colloquially?

What do the Banks children have against barley water?

Does the shape of a die affect the probability of a number being rolled?

A poker game description that does not feel gimmicky

How technical should a Scrum Master be to effectively remove impediments?

Is an up-to-date browser secure on an out-of-date OS?

Why didn't the Event Horizon Telescope team mention Sagittarius A*?

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Did Section 31 appear in Star Trek: The Next Generation?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

Shouldn't "much" here be used instead of "more"?

Time travel alters history but people keep saying nothing's changed

Are there incongruent pythagorean triangles with the same perimeter and same area?

Origin of "cooter" meaning "vagina"

Aging parents with no investments

Where to refill my bottle in India?

Is bread bad for ducks?

FPGA - DIY Programming

How to answer pointed "are you quitting" questioning when I don't want them to suspect

Are there any other methods to apply to solving simultaneous equations?

Why is the maximum length of OpenWrt’s root password 8 characters?



atomic deployments with Nginx and PHP FPM



The 2019 Stack Overflow Developer Survey Results Are InBlank Page: wordpress on nginx+php-fpmnginx not able to connect to php-fpm socketchrooting php-fpm with nginxA complicated nginx/php-fpm chroot setupNginx php-fpm pool being blocked and stop respondingnginx php5-fpm path_info urls and root locationNGINX don't parse .php5 as .phpnginx and php-fpm permissionnginx and php-fpm “Primary script unknown”What's the Relationship Between an nginx worker_process and PHP-FPM



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I'm trying to get atomic deployments, I don't want to lose/drop any requests.



I deploy the code using Capistrano, classic situation were you have a 'current' dir that is a symlink to
the latest release in the 'release' folder.
I'm using Nginx, PHP 5.5 FPM with Opcache.
Following the idea of just using $realpath_root in Nginx I'm expecting that a simple nginx reload would suffice, but it's not.
With nginx reload it seems that I'm not losing any requests but php-fpm is still executing the code from the previous old dir.
If I do a 'php-fpm reload' then php fpm is reading from the new dir but I can still see that I'm losing some requests:




'recv() failed (104: Connection reset by peer) while reading response header from upstream'




The question is: should I reload PHP FPM or not?



From what I understand nginx is passing the path to php-fpm and from the nginx debug log I can see that the path passed is the right one but php-fpm still executes the old one.



2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/current/web"
2014/09/23 17:13:22 [debug] 26234#0: *1742 posix_memalign: 00000000010517A0:4096 @16
2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "SCRIPT_FILENAME"
2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/ive/releases/20140923124417/web"
2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/app.php"
2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "SCRIPT_FILENAME: /shop/www/htdocs/live/releases/20140923124417/web/app.php"
2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "DOCUMENT_ROOT"
2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/live/releases/20140923124417/web"
2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "DOCUMENT_ROOT: /shop/www/htdocs/live/releases/20140923124417/web"
2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "APPLICATION_ENV"


What am I missing? thanks










share|improve this question






























    1















    I'm trying to get atomic deployments, I don't want to lose/drop any requests.



    I deploy the code using Capistrano, classic situation were you have a 'current' dir that is a symlink to
    the latest release in the 'release' folder.
    I'm using Nginx, PHP 5.5 FPM with Opcache.
    Following the idea of just using $realpath_root in Nginx I'm expecting that a simple nginx reload would suffice, but it's not.
    With nginx reload it seems that I'm not losing any requests but php-fpm is still executing the code from the previous old dir.
    If I do a 'php-fpm reload' then php fpm is reading from the new dir but I can still see that I'm losing some requests:




    'recv() failed (104: Connection reset by peer) while reading response header from upstream'




    The question is: should I reload PHP FPM or not?



    From what I understand nginx is passing the path to php-fpm and from the nginx debug log I can see that the path passed is the right one but php-fpm still executes the old one.



    2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/current/web"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 posix_memalign: 00000000010517A0:4096 @16
    2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "SCRIPT_FILENAME"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/ive/releases/20140923124417/web"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/app.php"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "SCRIPT_FILENAME: /shop/www/htdocs/live/releases/20140923124417/web/app.php"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "DOCUMENT_ROOT"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/live/releases/20140923124417/web"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "DOCUMENT_ROOT: /shop/www/htdocs/live/releases/20140923124417/web"
    2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "APPLICATION_ENV"


    What am I missing? thanks










    share|improve this question


























      1












      1








      1








      I'm trying to get atomic deployments, I don't want to lose/drop any requests.



      I deploy the code using Capistrano, classic situation were you have a 'current' dir that is a symlink to
      the latest release in the 'release' folder.
      I'm using Nginx, PHP 5.5 FPM with Opcache.
      Following the idea of just using $realpath_root in Nginx I'm expecting that a simple nginx reload would suffice, but it's not.
      With nginx reload it seems that I'm not losing any requests but php-fpm is still executing the code from the previous old dir.
      If I do a 'php-fpm reload' then php fpm is reading from the new dir but I can still see that I'm losing some requests:




      'recv() failed (104: Connection reset by peer) while reading response header from upstream'




      The question is: should I reload PHP FPM or not?



      From what I understand nginx is passing the path to php-fpm and from the nginx debug log I can see that the path passed is the right one but php-fpm still executes the old one.



      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/current/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 posix_memalign: 00000000010517A0:4096 @16
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "SCRIPT_FILENAME"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/ive/releases/20140923124417/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/app.php"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "SCRIPT_FILENAME: /shop/www/htdocs/live/releases/20140923124417/web/app.php"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "DOCUMENT_ROOT"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/live/releases/20140923124417/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "DOCUMENT_ROOT: /shop/www/htdocs/live/releases/20140923124417/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "APPLICATION_ENV"


      What am I missing? thanks










      share|improve this question
















      I'm trying to get atomic deployments, I don't want to lose/drop any requests.



      I deploy the code using Capistrano, classic situation were you have a 'current' dir that is a symlink to
      the latest release in the 'release' folder.
      I'm using Nginx, PHP 5.5 FPM with Opcache.
      Following the idea of just using $realpath_root in Nginx I'm expecting that a simple nginx reload would suffice, but it's not.
      With nginx reload it seems that I'm not losing any requests but php-fpm is still executing the code from the previous old dir.
      If I do a 'php-fpm reload' then php fpm is reading from the new dir but I can still see that I'm losing some requests:




      'recv() failed (104: Connection reset by peer) while reading response header from upstream'




      The question is: should I reload PHP FPM or not?



      From what I understand nginx is passing the path to php-fpm and from the nginx debug log I can see that the path passed is the right one but php-fpm still executes the old one.



      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/current/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 posix_memalign: 00000000010517A0:4096 @16
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "SCRIPT_FILENAME"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/ive/releases/20140923124417/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/app.php"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "SCRIPT_FILENAME: /shop/www/htdocs/live/releases/20140923124417/web/app.php"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "DOCUMENT_ROOT"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script var: "/shop/www/htdocs/live/releases/20140923124417/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 fastcgi param: "DOCUMENT_ROOT: /shop/www/htdocs/live/releases/20140923124417/web"
      2014/09/23 17:13:22 [debug] 26234#0: *1742 http script copy: "APPLICATION_ENV"


      What am I missing? thanks







      nginx php-fpm php5 deployment






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 23 '14 at 18:26







      cirpo

















      asked Sep 23 '14 at 13:31









      cirpocirpo

      1092




      1092




















          2 Answers
          2






          active

          oldest

          votes


















          0














          It sounds like you have made changes to the default OPcache configuration.



          The defaults are:



          opcache.validate_timestamps = 1
          opcache.revalidate_freq = 2


          This specifies whether and for how long OPcache should wait before checking to see if a file on disk has changed. In this case, yes, and after two seconds.



          First, try re-enabling this option, as it sounds like you have turned it off.






          share|improve this answer























          • why? opcache works with realpath as far as I know.

            – cirpo
            Sep 23 '14 at 13:38











          • checking what opcache contains I can see different paths for the same file, so it shouldn't be the problem... right?

            – cirpo
            Sep 23 '14 at 13:39


















          0














          I also faced that issue then finally I make a solution.



          $ curl -sO http://gordalina.github.io/cachetool/downloads/cachetool.phar
          $ chmod +x cachetool.phar


          You can connect to a automatically guessed fastcgi server (if /var/run/php5-fpm.sock is a file or 127.0.0.1:9000)



          apc
          apc:bin:dump Get a binary dump of files and user variables
          apc:bin:load Load a binary dump into the APC file and user variables
          apc:cache:clear Clears APC cache (user, system or all)
          apc:cache:info Shows APC user & system cache information
          apc:cache:info:file Shows APC file cache information
          apc:key:delete Deletes an APC key
          apc:key:exists Checks if an APC key exists
          apc:key:fetch Shows the content of an APC key
          apc:key:store Store an APC key with given value
          apc:sma:info Show APC shared memory allocation information
          opcache
          opcache:configuration Get configuration information about the cache
          opcache:reset Resets the contents of the opcode cache
          opcache:status Show summary information about the opcode cache
          opcache:status:scripts Show scripts in the opcode cache


          Example :



           [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
          +----------------------+---------------------------------+
          | Name | Value |
          +----------------------+---------------------------------+
          | Enabled | Yes |
          | Cache full | No |
          | Restart pending | No |
          | Restart in progress | No |
          | Memory used | 42.71 MiB |
          | Memory free | 85.29 MiB |
          | Memory wasted (%) | 0 b (0%) |
          | Strings buffer size | 8 MiB |
          | Strings memory used | 5.31 MiB |
          | Strings memory free | 2.69 MiB |
          | Number of strings | 103847 |
          +----------------------+---------------------------------+
          | Cached scripts | 1261 |
          | Cached keys | 2748 |
          | Max cached keys | 7963 |
          | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
          | Last restart time | Thu, 08 Feb 2018 03:10:19 +0000 |
          | Oom restarts | 0 |
          | Hash restarts | 0 |
          | Manual restarts | 1 |
          | Hits | 47839 |
          | Misses | 1269 |
          | Blacklist misses (%) | 0 (0%) |
          | Opcache hit rate | 97.415899649752 |
          +----------------------+---------------------------------+
          [root@ip-172-31-5-244 ~]#
          [root@ip-172-31-5-244 ~]#
          [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:reset
          [root@ip-172-31-5-244 ~]#
          [root@ip-172-31-5-244 ~]#
          [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
          +----------------------+---------------------------------+
          | Name | Value |
          +----------------------+---------------------------------+
          | Enabled | Yes |
          | Cache full | No |
          | Restart pending | No |
          | Restart in progress | No |
          | Memory used | 10.43 MiB |
          | Memory free | 117.57 MiB |
          | Memory wasted (%) | 0 b (0%) |
          | Strings buffer size | 8 MiB |
          | Strings memory used | 545.69 KiB |
          | Strings memory free | 7.47 MiB |
          | Number of strings | 103847 |
          +----------------------+---------------------------------+
          | Cached scripts | 0 |
          | Cached keys | 0 |
          | Max cached keys | 7963 |
          | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
          | Last restart time | Thu, 08 Feb 2018 03:19:00 +0000 |
          | Oom restarts | 0 |
          | Hash restarts | 0 |
          | Manual restarts | 2 |
          | Hits | 0 |
          | Misses | 2 |
          | Blacklist misses (%) | 0 (0%) |
          | Opcache hit rate | 0 |
          +----------------------+---------------------------------+


          You can notice that the memory , cache keys , hits everythings became 0 :-). Its very useful. I also intrigrated it with Ansible easily.



          Its application for apcu and others stuffs : Check more there
          http://gordalina.github.io/cachetool/






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "2"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f630573%2fatomic-deployments-with-nginx-and-php-fpm%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It sounds like you have made changes to the default OPcache configuration.



            The defaults are:



            opcache.validate_timestamps = 1
            opcache.revalidate_freq = 2


            This specifies whether and for how long OPcache should wait before checking to see if a file on disk has changed. In this case, yes, and after two seconds.



            First, try re-enabling this option, as it sounds like you have turned it off.






            share|improve this answer























            • why? opcache works with realpath as far as I know.

              – cirpo
              Sep 23 '14 at 13:38











            • checking what opcache contains I can see different paths for the same file, so it shouldn't be the problem... right?

              – cirpo
              Sep 23 '14 at 13:39















            0














            It sounds like you have made changes to the default OPcache configuration.



            The defaults are:



            opcache.validate_timestamps = 1
            opcache.revalidate_freq = 2


            This specifies whether and for how long OPcache should wait before checking to see if a file on disk has changed. In this case, yes, and after two seconds.



            First, try re-enabling this option, as it sounds like you have turned it off.






            share|improve this answer























            • why? opcache works with realpath as far as I know.

              – cirpo
              Sep 23 '14 at 13:38











            • checking what opcache contains I can see different paths for the same file, so it shouldn't be the problem... right?

              – cirpo
              Sep 23 '14 at 13:39













            0












            0








            0







            It sounds like you have made changes to the default OPcache configuration.



            The defaults are:



            opcache.validate_timestamps = 1
            opcache.revalidate_freq = 2


            This specifies whether and for how long OPcache should wait before checking to see if a file on disk has changed. In this case, yes, and after two seconds.



            First, try re-enabling this option, as it sounds like you have turned it off.






            share|improve this answer













            It sounds like you have made changes to the default OPcache configuration.



            The defaults are:



            opcache.validate_timestamps = 1
            opcache.revalidate_freq = 2


            This specifies whether and for how long OPcache should wait before checking to see if a file on disk has changed. In this case, yes, and after two seconds.



            First, try re-enabling this option, as it sounds like you have turned it off.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 23 '14 at 13:36









            Michael HamptonMichael Hampton

            174k27319646




            174k27319646












            • why? opcache works with realpath as far as I know.

              – cirpo
              Sep 23 '14 at 13:38











            • checking what opcache contains I can see different paths for the same file, so it shouldn't be the problem... right?

              – cirpo
              Sep 23 '14 at 13:39

















            • why? opcache works with realpath as far as I know.

              – cirpo
              Sep 23 '14 at 13:38











            • checking what opcache contains I can see different paths for the same file, so it shouldn't be the problem... right?

              – cirpo
              Sep 23 '14 at 13:39
















            why? opcache works with realpath as far as I know.

            – cirpo
            Sep 23 '14 at 13:38





            why? opcache works with realpath as far as I know.

            – cirpo
            Sep 23 '14 at 13:38













            checking what opcache contains I can see different paths for the same file, so it shouldn't be the problem... right?

            – cirpo
            Sep 23 '14 at 13:39





            checking what opcache contains I can see different paths for the same file, so it shouldn't be the problem... right?

            – cirpo
            Sep 23 '14 at 13:39













            0














            I also faced that issue then finally I make a solution.



            $ curl -sO http://gordalina.github.io/cachetool/downloads/cachetool.phar
            $ chmod +x cachetool.phar


            You can connect to a automatically guessed fastcgi server (if /var/run/php5-fpm.sock is a file or 127.0.0.1:9000)



            apc
            apc:bin:dump Get a binary dump of files and user variables
            apc:bin:load Load a binary dump into the APC file and user variables
            apc:cache:clear Clears APC cache (user, system or all)
            apc:cache:info Shows APC user & system cache information
            apc:cache:info:file Shows APC file cache information
            apc:key:delete Deletes an APC key
            apc:key:exists Checks if an APC key exists
            apc:key:fetch Shows the content of an APC key
            apc:key:store Store an APC key with given value
            apc:sma:info Show APC shared memory allocation information
            opcache
            opcache:configuration Get configuration information about the cache
            opcache:reset Resets the contents of the opcode cache
            opcache:status Show summary information about the opcode cache
            opcache:status:scripts Show scripts in the opcode cache


            Example :



             [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
            +----------------------+---------------------------------+
            | Name | Value |
            +----------------------+---------------------------------+
            | Enabled | Yes |
            | Cache full | No |
            | Restart pending | No |
            | Restart in progress | No |
            | Memory used | 42.71 MiB |
            | Memory free | 85.29 MiB |
            | Memory wasted (%) | 0 b (0%) |
            | Strings buffer size | 8 MiB |
            | Strings memory used | 5.31 MiB |
            | Strings memory free | 2.69 MiB |
            | Number of strings | 103847 |
            +----------------------+---------------------------------+
            | Cached scripts | 1261 |
            | Cached keys | 2748 |
            | Max cached keys | 7963 |
            | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
            | Last restart time | Thu, 08 Feb 2018 03:10:19 +0000 |
            | Oom restarts | 0 |
            | Hash restarts | 0 |
            | Manual restarts | 1 |
            | Hits | 47839 |
            | Misses | 1269 |
            | Blacklist misses (%) | 0 (0%) |
            | Opcache hit rate | 97.415899649752 |
            +----------------------+---------------------------------+
            [root@ip-172-31-5-244 ~]#
            [root@ip-172-31-5-244 ~]#
            [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:reset
            [root@ip-172-31-5-244 ~]#
            [root@ip-172-31-5-244 ~]#
            [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
            +----------------------+---------------------------------+
            | Name | Value |
            +----------------------+---------------------------------+
            | Enabled | Yes |
            | Cache full | No |
            | Restart pending | No |
            | Restart in progress | No |
            | Memory used | 10.43 MiB |
            | Memory free | 117.57 MiB |
            | Memory wasted (%) | 0 b (0%) |
            | Strings buffer size | 8 MiB |
            | Strings memory used | 545.69 KiB |
            | Strings memory free | 7.47 MiB |
            | Number of strings | 103847 |
            +----------------------+---------------------------------+
            | Cached scripts | 0 |
            | Cached keys | 0 |
            | Max cached keys | 7963 |
            | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
            | Last restart time | Thu, 08 Feb 2018 03:19:00 +0000 |
            | Oom restarts | 0 |
            | Hash restarts | 0 |
            | Manual restarts | 2 |
            | Hits | 0 |
            | Misses | 2 |
            | Blacklist misses (%) | 0 (0%) |
            | Opcache hit rate | 0 |
            +----------------------+---------------------------------+


            You can notice that the memory , cache keys , hits everythings became 0 :-). Its very useful. I also intrigrated it with Ansible easily.



            Its application for apcu and others stuffs : Check more there
            http://gordalina.github.io/cachetool/






            share|improve this answer



























              0














              I also faced that issue then finally I make a solution.



              $ curl -sO http://gordalina.github.io/cachetool/downloads/cachetool.phar
              $ chmod +x cachetool.phar


              You can connect to a automatically guessed fastcgi server (if /var/run/php5-fpm.sock is a file or 127.0.0.1:9000)



              apc
              apc:bin:dump Get a binary dump of files and user variables
              apc:bin:load Load a binary dump into the APC file and user variables
              apc:cache:clear Clears APC cache (user, system or all)
              apc:cache:info Shows APC user & system cache information
              apc:cache:info:file Shows APC file cache information
              apc:key:delete Deletes an APC key
              apc:key:exists Checks if an APC key exists
              apc:key:fetch Shows the content of an APC key
              apc:key:store Store an APC key with given value
              apc:sma:info Show APC shared memory allocation information
              opcache
              opcache:configuration Get configuration information about the cache
              opcache:reset Resets the contents of the opcode cache
              opcache:status Show summary information about the opcode cache
              opcache:status:scripts Show scripts in the opcode cache


              Example :



               [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
              +----------------------+---------------------------------+
              | Name | Value |
              +----------------------+---------------------------------+
              | Enabled | Yes |
              | Cache full | No |
              | Restart pending | No |
              | Restart in progress | No |
              | Memory used | 42.71 MiB |
              | Memory free | 85.29 MiB |
              | Memory wasted (%) | 0 b (0%) |
              | Strings buffer size | 8 MiB |
              | Strings memory used | 5.31 MiB |
              | Strings memory free | 2.69 MiB |
              | Number of strings | 103847 |
              +----------------------+---------------------------------+
              | Cached scripts | 1261 |
              | Cached keys | 2748 |
              | Max cached keys | 7963 |
              | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
              | Last restart time | Thu, 08 Feb 2018 03:10:19 +0000 |
              | Oom restarts | 0 |
              | Hash restarts | 0 |
              | Manual restarts | 1 |
              | Hits | 47839 |
              | Misses | 1269 |
              | Blacklist misses (%) | 0 (0%) |
              | Opcache hit rate | 97.415899649752 |
              +----------------------+---------------------------------+
              [root@ip-172-31-5-244 ~]#
              [root@ip-172-31-5-244 ~]#
              [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:reset
              [root@ip-172-31-5-244 ~]#
              [root@ip-172-31-5-244 ~]#
              [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
              +----------------------+---------------------------------+
              | Name | Value |
              +----------------------+---------------------------------+
              | Enabled | Yes |
              | Cache full | No |
              | Restart pending | No |
              | Restart in progress | No |
              | Memory used | 10.43 MiB |
              | Memory free | 117.57 MiB |
              | Memory wasted (%) | 0 b (0%) |
              | Strings buffer size | 8 MiB |
              | Strings memory used | 545.69 KiB |
              | Strings memory free | 7.47 MiB |
              | Number of strings | 103847 |
              +----------------------+---------------------------------+
              | Cached scripts | 0 |
              | Cached keys | 0 |
              | Max cached keys | 7963 |
              | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
              | Last restart time | Thu, 08 Feb 2018 03:19:00 +0000 |
              | Oom restarts | 0 |
              | Hash restarts | 0 |
              | Manual restarts | 2 |
              | Hits | 0 |
              | Misses | 2 |
              | Blacklist misses (%) | 0 (0%) |
              | Opcache hit rate | 0 |
              +----------------------+---------------------------------+


              You can notice that the memory , cache keys , hits everythings became 0 :-). Its very useful. I also intrigrated it with Ansible easily.



              Its application for apcu and others stuffs : Check more there
              http://gordalina.github.io/cachetool/






              share|improve this answer

























                0












                0








                0







                I also faced that issue then finally I make a solution.



                $ curl -sO http://gordalina.github.io/cachetool/downloads/cachetool.phar
                $ chmod +x cachetool.phar


                You can connect to a automatically guessed fastcgi server (if /var/run/php5-fpm.sock is a file or 127.0.0.1:9000)



                apc
                apc:bin:dump Get a binary dump of files and user variables
                apc:bin:load Load a binary dump into the APC file and user variables
                apc:cache:clear Clears APC cache (user, system or all)
                apc:cache:info Shows APC user & system cache information
                apc:cache:info:file Shows APC file cache information
                apc:key:delete Deletes an APC key
                apc:key:exists Checks if an APC key exists
                apc:key:fetch Shows the content of an APC key
                apc:key:store Store an APC key with given value
                apc:sma:info Show APC shared memory allocation information
                opcache
                opcache:configuration Get configuration information about the cache
                opcache:reset Resets the contents of the opcode cache
                opcache:status Show summary information about the opcode cache
                opcache:status:scripts Show scripts in the opcode cache


                Example :



                 [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
                +----------------------+---------------------------------+
                | Name | Value |
                +----------------------+---------------------------------+
                | Enabled | Yes |
                | Cache full | No |
                | Restart pending | No |
                | Restart in progress | No |
                | Memory used | 42.71 MiB |
                | Memory free | 85.29 MiB |
                | Memory wasted (%) | 0 b (0%) |
                | Strings buffer size | 8 MiB |
                | Strings memory used | 5.31 MiB |
                | Strings memory free | 2.69 MiB |
                | Number of strings | 103847 |
                +----------------------+---------------------------------+
                | Cached scripts | 1261 |
                | Cached keys | 2748 |
                | Max cached keys | 7963 |
                | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
                | Last restart time | Thu, 08 Feb 2018 03:10:19 +0000 |
                | Oom restarts | 0 |
                | Hash restarts | 0 |
                | Manual restarts | 1 |
                | Hits | 47839 |
                | Misses | 1269 |
                | Blacklist misses (%) | 0 (0%) |
                | Opcache hit rate | 97.415899649752 |
                +----------------------+---------------------------------+
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:reset
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
                +----------------------+---------------------------------+
                | Name | Value |
                +----------------------+---------------------------------+
                | Enabled | Yes |
                | Cache full | No |
                | Restart pending | No |
                | Restart in progress | No |
                | Memory used | 10.43 MiB |
                | Memory free | 117.57 MiB |
                | Memory wasted (%) | 0 b (0%) |
                | Strings buffer size | 8 MiB |
                | Strings memory used | 545.69 KiB |
                | Strings memory free | 7.47 MiB |
                | Number of strings | 103847 |
                +----------------------+---------------------------------+
                | Cached scripts | 0 |
                | Cached keys | 0 |
                | Max cached keys | 7963 |
                | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
                | Last restart time | Thu, 08 Feb 2018 03:19:00 +0000 |
                | Oom restarts | 0 |
                | Hash restarts | 0 |
                | Manual restarts | 2 |
                | Hits | 0 |
                | Misses | 2 |
                | Blacklist misses (%) | 0 (0%) |
                | Opcache hit rate | 0 |
                +----------------------+---------------------------------+


                You can notice that the memory , cache keys , hits everythings became 0 :-). Its very useful. I also intrigrated it with Ansible easily.



                Its application for apcu and others stuffs : Check more there
                http://gordalina.github.io/cachetool/






                share|improve this answer













                I also faced that issue then finally I make a solution.



                $ curl -sO http://gordalina.github.io/cachetool/downloads/cachetool.phar
                $ chmod +x cachetool.phar


                You can connect to a automatically guessed fastcgi server (if /var/run/php5-fpm.sock is a file or 127.0.0.1:9000)



                apc
                apc:bin:dump Get a binary dump of files and user variables
                apc:bin:load Load a binary dump into the APC file and user variables
                apc:cache:clear Clears APC cache (user, system or all)
                apc:cache:info Shows APC user & system cache information
                apc:cache:info:file Shows APC file cache information
                apc:key:delete Deletes an APC key
                apc:key:exists Checks if an APC key exists
                apc:key:fetch Shows the content of an APC key
                apc:key:store Store an APC key with given value
                apc:sma:info Show APC shared memory allocation information
                opcache
                opcache:configuration Get configuration information about the cache
                opcache:reset Resets the contents of the opcode cache
                opcache:status Show summary information about the opcode cache
                opcache:status:scripts Show scripts in the opcode cache


                Example :



                 [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
                +----------------------+---------------------------------+
                | Name | Value |
                +----------------------+---------------------------------+
                | Enabled | Yes |
                | Cache full | No |
                | Restart pending | No |
                | Restart in progress | No |
                | Memory used | 42.71 MiB |
                | Memory free | 85.29 MiB |
                | Memory wasted (%) | 0 b (0%) |
                | Strings buffer size | 8 MiB |
                | Strings memory used | 5.31 MiB |
                | Strings memory free | 2.69 MiB |
                | Number of strings | 103847 |
                +----------------------+---------------------------------+
                | Cached scripts | 1261 |
                | Cached keys | 2748 |
                | Max cached keys | 7963 |
                | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
                | Last restart time | Thu, 08 Feb 2018 03:10:19 +0000 |
                | Oom restarts | 0 |
                | Hash restarts | 0 |
                | Manual restarts | 1 |
                | Hits | 47839 |
                | Misses | 1269 |
                | Blacklist misses (%) | 0 (0%) |
                | Opcache hit rate | 97.415899649752 |
                +----------------------+---------------------------------+
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:reset
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]#
                [root@ip-172-31-5-244 ~]# php cachetool.phar opcache:status
                +----------------------+---------------------------------+
                | Name | Value |
                +----------------------+---------------------------------+
                | Enabled | Yes |
                | Cache full | No |
                | Restart pending | No |
                | Restart in progress | No |
                | Memory used | 10.43 MiB |
                | Memory free | 117.57 MiB |
                | Memory wasted (%) | 0 b (0%) |
                | Strings buffer size | 8 MiB |
                | Strings memory used | 545.69 KiB |
                | Strings memory free | 7.47 MiB |
                | Number of strings | 103847 |
                +----------------------+---------------------------------+
                | Cached scripts | 0 |
                | Cached keys | 0 |
                | Max cached keys | 7963 |
                | Start time | Thu, 08 Feb 2018 02:28:56 +0000 |
                | Last restart time | Thu, 08 Feb 2018 03:19:00 +0000 |
                | Oom restarts | 0 |
                | Hash restarts | 0 |
                | Manual restarts | 2 |
                | Hits | 0 |
                | Misses | 2 |
                | Blacklist misses (%) | 0 (0%) |
                | Opcache hit rate | 0 |
                +----------------------+---------------------------------+


                You can notice that the memory , cache keys , hits everythings became 0 :-). Its very useful. I also intrigrated it with Ansible easily.



                Its application for apcu and others stuffs : Check more there
                http://gordalina.github.io/cachetool/







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 8 '18 at 3:27









                Kernelv5Kernelv5

                1445




                1445



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f630573%2fatomic-deployments-with-nginx-and-php-fpm%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company