Welcome! Log In Create A New Profile

Advanced

Client body upload fully occupies worker

May 25, 2018 09:58AM
Hi,

While client uploads content into permanent temp file ngx worker doesn't process any requests until its finished.

Its an issue in case of large files (GBs) uploading since number of parallel uploads are limited by number of workers.

https://www.nginx.com/blog/thread-pools-boost-performance-9x/ advises to use aio_write:
"At the moment, offloading to thread pools is implemented only for three essential operations: the read() syscall on most operating systems, sendfile() on Linux, and aio_write() on Linux which is used when writing some temporary files such as those for the cache".

I tried to configure aio_write, but looks that approach won't work for client body upload.

1. How to configure thread pool usage for client body upload?
2. Could you please suggest any other approaches for non-blocking client body upload?

Thanks.

location /upload {
client_body_in_file_only on;
client_max_body_size 10g;

proxy_pass_request_body off;
proxy_redirect off;

proxy_set_header Content-Length 0;
proxy_http_version 1.1;
proxy_pass http://upstream$request_uri;
}
Subject Author Posted

Client body upload fully occupies worker

python May 25, 2018 09:58AM

Re: Client body upload fully occupies worker

Maxim Dounin May 28, 2018 10:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
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