Welcome! Log In Create A New Profile

Advanced

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

Posted by MG 
При переключении 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'а.
(?)
Переключая обратно, получаем отлично работающий механизм. Что делать и
куда копать уже не знаю, перерыл за две недели много, всё обновлял до
последних версий и переставлял заново - эффект нулевой...
MG1
Re: nginx + php5 + php-fpm через /tmp/php-fpm.sock
June 28, 2010 03:05PM
есть у кого мысли какие-нибудь, куда копать?
А что неработает?

On 28 июн, 22:05, "MG1" <nginx-fo...@nginx.us> wrote:
> есть у кого мысли какие-нибудь, куда
> копать?
>
> Posted at Nginx Forum:http://forum.nginx.org/read.php?25,103011,103325#msg-103325
MG1
Re: nginx + php5 + php-fpm через /tmp/php-fpm.sock
June 28, 2010 05:29PM
чуть выше описано подробно... если кратко, то иногда вылетает ошибка 413 при загрузке файла. Валится где-то на php-fpm - не может заслать данные к php-приложению.
Re: nginx + php5 + php-fpm через /tmp/php-fpm.sock
June 29, 2010 03:56AM
не переключайте с тисипи сокета ))
MG1
Re: nginx + php5 + php-fpm через /tmp/php-fpm.sock
June 30, 2010 04:12AM
мм.. а если серьёзно? Почему такое может происходить?

[code]
.......
<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">
..........
[/code]


[code]
......
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;
}
.....
[/code]
MG1
Re: nginx + php5 + php-fpm через /tmp/php-fpm.sock
July 02, 2010 02:53AM
любая помощь приветствуется. Если нужна какая-то информация, логи - выложу.
Alexander Moskalenko
Re: nginx + php5 + php-fpm через /tmp/php-fpm.sock
July 18, 2010 07:48AM
попробуйте добавить

fastcgi_pass_request_body off;
client_body_in_file_only clean;

возможно fpm не нравится много данных через сокет

On Wed, Jun 30, 2010 at 11:12 AM, MG1 <nginx-forum@nginx.us> wrote:

> мм.. а если серьёзно? Почему такое может
> происходить?
>
> [code]
> .......
>
> /var/run/php-fpm.pid
> /var/log/php-fpm.log
> notice
> 10
> 1m
> 5s
> yes
>
>
>
>
> default
> /tmp/php-fpm.sock
>
> -1
> www
> www
> 0666
>
>
> Additional php.ini defines, specific to this
> pool of workers.
>
> <!-- /usr/sbin/sendmail -t -i -->
> <!-- 0
> -->
>
> www
> www
>
> ..........
> [/code]
>
>
> [code]
> ......
> 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;
> }
> .....
> [/code]
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?25,103011,103827#msg-103827
>
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 134
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready