Я запускаю многосайтовый WordPress на amazon micro ec2 с suexec, Apache и php CGi на Ubuntu 12.04. Однако у меня было много ошибок Internal server 500, и я нахожусь в процессе отладки, чтобы найти решение. . Я разместил свои журналы ошибок ниже
example.com error.log:
[Fri Oct 26 10:10:08 2012] [warn] [client 23.23.xxx.xx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Fri Oct 26 10:10:08 2012] [error] [client 23.23.xxx.xx] Premature end of script headers: wp-cron.php
[Fri Oct 26 10:50:04 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/
[Fri Oct 26 10:50:04 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: admin.php, referer: https://www.example.com/wp-admin/
[Fri Oct 26 10:58:14 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/network/index.php
[Fri Oct 26 10:58:15 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: admin-ajax.php, referer: https://www.example.com/wp-admin/network/index.php
[Fri Oct 26 10:58:56 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/network/index.php
[Fri Oct 26 10:58:57 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: plugins.php, referer: https://www.example.com/wp-admin/network/index.php
[Fri Oct 26 10:59:18 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/network/index.php
[Fri Oct 26 10:59:18 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: admin-ajax.php, referer: https://www.example.com/wp-admin/network/index.php
[Fri Oct 26 11:01:49 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/
[Fri Oct 26 11:01:49 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: https://www.example.com/wp-admin/
Журнал Apache:
php (pre-forking): Cannot allocate memory
php (pre-forking): Cannot allocate memory
Recipient names must be specified
Recipient names must be specified
php (pre-forking): Cannot allocate memory
php (pre-forking): Cannot allocate memory
php (pre-forking): Cannot allocate memory
[Fri Oct 26 10:49:33 2012] [warn] mod_fcgid: cleanup zombie process 2852
[Fri Oct 26 10:49:33 2012] [warn] mod_fcgid: cleanup zombie process 2851
[Fri Oct 26 10:49:33 2012] [warn] mod_fcgid: cleanup zombie process 2853
[Fri Oct 26 10:58:22 2012] [warn] mod_fcgid: process 2892 graceful kill fail, sending SIGKILL
php (pre-forking): Cannot allocate memory
[Fri Oct 26 10:59:21 2012] [warn] mod_fcgid: process 2894 graceful kill fail, sending SIGKILL
[Fri Oct 26 10:59:25 2012] [warn] mod_fcgid: process 2866 graceful kill fail, sending SIGKILL
suexec.log:
[2012-10-25 16:05:36]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 18:09:38]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 18:09:51]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 18:14:03]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 18:14:06]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 18:14:35]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 20:20:27]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 20:20:29]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 20:20:31]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 21:42:12]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-25 22:56:50]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 02:34:43]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 04:25:07]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 06:35:19]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 06:40:05]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 07:22:45]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 10:10:05]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 10:49:24]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
[2012-10-26 10:49:24]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
на основании логов можно определить, в чем может быть причина этого? Думая, что это может быть микро-экземпляр, я думаю о модернизации до маленького.
Любая помощь будет принята с благодарностью.
Это результат после ввода free -m
total used free shared buffers cached
Mem: 590 583 6 0 2 22
-/+ buffers/cache: 559 30
Swap: 0 0 0
Я обновился с экземпляра Miro до экземпляра Small, который, похоже, решил проблему, не более 500 ошибок.
Похоже, что у экземпляра Miro недостаточно памяти для эффективной работы WordPress Multi-Site на постоянной основе.
Если вам хочется иметь сверхмедленный сервер, вы можете добавить еще один EBS и использовать его в качестве свопа.
В противном случае вы можете попробовать уменьшить лимит памяти php (он установлен в php.ini
), удалив неиспользуемые расширения php или перейдя на что-то более легкое, например nginx + php-fpm.