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;
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
add a comment |
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
add a comment |
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
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
nginx php-fpm php5 deployment
edited Sep 23 '14 at 18:26
cirpo
asked Sep 23 '14 at 13:31
cirpocirpo
1092
1092
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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.
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
add a comment |
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/
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
answered Sep 23 '14 at 13:36
Michael Hampton♦Michael 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
add a comment |
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
add a comment |
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/
add a comment |
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/
add a comment |
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/
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/
answered Feb 8 '18 at 3:27
Kernelv5Kernelv5
1445
1445
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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