Welcome! Log In Create A New Profile

Advanced

php-fpm падает при аплоаде больших файлов

Posted by Алексей Бобок 
Алексей Бобок
php-fpm падает при аплоаде больших файлов
December 22, 2010 08:58AM
bsd7.1, nginx/0.8.53, PHP 5.3.3 (fpm-fcgi)

при аплоаде больших файлов в момент окончания выгрузки файла на сервер,
получаю следующее:

nginx-error.log:
2010/12/20 19:25:57 [error] 62584#0: *5505 upstream sent unexpected FastCGI
record: 3 while reading response header from upstream, client:
1291.68.12.97, server: upload.local, request: "POST
/upload.php?file=T-Rex-Children.Of.The.Revolution.CD1.rar HTTP/1.1",
upstream: "fastcgi://127.0.0.1:9000", host: "upload.local", referrer: "
http://upload.local/"

php-fpm.log:
Dec 20 19:25:57.319526 [DEBUG] pid 18442, fpm_got_signal(), line 48:
received SIGCHLD
Dec 20 19:25:57.319779 [WARNING] pid 18442, fpm_children_bury(), line 249:
[pool www] child 18448 exited with code 255 after 448.143709 seconds from
start

в php.ini:

max_execution_time = 1800
max_input_time = 1800
post_max_size = 10G
upload_max_filesize = 10G
memory_limit = 1024M

в nginx.conf:
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 10G;
proxy_buffering on;
proxy_connect_timeout 75;
proxy_read_timeout 1800;
proxy_send_timeout 1800;
fastcgi_read_timeout 1800;
fastcgi_send_timeout 1800;
#access_log logs/access.log main;
sendfile on;
tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

gzip on;
gzip_buffers 4 4k;
gzip_proxied any;
gzip_comp_level 5;

server {
listen 192.168.12.133:80 accept_filter=httpready default;
server_name upload.local;

location / {
root /1/drop;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^/.* /index.php last;
break;
}

}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /1/upload$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}

}


Что ему не нравится?

--
Think before you print.
Best regards, Alexey Bobok.
Re: php-fpm падает при аплоаде больших файлов
December 26, 2010 08:56AM
Во первых у вас скорее всего Php скрипт убился по таймауту, а во вторых
закачивать файлы в связке php + nginx можно более легковесным способом(не
занимая драгоценный процесс php) смотрите модуль nginx-upload-module и иже с
ним



20 декабря 2010 г. 21:02 пользователь Алексей Бобок
<alexey.bobok@gmail.com>написал:

> bsd7.1, nginx/0.8.53, PHP 5.3.3 (fpm-fcgi)
>
> при аплоаде больших файлов в момент окончания выгрузки файла на сервер,
> получаю следующее:
>
> nginx-error.log:
> 2010/12/20 19:25:57 [error] 62584#0: *5505 upstream sent unexpected FastCGI
> record: 3 while reading response header from upstream, client:
> 1291.68.12.97, server: upload.local, request: "POST
> /upload.php?file=T-Rex-Children.Of.The.Revolution.CD1.rar HTTP/1.1",
> upstream: "fastcgi://127.0.0.1:9000", host: "upload.local", referrer: "
> http://upload.local/"
>
> php-fpm.log:
> Dec 20 19:25:57.319526 [DEBUG] pid 18442, fpm_got_signal(), line 48:
> received SIGCHLD
> Dec 20 19:25:57.319779 [WARNING] pid 18442, fpm_children_bury(), line 249:
> [pool www] child 18448 exited with code 255 after 448.143709 seconds from
> start
>
> в php.ini:
>
> max_execution_time = 1800
> max_input_time = 1800
> post_max_size = 10G
> upload_max_filesize = 10G
> memory_limit = 1024M
>
> в nginx.conf:
> http {
> include mime.types;
> default_type application/octet-stream;
> client_max_body_size 10G;
> proxy_buffering on;
> proxy_connect_timeout 75;
> proxy_read_timeout 1800;
> proxy_send_timeout 1800;
> fastcgi_read_timeout 1800;
> fastcgi_send_timeout 1800;
> #access_log logs/access.log main;
> sendfile on;
> tcp_nopush on;
>
> #keepalive_timeout 0;
> keepalive_timeout 65;
>
> gzip on;
> gzip_buffers 4 4k;
> gzip_proxied any;
> gzip_comp_level 5;
>
> server {
> listen 192.168.12.133:80 accept_filter=httpready default;
> server_name upload.local;
>
> location / {
> root /1/drop;
> index index.php index.html index.htm;
> if (!-e $request_filename) {
> rewrite ^/.* /index.php last;
> break;
> }
>
> }
>
> location ~ \.php$ {
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME /1/upload$fastcgi_script_name;
> include fastcgi_params;
> }
>
> location ~ /\.ht {
> deny all;
> }
>
> }
>
>
> Что ему не нравится?
>
> --
> Think before you print.
> Best regards, Alexey Bobok.
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 95
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready