LinuxForum.Fans
Тема

интересная проблема с php-fpm

Автор: smert 5 сообщений 2667 просмотров
#388661

привет. вот такая очень интересная проблема с php-fpm )

скрипт([url]saygac.net/aa.php[/url]):

text
<?php

echo 11;

грузится около за 10 15 секунд)

лог:

text
[03-Aug-2014 03:39:02] NOTICE: error log file re-opened
[05-Aug-2014 10:33:08] WARNING: [pool www] child 481 exited on signal 9 (SIGKILL) after 60820.489870 seconds from start
[05-Aug-2014 10:33:08] NOTICE: [pool www] child 26152 started
[05-Aug-2014 10:33:08] WARNING: [pool www] child 1765 exited on signal 9 (SIGKILL) after 36507.044314 seconds from start
[05-Aug-2014 10:33:08] NOTICE: [pool www] child 26153 started
[05-Aug-2014 10:33:08] WARNING: [pool www] child 1806 exited on signal 9 (SIGKILL) after 36503.042108 seconds from start
[05-Aug-2014 10:33:08] NOTICE: [pool www] child 26155 started
[05-Aug-2014 10:33:08] WARNING: [pool www] child 1818 exited on signal 9 (SIGKILL) after 36502.044885 seconds from start
[05-Aug-2014 10:33:08] NOTICE: [pool www] child 26157 started
[05-Aug-2014 10:33:08] WARNING: [pool www] child 1819 exited on signal 9 (SIGKILL) after 36502.046953 seconds from start
[05-Aug-2014 10:34:10] NOTICE: fpm is running, pid 26232
[05-Aug-2014 10:34:10] NOTICE: ready to handle connections
[05-Aug-2014 11:06:53] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 42 total children
[05-Aug-2014 11:06:54] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 2 idle, and 47 total children
[05-Aug-2014 11:06:55] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it
[05-Aug-2014 11:15:24] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 48 total children
[05-Aug-2014 11:15:25] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it
[05-Aug-2014 11:20:07] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 4 idle, and 45 total children
[05-Aug-2014 11:20:21] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it
[05-Aug-2014 11:26:02] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it
[05-Aug-2014 11:35:00] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 47 total children
[05-Aug-2014 11:35:01] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it

а так скорость сервера норм. скачал файл с размером 60 мб за 6 секунд. в чем проблема? кто-то встретился такой проблемой? )

#388665

содержимое aa.php такое?

text
<?php

echo 11;

Где закрывающий тег? Включите вывод ошибок для php...

#388701

"beliy" написал:
Где закрывающий тег? Включите вывод ошибок для php...
как я знаю закрывающий тег не играет роли. но все таки закрыл. display_errors on стоит.
[url]saygac.net/php.php[/url] phpinfo

ещё выяснилось что это происходит когда в mysql много записей. можно подумать что mysql дает нагрузку поэтому страница медленно работает, но тогда бы html страницы тоже медленно открылись бы.

[url]saygac.net/aa.html[/url] aa.html нормально открывается вне зависимости от mysql.

а [url]saygac.net/php.php[/url] phpinfo открывается сразу только если убить mysqld. содержание файла php.php:
text
<?php phpinfo(); ?>

установил лог для медленных запросов mysql, но лог пустой.

ssh top

text
top - 21:37:28 up 25 days,  3:02,  1 user,  load average: 1.51, 2.34, 2.09
Mem:   2044240k total,  1378496k used,   665744k free,   170764k buffers
Swap:   523260k total,        0k used,   523260k free,   870208k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 21909 mysql 20 0 138m 26m 5788 S 135.9 1.3 17:10.42 mysqld 18557 apache 20 0 35712 9268 3196 S 0.7 0.5 0:02.29 php-fpm 18572 apache 20 0 35916 9520 3368 S 0.7 0.5 0:02.53 php-fpm 18575 apache 20 0 33088 5728 2616 S 0.7 0.3 0:01.98 php-fpm 22236 apache 20 0 33088 5412 2572 S 0.7 0.3 0:01.19 php-fpm 16259 nginx 15 -5 9380 2904 896 S 0.3 0.1 0:17.66 nginx 18358 apache 20 0 33088 5680 2588 S 0.3 0.3 0:01.87 php-fpm 18359 apache 20 0 32824 5680 2612 S 0.3 0.3 0:01.81 php-fpm 18483 apache 20 0 32824 6296 3192 S 0.3 0.3 0:02.05 php-fpm 18493 apache 20 0 33088 6304 3192 S 0.3 0.3 0:01.96 php-fpm 18495 apache 20 0 33104 5676 2596 S 0.3 0.3 0:01.75 php-fpm 18544 apache 20 0 33104 6064 2764 S 0.3 0.3 0:01.92 php-fpm 18573 apache 20 0 32824 5712 2624 S 0.3 0.3 0:01.95 php-fpm 18574 apache 20 0 35660 9732 3792 S 0.3 0.5 0:02.45 php-fpm 18576 apache 20 0 38820 11m 3356 S 0.3 0.6 0:02.41 php-fpm 19560 apache 20 0 33088 5704 2604 S 0.3 0.3 0:01.73 php-fpm 22178 apache 20 0 32824 5672 2608 S 0.3 0.3 0:01.07 php-fpm 22205 apache 20 0 32824 5616 2584 S 0.3 0.3 0:01.17 php-fpm 22207 apache 20 0 32824 6244 3188 S 0.3 0.3 0:01.32 php-fpm

ну вот такой вот геморой )))

#388704

Это на виртуальной машине или обычной?

#388709

Да у вас похоже целый сборник проблем - мускул кушает многовато проца, в пхп-фпм похоже не оптимальное значение чилдов. Похоже вы дооптимизировались;)

Войдите или зарегистрируйтесь, чтобы ответить.