Problem with large static files

Maxim Dounin mdounin at mdounin.ru
Mon Dec 19 20:45:49 UTC 2011


Hello!

On Mon, Dec 19, 2011 at 01:22:15PM -0500, etrader wrote:

> I have a strange problem with slow load of relatively large files. On a
> domain without proxy (designed for serving static files), the request
> time (as monitored by access log $request_time) for an simple jpg image
> file of 5KB  is 0.000s (seems to be shorter than 1ms). Thus, one expect
> to load an image file of 15KB within 3ms, but surprisingly it takes
> about 600ms. A static file of 15KB is not big at all; but there should
> be a threshold which leads to this slow down upon slightly increasing
> the file size.

The $request_time of 0.000s isn't something real.  Instead, it 
means that nginx wasn't going through event loop while processing 
the request. It was able to read the request from client, read 
data from disk and send all data to socket buffer without 
overflowing it.  As nginx only updates it's idea about current 
time once per event loop iteration, the above results in 
$request_time of 0.000s in logs.  Real time spent may 
significantly differ if you are disk-bound and reading from disk 
blocks for a long time (and you aren't using AIO).

Try looking into your disk subsystem stats, most likely it will 
explain things.

Maxim Dounin



More information about the nginx mailing list