nginx配置出错 could not build the server_names_hash, you should increase either server_names_hash_max_si
2011-08-26 11:49
585 查看
错误信息
could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
解决办法
在/usr/local/nginx/conf/nginx.conf中http{}加入这样一句话
server_names_hash_max_size 512;
使用 sudo /usr/local/nginx/sbin/nginx -t对nginx配置文件进行检查,如果还提示
could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
则再把 server_names_hash_max_size升值
server_names_hash_max_size 1024;
错误原因
保存服务器名字的hash表是由指令 server_names_hash_max_size 和 server_names_hash_bucket_size所控制的。参数hash bucket size总是等于hash表的大小,并且是一路处理器缓存大小的倍数。在减少了在内存中的存取次数后,使在处理器中加速查找hash表键值成为可能。如果
hash bucket size等于一路处理器缓存的大小,那么在查找键的时候,最坏的情况下在内存中查找的次数为2。第一次是确定存储单元的地址,第二次是在存储单元中查找键值。因此,如果Nginx给出需要增大 hash max size 或 hash bucket size的提示,那么首要的是增大前一个参数的大小.
具体可参见官方文档:http://wiki.nginx.org/Optimizations
could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
解决办法
在/usr/local/nginx/conf/nginx.conf中http{}加入这样一句话
server_names_hash_max_size 512;
使用 sudo /usr/local/nginx/sbin/nginx -t对nginx配置文件进行检查,如果还提示
could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
则再把 server_names_hash_max_size升值
server_names_hash_max_size 1024;
错误原因
保存服务器名字的hash表是由指令 server_names_hash_max_size 和 server_names_hash_bucket_size所控制的。参数hash bucket size总是等于hash表的大小,并且是一路处理器缓存大小的倍数。在减少了在内存中的存取次数后,使在处理器中加速查找hash表键值成为可能。如果
hash bucket size等于一路处理器缓存的大小,那么在查找键的时候,最坏的情况下在内存中查找的次数为2。第一次是确定存储单元的地址,第二次是在存储单元中查找键值。因此,如果Nginx给出需要增大 hash max size 或 hash bucket size的提示,那么首要的是增大前一个参数的大小.
具体可参见官方文档:http://wiki.nginx.org/Optimizations
相关文章推荐
- nginx问题之nginx: could not build server_names_hash, you should increase server_names_hash_bucket_size解决方案
- Nginx: could not build the server_names_hash 解决办法
- Nginx出现could not build the server_names_hash 解决办法
- nginx “nginx could not build the server_names_hash”解决方法
- Nginx: could not build the server_names_hash 解决办法
- Nginx could not build the server_names_hash 错误的解决办法
- Nginx:nginx could not build the server_names_hash解决办法
- nginx could not build the server_names_hash 解决方法
- Nginx could not build the server_names_hash 错误的解决办法
- nginx报错”could not build the server_names_hash”
- nginx could not build the server_names_hash错误
- nginx报could not build theproxy_headers_hash错误,无法启动
- Nginx做负载均衡报:nginx: [emerg] could not build the types_hash
- 配置MySQL出错The service could not be started. Error:0 解决
- git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.
- 04-mac中的web环境搭建tomcat7不能进行配置Could not load the Tomcat server configuration
- git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct acces
- 异常之 Could not create the view: An unexpected exception was thrown.(server出错)
- the vsphere client could not connect to you do not have permission to login to the server
- mySql主从配置出错:The server is not configured as slave; fix in config file or with CHANGE MASTER TO