comparison xml/en/docs/http/ngx_http_core_module.xml @ 1432:9012d7935c9b

Documented that "aio sendfile" is deprecated. This also made it possible to move the description of sendfile() pre-loading from "aio" to "sendfile".
author Ruslan Ermilov <ru@nginx.com>
date Tue, 17 Mar 2015 09:18:35 +0300
parents 0eb8e261f349
children 2333e08e277d
comparison
equal deleted inserted replaced
1431:c4ca69d3e552 1432:9012d7935c9b
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9 9
10 <module name="Module ngx_http_core_module" 10 <module name="Module ngx_http_core_module"
11 link="/en/docs/http/ngx_http_core_module.html" 11 link="/en/docs/http/ngx_http_core_module.html"
12 lang="en" 12 lang="en"
13 rev="37"> 13 rev="38">
14 14
15 <section id="directives" name="Directives"> 15 <section id="directives" name="Directives">
16 16
17 <directive name="aio"> 17 <directive name="aio">
18 <syntax> 18 <syntax>
19 <literal>on</literal> | 19 <literal>on</literal> |
20 <literal>off</literal> | 20 <literal>off</literal></syntax>
21 <literal>sendfile</literal></syntax>
22 <default>off</default> 21 <default>off</default>
23 <context>http</context> 22 <context>http</context>
24 <context>server</context> 23 <context>server</context>
25 <context>location</context> 24 <context>location</context>
26 <appeared-in>0.8.11</appeared-in> 25 <appeared-in>0.8.11</appeared-in>
27 26
28 <para> 27 <para>
29 Enables or disables the use of asynchronous file I/O (AIO) 28 Enables or disables the use of asynchronous file I/O (AIO)
30 on FreeBSD and Linux. 29 on FreeBSD and Linux:
30 <example>
31 location /video/ {
32 aio on;
33 output_buffers 1 64k;
34 }
35 </example>
31 </para> 36 </para>
32 37
33 <para> 38 <para>
34 On FreeBSD, AIO can be used starting from FreeBSD&nbsp;4.3. 39 On FreeBSD, AIO can be used starting from FreeBSD&nbsp;4.3.
35 AIO can either be linked statically into a kernel: 40 AIO can either be linked statically into a kernel:
71 </note> 76 </note>
72 </para> 77 </para>
73 --> 78 -->
74 79
75 <para> 80 <para>
76 For AIO to work on FreeBSD,
77 <link id="sendfile"/>
78 needs to be disabled:
79 <example>
80 location /video/ {
81 aio on;
82 sendfile off;
83 output_buffers 1 64k;
84 }
85 </example>
86 </para>
87
88 <para>
89 In addition, starting from FreeBSD&nbsp;5.2.1 and nginx&nbsp;0.8.12, AIO can
90 also be used to pre-load data for <c-func>sendfile</c-func>:
91 <example>
92 location /video/ {
93 sendfile on;
94 tcp_nopush on;
95 aio sendfile;
96 }
97 </example>
98 In this configuration, <c-func>sendfile</c-func> is called with
99 the <c-def>SF_NODISKIO</c-def> flag which causes it not to block on disk I/O,
100 but, instead, report back that the data are not in memory.
101 nginx then initiates an asynchronous data load by reading one byte.
102 On the first read, the FreeBSD kernel loads the first 128K bytes
103 of a file into memory, although next reads will only load data in 16K chunks.
104 This can be changed using the
105 <link id="read_ahead"/> directive.
106 </para>
107
108 <para>
109 On Linux, AIO can be used starting from kernel version 2.6.22. 81 On Linux, AIO can be used starting from kernel version 2.6.22.
110 Also, it is necessary to enable 82 Also, it is necessary to enable
111 <link id="directio"/>, 83 <link id="directio"/>,
112 or otherwise reading will be blocking: 84 or otherwise reading will be blocking:
113 <example> 85 <example>
141 sendfile on; 113 sendfile on;
142 aio on; 114 aio on;
143 directio 8m; 115 directio 8m;
144 } 116 }
145 </example> 117 </example>
118 </para>
119
120 <para>
121 See also the <link id="sendfile"/> directive.
146 </para> 122 </para>
147 123
148 </directive> 124 </directive>
149 125
150 126
2202 <para> 2178 <para>
2203 Enables or disables the use of 2179 Enables or disables the use of
2204 <c-func>sendfile</c-func>. 2180 <c-func>sendfile</c-func>.
2205 </para> 2181 </para>
2206 2182
2183 <para>
2184 Starting from nginx&nbsp;0.8.12 and FreeBSD&nbsp;5.2.1,
2185 <link id="aio"/> can be used to pre-load data
2186 for <c-func>sendfile</c-func>:
2187 <example>
2188 location /video/ {
2189 sendfile on;
2190 tcp_nopush on;
2191 aio on;
2192 }
2193 </example>
2194 In this configuration, <c-func>sendfile</c-func> is called with
2195 the <c-def>SF_NODISKIO</c-def> flag which causes it not to block on disk I/O,
2196 but, instead, report back that the data are not in memory.
2197 nginx then initiates an asynchronous data load by reading one byte.
2198 On the first read, the FreeBSD kernel loads the first 128K bytes
2199 of a file into memory, although next reads will only load data in 16K chunks.
2200 This can be changed using the
2201 <link id="read_ahead"/> directive.
2202 <note>
2203 Before version 1.7.11, pre-loading could be enabled with
2204 <literal>aio sendfile;</literal>.
2205 </note>
2206 </para>
2207
2207 </directive> 2208 </directive>
2208 2209
2209 2210
2210 <directive name="sendfile_max_chunk"> 2211 <directive name="sendfile_max_chunk">
2211 2212