L
L
lehubozedo2017-11-05 15:45:37
Nginx
lehubozedo, 2017-11-05 15:45:37

How to upload large files through nginx?

There are vds with 512MB of memory and 10GB on disk (7GB free).
Upload file to server via nginx and gunicorn, parameters:

client_body_in_file_only clean;
client_body_temp_path /home/www/sites/media/tmp/;
client_max_body_size 500000m;

a maximum of 309mb is loaded, while if you look in htop then:
"cache is the kernel memory in RAM used to store the contents of files read from disk."

during this time, it is completely filled, in theory, the client_body_in_file_only directive should force nginx to write the incoming buffer to the file, but despite the fact that the file appears and is written in /home/www/sites/media/tmp/ - the cache still overflows.
I give up, I do not know where to dig.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Skobkin, 2017-11-05
@skobkin

Nginx has an upload module specifically designed to not burden your backend with file uploads.

E
Evgeny Vorobyov, 2017-11-11
@lokki00003

If you have nginx with apache, then you should probably look at the directives for the maximum upload in the apache config

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question