Skip to content

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

@lizj3624

Description

@lizj3624
  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时,这个模块有问题

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions