Windows Nginx Network Sharing (Mapped Hard Drive) Issue

Maxim Dounin mdounin at
Mon Jan 18 14:14:46 UTC 2016


On Mon, Jan 18, 2016 at 08:54:42AM -0500, c0nw0nk wrote:

> So i have two machines in different locations.
> Web server is C:/
> Storage Server is Z:/ (This one is the external mapped hard drive)
> Now when you upload files to nginx especialy large files in my tests 2GB.
> Nginx then pushes the file from the temp location to the Z drive, The issue
> with this is it locks up and stops serving traffic until it finishes pushing
> the file onto the storage server. So if i was to try and get Nginx to
> respond to any connection or request it will sit in the connecting state
> until the file has been pushed onto the external machine.

When nginx has to move a file from a temporary location to a 
permanent one, this operation will be costly when moving between 
filesystems.  Moreover, during this operation nginx worker will be 
blocked and won't be able to process any other events.

At least two places in the documentation explicitly warn about 
such setups, dav_methods and proxy_cache_path.  E.g., the 
dav_methods directive description say 

: A file uploaded with the PUT method is first written to a 
: temporary file, and then the file is renamed. Starting from 
: version 0.8.9, temporary files and the persistent store can be put 
: on different file systems. However, be aware that in this case a 
: file is copied across two file systems instead of the cheap 
: renaming operation. It is thus recommended that for any given 
: location both saved files and a directory holding temporary files, 
: set by the client_body_temp_path directive, are put on the same 
: file system.

Additionally, in your paricular setup you are using network 
filesystem to save files.  This is expected to cause even bigger 
problems than usual copy, as network filesystems usually have much 
higher latency than local disks.  Using network filesystems with 
nginx is generally not recommended.

That is, the problem you are seeing is expected with the 
configuration you have.  Reconsider the configuration you are 

Maxim Dounin

More information about the nginx mailing list