Nginx file upload: server slows down terribly during upload

Dave Cheney dave at cheney.net
Wed Mar 12 02:33:49 MSK 2008


My suspicion would be IO load.

Nginx buffers the upload to a file on disk before then transfering the  
upload in full to mongrel (so there is a big read load at that point).  
Mongrel then writes the file to disk (writes conflicting with reads),  
then rails unpacks the file into its mime components (look in your  
temp directory), so more read and write load.

What does iostat or vmstat say? What is your IO subsystem like ? what  
does hdparm say, etc, etc.

Cheers

Dave

On 12/03/2008, at 8:50 AM, Son Pan wrote:

> I am using 2 Nginx worker processes (1024 connections). Nginx proxies
> the requests to 4 mongrel instances. I have noticed that during file
> uploads (files are approx. 10 MB each), the server(machine) slows down
> quite a lot even though 'top' command does not show any spikes in  
> memory
> or CPU usage. Nginx is configured to send out static content. I  
> suspect
> this is a problem with my Nginx setup because during uploads, all  
> static
> content is served very slowly.
>
> I wonder if anyone can give me any ideas why this might be happening?
>
> Below are parts fron the nginx.conf I am using.
>
> worker_processes  4;
> events {
>    worker_connections  1024;
> }
>
> http {
>    include       /etc/nginx/mime.types;
>    default_type  application/octet-stream;
>
>    access_log    /var/log/nginx/access.log;
>    gzip on;
>    gzip_min_length  1100;
>    gzip_buffers     4 8k;
>    gzip_types       text/plain text/html text/css
> application/x-javascript text/xml app
> lication/xml application/xml+rss text/javascript;
>
>    sendfile       on;
>    tcp_nopush     on;
>
>    #keepalive_timeout  0;
>    keepalive_timeout  65;
>    tcp_nodelay        off;
>
> Thanks!
> -- 
> Posted via http://www.ruby-forum.com/.
>






More information about the nginx mailing list