directio sendfile aio

Anoop Alias anoopalias01 at
Fri Jan 22 11:55:42 UTC 2016

My use case is mixed mass hosting environment where some vhost may be
serving large files and some may be serving small files and where adding
something like location /video with directio enabled is not practical as I
being the webhost may not be knowing if the vhost user is serving a video
etc .

In such cases you recommend using something like

sendfile on;
sendfile_max_chunk 512k;
aio threads=default;
directio 100m;

in the http context . The logic being

file served of size 100m or less use sendfile and anything larger than 100m
( in which case it may have a high chance of being a multimedia file) is
served via directio .

Part of these setting are derived from what I understood is good from

*Anoop P Alias*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list