comparison xml/en/docs/http/ngx_http_core_module.xml @ 1430:0eb8e261f349

AIO: clarified the use of both AIO and sendfile on Linux. While here, commented out a note about using AIO module on older versions of FreeBSD.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 05 Mar 2015 18:56:18 +0300
parents 5addfab7e171
children 9012d7935c9b
comparison
equal deleted inserted replaced
1429:06322891b4e3 1430:0eb8e261f349
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="36"> 13 rev="37">
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>
40 <example> 40 <example>
41 kldload aio 41 kldload aio
42 </example> 42 </example>
43 </para> 43 </para>
44 44
45 <!--
45 <para> 46 <para>
46 In FreeBSD versions 5 and 6, enabling AIO statically, or dynamically 47 In FreeBSD versions 5 and 6, enabling AIO statically, or dynamically
47 when booting the kernel, will cause the entire networking subsystem 48 when booting the kernel, will cause the entire networking subsystem
48 to use the Giant lock, which can impact overall performance negatively. 49 to use the Giant lock, which can impact overall performance negatively.
49 This limitation has been removed in FreeBSD&nbsp;6.4-STABLE in 2009, and in 50 This limitation has been removed in FreeBSD&nbsp;6.4-STABLE in 2009, and in
67 <c-func>aio_write</c-func> 68 <c-func>aio_write</c-func>
68 when working with sockets. 69 when working with sockets.
69 However, since nginx uses AIO only for disk I/O, no problems should arise. 70 However, since nginx uses AIO only for disk I/O, no problems should arise.
70 </note> 71 </note>
71 </para> 72 </para>
72 73 -->
73 <para> 74
74 For AIO to work, 75 <para>
76 For AIO to work on FreeBSD,
75 <link id="sendfile"/> 77 <link id="sendfile"/>
76 needs to be disabled: 78 needs to be disabled:
77 <example> 79 <example>
78 location /video/ { 80 location /video/ {
81 aio on;
79 sendfile off; 82 sendfile off;
80 aio on;
81 output_buffers 1 64k; 83 output_buffers 1 64k;
82 } 84 }
83 </example> 85 </example>
84 </para> 86 </para>
85 87
124 boundaries (or 4K for XFS). 126 boundaries (or 4K for XFS).
125 File’s unaligned end is read in blocking mode. 127 File’s unaligned end is read in blocking mode.
126 The same holds true for byte range requests and for FLV requests 128 The same holds true for byte range requests and for FLV requests
127 not from the beginning of a file: reading of unaligned data at the 129 not from the beginning of a file: reading of unaligned data at the
128 beginning and end of a file will be blocking. 130 beginning and end of a file will be blocking.
129 There is no need to turn off 131 </para>
130 <link id="sendfile"/> 132
131 explicitly, as it is turned off automatically when 133 <para>
132 <link id="directio"/> 134 When both AIO and <link id="sendfile"/> are enabled on Linux,
133 is used. 135 AIO is used for files that are larger than or equal to
136 the size specified in the <link id="directio"/> directive,
137 while <link id="sendfile"/> is used for files of smaller sizes
138 or when <link id="directio"/> is disabled.
139 <example>
140 location /video/ {
141 sendfile on;
142 aio on;
143 directio 8m;
144 }
145 </example>
134 </para> 146 </para>
135 147
136 </directive> 148 </directive>
137 149
138 150