Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenResty-1.15.8+nginx-upsync-module-2.1.3版本CPU高 #301

Open
lizj3624 opened this issue Feb 17, 2022 · 0 comments
Open

OpenResty-1.15.8+nginx-upsync-module-2.1.3版本CPU高 #301

lizj3624 opened this issue Feb 17, 2022 · 0 comments

Comments

@lizj3624
Copy link

lizj3624 commented Feb 17, 2022

  1. 环境
    OpenResty-1.15.8+nginx-upsync-module-2.1.3

  2. 配置比较多
    upstream有6500个,upstream中的server有4.5w个

  3. 相应的upsync配置

upstream my-ups {
    server 127.0.0.1:11111;

    upsync 127.0.0.1:2379/v2/keys/upstreams/my-ups/ upsync_timeout=6m upsync_interval=30s upsync_type=etcd strong_dependency=off;
    upsync_dump_path /nginx/conf/backend/http-my-ups.conf;
    include /nginx/conf/backend/http-my-ups.conf;

    #check interval=5000 rise=1 fall=2 timeout=1000 type=tcp default_down=false;
}
  1. 启动后每个worker的CPU使用率到90%,但是这时候没有任何请求量
    ME1645073858774
    ME1645073852801

perf查看一下,inet_hash_connect比较高,感觉有大量的tcp连接,把端口占满了

ss -s

Total: 142109 (kernel 142711)
TCP:   142363 (estab 99721, closed 5000, orphaned 58, synrecv 0, timewait 375/0), ports 64512

Transport Total     IP        IPv6
*	  142711    -         -
RAW	  0         0         0
UDP	  8         7         1
TCP	  137363    137359    4
INET	  137371    137366    5
FRAG	  0         0         0

感觉大量upstream时,这个模块有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant