diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:19 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:45 +0100 |
commit | 2a463b3cd73c32ee9dcd508248d0194923f435f4 (patch) | |
tree | 2ff478255a77a55031056790918b6f983bb7b20a /docs/manual/misc/perf-tuning.html.en | |
parent | 86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45 (diff) | |
download | apache2-upstream/2.4.9.tar.gz |
Imported Upstream version 2.4.9upstream/2.4.9
Diffstat (limited to 'docs/manual/misc/perf-tuning.html.en')
-rw-r--r-- | docs/manual/misc/perf-tuning.html.en | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/docs/manual/misc/perf-tuning.html.en b/docs/manual/misc/perf-tuning.html.en index 24c4b1e1..52cb5b6a 100644 --- a/docs/manual/misc/perf-tuning.html.en +++ b/docs/manual/misc/perf-tuning.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -137,12 +137,10 @@ matching the criteria. Here's an example which disables lookups except for <code>.html</code> and <code>.cgi</code> files:</p> - <pre class="prettyprint lang-config"> -HostnameLookups off + <pre class="prettyprint lang-config">HostnameLookups off <Files ~ "\.(html|cgi)$"> HostnameLookups on -</Files> - </pre> +</Files></pre> <p>But even still, if you just need DNS names in some CGIs you @@ -161,12 +159,10 @@ HostnameLookups off system calls to check up on symlinks. One extra call per filename component. For example, if you had:</p> - <pre class="prettyprint lang-config"> -DocumentRoot /www/htdocs + <pre class="prettyprint lang-config">DocumentRoot /www/htdocs <Directory /> Options SymLinksIfOwnerMatch -</Directory> - </pre> +</Directory></pre> <p>and a request is made for the URI <code>/index.html</code>. @@ -177,16 +173,14 @@ DocumentRoot /www/htdocs every single request. If you really desire the symlinks security checking you can do something like this:</p> - <pre class="prettyprint lang-config"> -DocumentRoot /www/htdocs + <pre class="prettyprint lang-config">DocumentRoot /www/htdocs <Directory /> Options FollowSymLinks </Directory> <Directory /www/htdocs> Options -FollowSymLinks +SymLinksIfOwnerMatch -</Directory> - </pre> +</Directory></pre> <p>This at least avoids the extra checks for the @@ -209,12 +203,10 @@ DocumentRoot /www/htdocs <code>.htaccess</code> for each filename component. For example,</p> - <pre class="prettyprint lang-config"> -DocumentRoot /www/htdocs + <pre class="prettyprint lang-config">DocumentRoot /www/htdocs <Directory /> AllowOverride all -</Directory> - </pre> +</Directory></pre> <p>and a request is made for the URI <code>/index.html</code>. @@ -557,8 +549,7 @@ DocumentRoot /www/htdocs do not match the code, they're contrived for pedagogical purposes):</p> - <pre class="prettyprint lang-c"> - for (;;) { + <pre class="prettyprint lang-c"> for (;;) { for (;;) { fd_set accept_fds; @@ -578,8 +569,7 @@ DocumentRoot /www/htdocs if (new_connection != -1) break; } process_the(new_connection); - } - </pre> + }</pre> <p>But this naive implementation has a serious starvation problem. @@ -618,8 +608,7 @@ DocumentRoot /www/htdocs entry into the inner loop. The loop looks like this (differences highlighted):</p> - <pre class="prettyprint lang-c"> - for (;;) { + <pre class="prettyprint lang-c"> for (;;) { <strong>accept_mutex_on ();</strong> for (;;) { fd_set accept_fds; @@ -641,8 +630,7 @@ DocumentRoot /www/htdocs } <strong>accept_mutex_off ();</strong> process the new_connection; - } - </pre> + }</pre> <p><a id="serialize" name="serialize">The functions</a> @@ -751,8 +739,7 @@ DocumentRoot /www/htdocs <code>http_main.c</code>). The function looks roughly like this:</p> - <pre class="prettyprint lang-c"> - void lingering_close (int s) + <pre class="prettyprint lang-c"> void lingering_close (int s) { char junk_buffer[2048]; @@ -774,8 +761,7 @@ DocumentRoot /www/htdocs } close (s); - } - </pre> + }</pre> <p>This naturally adds some expense at the end of a connection, @@ -989,7 +975,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/misc/perf-tuning.htm } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); |