annotate xml/en/docs/hash.xml @ 580:be54c443235a

Added copyright markers to documentation sources.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 10 Jul 2012 12:59:42 +0000
parents a1071d0d0979
children 764fbac1b8b4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
580
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 300
diff changeset
1 <!--
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 300
diff changeset
2 Copyright (C) Igor Sysoev
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 300
diff changeset
3 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 300
diff changeset
4 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 300
diff changeset
5
215
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
6 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd">
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
7
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
8 <article name="Setting Up Hashes"
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
9 link="/en/docs/hash.html"
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
10 lang="en">
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
11
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
12 <section>
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
13
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14 <para>
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15 To quickly process static sets of data such as server names,
300
a1071d0d0979 Slight markup and wording fixes.
Ruslan Ermilov <ru@nginx.com>
parents: 215
diff changeset
16 <link doc="http/ngx_http_map_module.xml" id="map"/> directive's values,
a1071d0d0979 Slight markup and wording fixes.
Ruslan Ermilov <ru@nginx.com>
parents: 215
diff changeset
17 MIME types, names of request header strings,
215
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
18 nginx uses hash tables.
300
a1071d0d0979 Slight markup and wording fixes.
Ruslan Ermilov <ru@nginx.com>
parents: 215
diff changeset
19 During the start and each re-configuration nginx selects the
a1071d0d0979 Slight markup and wording fixes.
Ruslan Ermilov <ru@nginx.com>
parents: 215
diff changeset
20 minimum possible sizes of hash tables such that the bucket size
215
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21 that stores keys with identical hash values does not exceed the
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22 configured parameter (hash bucket size).
300
a1071d0d0979 Slight markup and wording fixes.
Ruslan Ermilov <ru@nginx.com>
parents: 215
diff changeset
23 The size of a table is expressed in buckets.
215
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
24 The adjustment is continued until the table size exceeds the
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25 hash max size parameter.
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26 Most hashes have the corresponding directives that allow to change
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27 these parameters, for example, for the server names hash they are
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
28 <link doc="http/ngx_http_core_module.xml" id="server_names_hash_max_size"/>
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
29 and <link doc="http/ngx_http_core_module.xml" id="server_names_hash_bucket_size"/>.
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
30 </para>
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
32 <para>
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33 The hash bucket size parameter is aligned to the size that is a
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34 multiple of the processor's cache line size. This speeds up
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
35 key search in a hash on modern processors by reducing the number
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
36 of memory accesses.
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37 If hash bucket size is equal to one processor's cache line size
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38 then the number of memory accesses during the key search will be
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
39 two in the worst case&mdash;first to compute the bucket address,
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
40 and second during the key search inside the bucket.
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41 Therefore, if nginx emits the message requesting to increase
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
42 either hash max size or hash bucket size then the first parameter
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
43 should first be increased.
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
44 </para>
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
45
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
46 </section>
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
47
abb48e50ff7f Translated the "Setting Up Hashes" article into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
48 </article>