1 output_buffers<br><br>because static file used sendfile in nginx, and if you need modify file content, you need read file content to memory(example gzip filter), this memory size is output_buffers.<br><br>first arg is buf <span class="Apple-style-span" style="color: rgb(85, 85, 85); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Arial, Verdana, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(240, 240, 240); ">number</span>, second is buf size. if allocated memory greater than number*size, nginx will send buf and then continue read;<br>
<br>2 aio<br><br>yes.<br><br>3 sendfile<br><br>first, sendfile have limit(2g - 1) in nginx, if file size is <span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Microsoft YaHei'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: nowrap; widows: 2; word-spacing: 0px;"><span class="Apple-converted-space"> </span>greater than limit, nginx will send </span><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Microsoft YaHei'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: nowrap; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">partially everytime. </span>second, because fd is NONBLOCK, so server is not block.<br>
<br><div class="gmail_quote">On Tue, Sep 27, 2011 at 7:36 PM, Hagai Avrahami <span dir="ltr"><<a href="mailto:hagaia@qwilt.com">hagaia@qwilt.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Hi<br><br>I am intend to use NGINX (LINUX) for serving static files with high concurrency and bandwidth. <br>Some of the files is served from the disk and some from cache.<br>I am trying to find the configuration for best performance.<br>
<br>I have some questions regarding NGINX configuration.<br><br>1. <b>output_buffers 1 32k</b><br>----------------------------------------<br>This directive excepts 2 inputs<br>can someone explain me the meaning of each input<br>
I can see that 32K is size of data (per fetch) when reading from a DIsk - what else it influences?<br>When serving big files, best Disk utilization is in blocks of 1MB, is it OK to change this directive to 1024k?<br><br>
2. <b>aio</b><br>
----------------------------------------<br><b></b>I read in Wiki the following<br><b>" This directive is usable as of Linux kernel 2.6.22. For Linux it is
required to use directio, this automatically disables sendfile support."</b><br>when using AIO I must use <b>directio on</b>? (when testing I could see the file is served from the cache - which means it is not using O_DIRECT)<br>
<br><br>3. <b>sendfile<br></b>----------------------------------------<br>Is NGINX try to send a file using 1 sendfile call (count = file size)?<br>If so when trying to send file residing only on the Disk, the server is blocked till end of transmition?<br>
In this model serving multiple files some on the disk and some cached is inefficient?<br><br>Will be happy to get any answer or opinion<br><br>Thanks<br>Hagai<br><font color="#888888"><br><br><br><br><br>-- <br><div dir="ltr">
<p><font color="#000000"><b>Hagai Avrahami</b></font><br>
<font color="#000000">Qwilt | Work: <a href="tel:%2B972-72-2221644" value="+972722221644" target="_blank">+972-72-2221644</a>| Mobile: <a href="tel:%2B972-54-4895656" value="+972544895656" target="_blank">+972-54-4895656</a> | </font><a href="mailto:yoav@qwilt.com" rel="nofollow" target="_blank">hagaia@qwilt.com</a></p>
</div><br>
</font></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br><br clear="all"><br>-- <br>douban:<a href="http://www.douban.com/people/mustang/" target="_blank">www.douban.com/people/mustang/</a><br>
<br>blog: <a href="http://www.pagefault.info" target="_blank">www.pagefault.info</a><br><br>twitter: <a href="http://www.twitter.com/minibobo" target="_blank">www.twitter.com/minibobo</a><br><br>weibo: <a href="http://www.weibo.com/diaoliang" target="_blank">www.weibo.com/diaoliang</a><br>
<br>