[alibaba/tengine]dyups 更新upstream cpu 打满

2024-02-21 419 views
0
Ⅰ. Issue Description

当更新单个upstream 中的机器列表,超过2000个时,cpu瞬间会打被满

Ⅱ. Describe what happened

导致其他功能模块不可用

Ⅲ. Describe what you expected to happen Ⅳ. How to reproduce it (as minimally and precisely as possible)
  1. 更新upstream机器列表即可,机器列表数超过2000个
  2. 有解决的方法吗
Ⅴ. Anything else we need to know?
  1. If applicable, add nginx debug log doc.
Ⅵ. Environment:
  • Tengine version (use sbin/nginx -V):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Others:

回答

4

希望能降低cpu的使用

6

dyups_shm_zone_size 100M; 配置100M

3

这个问题是 暂时解决不了吗?打满cpu感觉不太合理,但是看代码就几个共享内存锁,然后每个进程再执行一遍,更新下自己的配置,tengine团队一起看下这个问题吧,大概是每个timer 一直 执行 ngx_http_dyups_read_msg_locked 这个函数导致cpu被打满,正常cpu应该不会被打满吧

2

1、可以确认下是不是使用的最新版的Tengine。 2、CPU 飙高后是持续的还是短暂的,如果是持续的话可以看看对应的进程堆栈,如果是短暂的话可以试试 dyups_trylock on; 详细参考文档说明: http://tengine.taobao.org/document_cn/http_dyups_cn.html。 3、针对现有的更新逻辑的确有一点是可以优化的:打散read_msg_handler的启动时间,这样可以避免多个worker同时更新(当然会这样会出现短暂的不一致性)。