Welcome! Log In Create A New Profile

Advanced

Re: Best possible configuration for file upload

Yichun Zhang (agentzh)
February 28, 2014 11:10PM
Hello!

On Wed, Feb 26, 2014 at 2:41 AM, snarapureddy wrote:
> We are using nginx for file uploads instead of directing to the backend
> servrs. Used lua openresty module to get the data in chunks in write it to
> local disk. File size could vary from few KB's to 10MB.
>

Ensure you're interleaving disk writes and network reads. The
recommended way is to read a chunk from the network and write it
immediately to the file system and again and again.

> We are tuning worker process, connections, accept_mutex off etc, but if we
> cuncerrently upload files some of the connections were very slow.
>
> Chuck size is 4096.

You can try a bit larger chunk sizes like 16KB or 32KB.

> CPU utilization is very minimal. We are running 10
> worker processes, but most of the cases sam process is handling multiple
> connections and they are becoming slow.

This sounds like a good analysis candidate for the off-CPU flame graph tool:

https://github.com/agentzh/nginx-systemtap-toolkit#sample-bt-off-cpu

This can help us identify exactly what the bottleneck is in your nginx.

Also, measuring the epoll loop blocking latency distribution could be
insightful too:

https://github.com/agentzh/stapxx#epoll-loop-blocking-distr

Try running more nginx worker processes if file IO syscalls are
blocking your workers too much.

BTW, you may get more and faster responses if you post such questions
on the openresty-en mailing list:
https://groups.google.com/group/openresty-en

Best regards,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Best possible configuration for file upload

snarapureddy February 26, 2014 05:41AM

Re: Best possible configuration for file upload

Yichun Zhang (agentzh) February 28, 2014 11:10PM

Re: Best possible configuration for file upload

snarapureddy March 03, 2014 06:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 198
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready