]> git.kaiwu.me - nginx.git/commitdiff
align hash bucket size to cache line
authorIgor Sysoev <igor@sysoev.ru>
Mon, 9 Oct 2006 14:03:16 +0000 (14:03 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 9 Oct 2006 14:03:16 +0000 (14:03 +0000)
src/http/modules/ngx_http_fastcgi_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/ngx_http.c
src/http/ngx_http_upstream.c

index e4b7ba431b49cb08db0bff4dda19f52110257aee..cce31010cbe822f857b862bc190d4ec389519eb9 100644 (file)
@@ -1826,7 +1826,7 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     hash.hash = &conf->upstream.hide_headers_hash;
     hash.key = ngx_hash_key_lc;
     hash.max_size = 512;
-    hash.bucket_size = 64;
+    hash.bucket_size = ngx_align(64, ngx_cacheline_size);
     hash.name = "fastcgi_hide_headers_hash";
     hash.pool = cf->pool;
     hash.temp_pool = NULL;
index 0e6bb1d6f424611aa9f04f4ebbc9df8fb9e3136f..f85454968b9e429952a9ab6c49f25887b26bf5a3 100644 (file)
@@ -1823,7 +1823,7 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     hash.hash = &conf->upstream.hide_headers_hash;
     hash.key = ngx_hash_key_lc;
     hash.max_size = 512;
-    hash.bucket_size = 64;
+    hash.bucket_size = ngx_align(64, ngx_cacheline_size);
     hash.name = "proxy_hide_headers_hash";
     hash.pool = cf->pool;
     hash.temp_pool = NULL;
index 1c930ed2e941ac76dd2c142037e17cc741fa76a2..7a1eb89b32535a75758843f01fe606b09812bb53 100644 (file)
@@ -365,7 +365,7 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     hash.hash = &cmcf->headers_in_hash;
     hash.key = ngx_hash_key_lc;
     hash.max_size = 512;
-    hash.bucket_size = 64;
+    hash.bucket_size = ngx_align(64, ngx_cacheline_size);
     hash.name = "headers_in_hash";
     hash.pool = cf->pool;
     hash.temp_pool = NULL;
index 7d259d098f805d7bac928d2f6e7185e8f5aadccd..ebc30be3ecdfd0b339bc4baaf63f1a2465a900a1 100644 (file)
@@ -2941,7 +2941,7 @@ ngx_http_upstream_init_main_conf(ngx_conf_t *cf, void *conf)
     hash.hash = &umcf->headers_in_hash;
     hash.key = ngx_hash_key_lc;
     hash.max_size = 512;
-    hash.bucket_size = 64;
+    hash.bucket_size = ngx_align(64, ngx_cacheline_size);
     hash.name = "upstream_headers_in_hash";
     hash.pool = cf->pool;
     hash.temp_pool = NULL;