前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nginx做负载均衡报:nginx: [emerg] could not build the types_hash

Nginx做负载均衡报:nginx: [emerg] could not build the types_hash

作者头像
星哥玩云
发布2022-06-13 08:15:46
3430
发布2022-06-13 08:15:46
举报
文章被收录于专栏:开源部署

环境:KVM/CentOS6.3

Nginx做负载均衡的时候在配置完成后,启动Nginx的时候报: 1 nginx: [emerg] could not build the types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 32

解决方法:在nginx配置文件http模块添加:types_hash_max_size 2048;

1234567 http{     include      mime.types;     default_type application/octet-stream;     types_hash_max_size 2048;     server_names_hash_bucket_size 128;     client_header_buffer_size 32k;     large_client_header_buffers 4 32k;

错误原因真心不知道,只能Google了,方法找到了,错误原因也找到了,但真心不明白什么意思。

#################################################

I found out nginx is reporting the wrong cache line size on a virtual system.

On startup it reports:

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

This is caused by /etc/nginx/mime.types having a key which is 36 bytes long:

echo -n application/vnd.google-earth.kml+xml |wc -c 36

In src/core/ngx_cpuinfo.c , the ngx_cpuinfo() reports my CPU has having a 32 bytes cache line which is then used as the default value for types_hash_bucket_size and thus trigger the startup error.

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
负载均衡
负载均衡(Cloud Load Balancer,CLB)提供安全快捷的流量分发服务,访问流量经由 CLB 可以自动分配到云中的多台后端服务器上,扩展系统的服务能力并消除单点故障。负载均衡支持亿级连接和千万级并发,可轻松应对大流量访问,满足业务需求。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档