ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nginx + php5 + php-fpm через /tmp/php-fpm.s ock


  • To: nginx-ru@xxxxxxxxx
  • Subject: nginx + php5 + php-fpm через /tmp/php-fpm.s ock
  • From: temp temp <temporary.mine@xxxxxxxxx>
  • Date: Fri, 2 Jul 2010 19:40:26 +0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=0VKMfubYdSVce/JOIDRLVkMU4LpcKZfgNUvcV7rgE0w=; b=Ro2b/2e/JsIN6N8ssCOAsic0+/cLGHtqZs4GjQEjL3MxIB9dXx13Y4D9mSBttpvLyZ JJ9rJpasGTVXx8G/zSlMQxTYHUJzOcsuAReMoe0camZhp1d+iOS2i1nY4STfFBPV/wf8 R/NuJTyEOUI9WBiLJl8FOzsuaw4s7DiqSyVfI=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=YWep2/NU1IJ2Xt5/z9ScPotz17zMbdyc29gR3mwl9g2Keby3UVfp63/7QTUVg8R+jb 6pwvwoLRY/OpcN+4EVj2bBal83YEeLuFpLBAgfaqMSBraiT0BKVNeJCtllZKkP0SsFOe A3i7zbNL3Xt8cNgeZHwtc1b/pQ6Ot21GjaHpI=


При переключении fastcgi с tcp коннекта (fastcgi_pass 127.0.0.1:9000;) на сокеты (fastcgi_pass unix:/tmp/php-fpm.sock;) и появилась проблема... При загрузке файлов иногда (!) стала выдаваться 413 ошибка... в логах получаем следующее:

2010/06/27 10:55:50 [error] 44923#0: *309634 upstream timed out (60: Operation timed out) while sending request to upstream, client: 111.77.222.111, server: domain.ru, request: "POST /main/save/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:06:49 [error] 44922#0: *310300 upstream timed out (60: Operation timed out) while sending request to upstream, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:06:49 [error] 44922#0: *310300 client intended to send too large body: 8364210 bytes, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:07:59 [error] 44923#0: *310370 upstream timed out (60: Operation timed out) while sending request to upstream, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:07:59 [error] 44923#0: *310370 client intended to send too large body: 1318466 bytes, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:09:04 [error] 44923#0: *310467 upstream timed out (60: Operation timed out) while sending request to upstream, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:09:04 [error] 44923#0: *310467 client intended to send too large body: 8791573 bytes, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:10:31 [error] 44923#0: *310572 upstream timed out (60: Operation timed out) while sending request to upstream, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"
2010/06/27 11:10:31 [error] 44923#0: *310572 client intended to send too large body: 14275204 bytes, client: 111.77.222.111, server: domain.ru, request: "POST /main/saveTracks/?id=1261 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "domain.ru"


Срабатывает, по всей видимости, emergency_restart_interval php-fpm'а.(?) Переключая обратно, получаем отлично работающий механизм. Что делать и куда копать уже не знаю, перерыл за две недели много, всё обновлял до последних версий и переставлял заново - эффект нулевой...

из конфига php-fpm:
.......
<section name="global_options">
<value name="pid_file">/var/run/php-fpm.pid</value>
<value name="error_log">/var/log/php-fpm.log</value>
<value name="log_level">notice</value>
<value name="emergency_restart_threshold">10</value>
<value name="emergency_restart_interval">1m</value>
<value name="process_control_timeout">5s</value>
<value name="daemonize">yes</value>
</section>

<workers>
<section name="pool">
<value name="name">default</value>
<value name="listen_address">/tmp/php-fpm.sock</value>
<value name="listen_options">
<value name="backlog">-1</value>
<value name="owner">www</value>
<value name="group">www</value>
<value name="mode">0666</value>
</value>

Additional php.ini defines, specific to this pool of workers.
<value name="php_defines">
<!-- <value name="sendmail_path">/usr/sbin/sendmail -t -i</value> -->
<!-- <value name="display_errors">0</value> -->
</value>
<value name="user">www</value>
<value name="group">www</value>
<value name="pm">
..........


из nginx'а:
......
location ~ \.php$ {
try_files $uri $uri/ =404;
client_max_body_size 50m;
client_body_timeout 3m;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_ignore_client_abort on;
fastcgi_param SCRIPT_FILENAME /home/www/domain.ru$fastcgi_script_name;
fastcgi_param COUNTRY $country;
include fastcgi_params;
}
.....

С уважением,
Андрей Рубцов
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.