Mastering Nginx

(Ron) #1
Chapter 2

[ 27 ]

Directive Explanation
open_file_cache_min_uses Configures the minimum number of uses
for a file within the inactive parameter to
open_file_cache for the file descriptor
to remain open in the cache.
open_file_cache_valid Specifies the time interval between validity
checks for items in open_file_cache.
postpone_output Specifies the minimum size of data for
NGINX to send to the client. If possible, no
data will be sent until this value is reached.
read_ahead If possible, the kernel will preread files
up to the size parameter. It's supported
on current FreeBSD and Linux (the size
parameter is ignored on Linux).
sendfile Enables using sendfile(2) to directly copy
the data from one file descriptor to another.
sendfile_max_chunk Sets the maximum size of data to copy
in one sendfile(2) call, to prevent a
worker from seizing.

Hash directives


The set of hash directives controls how large a range of static memory NGINX allocates


to certain variables. NGINX will calculate the minimum size needed on startup and
reconfiguration. You will most likely only need to adjust one of the *_hash_max_size


parameters by setting the appropriate directive when NGINX emits a warning to
that effect. The *_hash_bucket_size variables are set by default to a multiple of


the processor's cache line size to minimize lookups needed to retrieve the entry, and


therefore should not normally be changed. See http://nginx.org/en/docs/hash.
html for additional details.


Table: HTTP hash directives

Directive Explanation
server_names_hash_bucket_size It specifies the bucket size used to
hold the server_name hash tables.
server_names_hash_max_size It specifies the maximum size of the
server_name hash tables.
types_hash_bucket_size It specifies the bucket size used to
hold the types hash tables.
types_hash_max_size It specifies the maximum size of the
types hash tables.
Free download pdf