nginx + php-fpm (5.5) + fastcgi + OPcache에서 Wordpress가 무겁습니다.
(fastcgi나 nginx+php-fpm의 구축 등은 할애합니다.)
환경은
nginx 1.6.2
PHP 5.5.22
FPM/FastCGI + cache
Opcache v7.0.4
에서 주로 Wordpress를 이용한 웹사이트를 운영하고 있습니다. 월간 PV는 대략 30만 정도

지난 며칠 여러가지 망설이고 문득 Server monitor를 보면 이런 일이 되어 있었습니다. CPU 사용률이 화상에 높고 제대로 사이트에 접속할 수 없게 되었습니다.
top 명령으로 모습을 보면

php-fpm 프로세스가 CPU를 점거했습니다.
이때의 www.conf 은 이런 느낌
/etc/php-fpm.d/www.conf
pm = dynamic
pm.max_children = 20
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 15
pm.max_requests = 500
여러가지 조사하면 pm = dynamic 은 pm = ondemand 쪽이 좋게 나옵니다만 이 부분을 바꾸어도 우리의 서버에서는 그다지 변화는 없었습니다.
fastcgi가 만든 캐시에 대한 액세스는 전혀 문제가 없지만 php-fpm 프로세스가 처리를 시작하면 갑자기 무거워집니다. Wordpress의 관리 화면에 액세스하면 체감으로 잘 알 수 있습니다.
php-fpm 유닉스 소켓 통신 문제? → 127.0.0.1:9000으로 변경해도 변경 없음
그렇다면 OPcache가 작동하지 않습니다?
$ php -v
PHP 5.5.22 (cli) (built: Feb 18 2015 17:54:45)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans
움직이는
$ vim /etc/php.d/opcache.ini
opcache.enable=1
제대로 1이 되어 있다.
흠
그리고 문득 눈치챘다

with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans
...
설마
디버그 상태로 움직이고 있었습니다. 라고 할까 보통으로 인스톨 했을 뿐이었을 것입니다만… 왜인가 with Xdebug v2.2 ~ 하지만. 원인은 이것 같다?
$ vim /etc/php.d/xdebug.ini
zend_extension=xdebug.so
xdebug.remote_autostart=0
xdebug.remote_enable=0
xdebug.profiler_enable=0
0으로 저장.
서버를 다시 로드해 보았습니다만… 변하지 않습니다.
$ vim /etc/php.d/xdebug.ini
;zend_extension=xdebug.so
xdebug.remote_autostart=0
xdebug.remote_enable=0
xdebug.profiler_enable=0
;zend_extension=xdebug.so
강제로 코멘트 아웃!

with Xdebug가 사라졌습니다.
php-fpm -t && service php-fpm reload
nginx -t && service nginx reload
그러면
.
..
...
....

!

,. --==,,
,. ===,, o ○o. i :
,/ ``ヾ```ヽ, .l :
// .::::/ :::::!===l :::|
/./ .:::::/ ::::l | _ .....::::|} ヽ l-,
,오쿠 ,'.._ .::::/ ::::l :l '´ `)'
/::{ ヽ, `
丶、;/‐‐- 、::::l
'::┬---<_ } ./;:::::\/:::::::::! ,>----'ー- ..._)이 ,. ----, ト, |l::ヽ /;';';';';::::\
/|::::::;';';'\/} (ヽ、 /| (´ _,.ィ!::ヽ. ヾー´´;';';';';'; ';';::/ヽ,
…하지만 아직 높은 느낌
하지만, 머리가 치는 것보다는 좋기 때문에 일단 이대로 모습 보고…
뭔가 다른 원인이 있을까
Reference
이 문제에 관하여(nginx + php-fpm (5.5) + fastcgi + OPcache에서 Wordpress가 무겁습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/nabeyaki/items/d19413ad639a8f9dfb4d텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)