Skip to content

Commit

Permalink
docker: Explicitly set nginx types_hash_bucket_size
Browse files Browse the repository at this point in the history
As discovered by the inimitable bug-hunter @nigelbabu, on the version of
Nginx in the image, the value of types_hash_bucket_size is set at
runtime to the processor cache line size.

This means that on hardware with small cache lines (16 bytes) the image
can fail to start with:

    nginx: [emerg] could not build the types_hash, you should increase
    either types_hash_max_size: 1024 or types_hash_bucket_size: 32

This commit sets types_hash_bucket_size and types_hash_max_size to the
values used by latest Nginx (1.7.2 at the time of writing).
  • Loading branch information
nickstenning committed Jun 27, 2014
1 parent 74a3376 commit ee82e01
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contrib/docker/nginx.conf
Expand Up @@ -22,6 +22,14 @@ http {
gzip on;
gzip_disable "msie6";

# Unless these are set explicitly, the types_hash_bucket_size is set at
# runtime depending on the processor's cache line size, which can (and does)
# cause inconsistent behaviour on different hardware. Our
# /etc/nginx/mime.types requires at least a 32 bit bucket, but we set these to
# the latest nginx default values to be on the safe size.
types_hash_bucket_size 64;
types_hash_max_size 1024;

proxy_cache_path /var/cache/nginx/proxycache levels=1:2 keys_zone=cache:30m max_size=250m;
proxy_temp_path /var/cache/nginx/proxytemp 1 2;

Expand Down

0 comments on commit ee82e01

Please sign in to comment.