atom feed5 messages in ru.sysoev.nginxRe: Uploads with nginx 1.0.12
FromSent OnAttachments
Adrián NavarroFeb 29, 2012 11:58 am 
Cliff WellsFeb 29, 2012 12:35 pm 
Adrián NavarroFeb 29, 2012 12:48 pm 
Cliff WellsFeb 29, 2012 1:30 pm 
Valentin V. BartenevFeb 29, 2012 1:41 pm 
Subject:Re: Uploads with nginx 1.0.12
From:Adrián Navarro (adr@navarro.at)
Date:Feb 29, 2012 12:48:35 pm
List:ru.sysoev.nginx

Indeed, the high load is caused by php-fpm. I was wondering if there was any alternative config to keep fpm from spiking (like, any built-in helper to pass the final location without any plugin…).

I will look into the compiled module. I'm not very comfortable with compiling it on the cluster of servers which were previously using dotdeb, but it's better than nothing (uh, tips to keep the debian specific structure when compiling?).

Thanks for pointing me out!

-Adrian

---------- Forwarded message ---------- From: Cliff Wells <cli@develix.com> Date: Wed, Feb 29, 2012 at 9:35 PM Subject: Re: Uploads with nginx 1.0.12 To: ngi@nginx.org

On Wed, 2012-02-29 at 20:59 +0100, Adrián Navarro wrote:

Hello,

I am using file uploads with nginx 1.0.12, php5-fpm and php 5.3.10.

Currently, big file uploads (~1300 MB) do take about 30 seconds to process after the file is being uploaded, and the CPU load spikes. Is there a way to prevent that?

I assume that since the spike occurs *after* the upload, the culprit is PHP, not Nginx?

I am using a very simple script (just a var_dump($_FILES), nothing more,

Assuming the spike is caused by PHP, you might take a look at the nginx_upload module, which will handle the entire upload process for you, and just hand your PHP script a path to the uploaded file (along with a few other parameters).

Here's some references:

http://blog.martinfjordvald.com/2010/08/file-uploading-with-php-and-nginx/

http://brainspl.at/articles/2008/07/20/nginx-upload-module

https://github.com/vkholodkov/nginx-upload-module/tree/2.2

Regards, Cliff