Система Debian 6.
Подключил репозиторий дотдеба:
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable allУстановил nginx 1.0.1
Установил PHP Version 5.3.6-6~dotdeb.1Но кажется с php-fpm проблемы: дикие тормоза, страницы генерируются по 16 сек, в лог /var/log/php5-fpm.log пишется:
tail /var/log/php5-fpm.log
[15-May-2011 00:48:32] NOTICE: fpm is running, pid 19703
[15-May-2011 00:48:32] NOTICE: ready to handle connections
[15-May-2011 00:49:16] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 8 children, there are 3 idle, and 47 total children
[15-May-2011 00:49:17] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 16 children, there are 9 idle, and 54 total children
[15-May-2011 00:49:18] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 32 children, there are 9 idle, and 55 total children
[15-May-2011 00:49:19] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 32 children, there are 7 idle, and 56 total children
[15-May-2011 00:49:20] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 32 children, there are 9 idle, and 59 total children
[15-May-2011 00:49:21] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 32 children, there are 9 idle, and 60 total children
[15-May-2011 00:49:22] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 32 children, there are 8 idle, and 61 total children
[15-May-2011 00:49:23] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 32 children, there are 9 idle, and 63 total childrenПробовал увеличивать в /etc/php5/fpm/pool.d/www.conf
pm.max_children = 200
pm.start_servers = 40
pm.min_spare_servers = 10
pm.max_spare_servers = 70
pm.max_requests = 500
Не помогло - растут только соответствующие цифры в логе.Помогите разобраться в проблеме.
Удалось выяснить следующее: проблемы в связке php-mysql.Нагрузку давал siege'ом.
Результаты отдачи статического файла:
Transactions: 7824 hits
Availability: 87.28 %
Elapsed time: 252.56 secs
Data transferred: 105.57 MB
Response time: 2.38 secs
Transaction rate: 30.98 trans/sec
Throughput: 0.42 MB/sec
Concurrency: 73.60
Successful transactions: 7824
Failed transactions: 1140
Longest transaction: 24.63
Shortest transaction: 0.13Response time - это среднее время загрузки страницы. Тут 2 сек.
То есть с nginx все нормально.Вот результаты отдачи файла <?php phpinfo(); ?>
Transactions: 7821 hits
Availability: 86.56 %
Elapsed time: 255.03 secs
Data transferred: 64.80 MB
Response time: 1.98 secs
Transaction rate: 30.67 trans/sec
Throughput: 0.25 MB/sec
Concurrency: 60.87
Successful transactions: 7821
Failed transactions: 1214
Longest transaction: 24.15
Shortest transaction: 0.09Response time: 1.98 secs - нормальный показатель. То есть сам php, если не обращается к Mysql работает нормально.
А вот такой ужас при тестировании реальных страниц сайта, то есть тех, где срабатывает связка php-mysql:
Transactions: 1626 hits
Availability: 76.55 %
Elapsed time: 299.95 secs
Data transferred: 16.96 MB
Response time: 25.59 secs
Transaction rate: 5.42 trans/sec
Throughput: 0.06 MB/sec
Concurrency: 138.74
Successful transactions: 1626
Failed transactions: 498
Longest transaction: 32.63
Shortest transaction: 15.6224 сек ждать загрузки страницы это конечно кошмар. Но что интересно, проблема не в нагрузке mysql на систему - по top'у все ок - по нулям, mysql не жрет ресурсов вообще. То есть где-то срабатывает задержка в самой связке php-mysql.
Кто может подсказать, что это такое?
Пока ждал ответа, сам уже во всем разобрался.
Спасибо :)
> Пока ждал ответа, сам уже во всем разобрался.расскажите, что было и как исправили.