Skip to content

Commit ee82e01

Browse files
committedJun 27, 2014
docker: Explicitly set nginx types_hash_bucket_size
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).
1 parent 74a3376 commit ee82e01

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎contrib/docker/nginx.conf

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ http {
2222
gzip on;
2323
gzip_disable "msie6";
2424

25+
# Unless these are set explicitly, the types_hash_bucket_size is set at
26+
# runtime depending on the processor's cache line size, which can (and does)
27+
# cause inconsistent behaviour on different hardware. Our
28+
# /etc/nginx/mime.types requires at least a 32 bit bucket, but we set these to
29+
# the latest nginx default values to be on the safe size.
30+
types_hash_bucket_size 64;
31+
types_hash_max_size 1024;
32+
2533
proxy_cache_path /var/cache/nginx/proxycache levels=1:2 keys_zone=cache:30m max_size=250m;
2634
proxy_temp_path /var/cache/nginx/proxytemp 1 2;
2735

0 commit comments

Comments
 (0)
Please sign in to comment.