EMQX版本:4.4.18
安装方式:zip
集群节点数量:4
服务器数量:4
配置:单机单节点连接可达6w
服务器端参数优化情况:四台均按照文档内容linux系统参数调优
压测命令:
mqttx bench pub -h '192.168.7.133' -p 8884 -u 'test' -P '123456' -c 70000 -im 10000 -t mqttx/bench/t -m "mqttx bench test" -I "test-sc1%"
问题:
nginx负载均衡,4台服务器4个节点,用上述命令进行压测,仅能达到6.4w连接,麻烦请问一下这是为什么会导致连接数刚好达到6.4w就是端口的范围,但是因为按照了官方文档中的linux系统调优4台均进行了内核参数的修改,还是只能达到这个数量。麻烦看一下是否我配置的问题
Nginx配置为:
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 104836;
}
stream {
# 轮询负载均衡配置
upstream emqx_cluster {
zone tcp_servers 64k;
server 192.168.30.201:1883 weight=1 max_fails=2 fail_timeout=30s;
server 192.168.30.202:1883 weight=1 max_fails=2 fail_timeout=30s;
server 192.168.30.203:1883 weight=3 max_fails=2 fail_timeout=30s;
server 192.168.7.133:1883 weight=10 max_fails=2 fail_timeout=30s;
}
server {
# 监听 8884 端口
listen 8884;
# 反向代理到 emqx_cluster
proxy_pass emqx_cluster;
proxy_buffer_size 3M;
tcp_nodelay on;
#ssl_handshake_timeout 15s;
# 证书配置
#ssl_certificate /etc/nginx/cert/nginx.pem;
#ssl_certificate_key /etc/nginx/cert/nginx.key;
}
}
日志info&debug:
日志.zip (1.0 MB)