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

[Feature Request] 优化 pinger 查询对 ovnsb 造成的压力问题 #4073

Closed
fanriming opened this issue May 23, 2024 · 0 comments · Fixed by #4075
Closed

[Feature Request] 优化 pinger 查询对 ovnsb 造成的压力问题 #4073

fanriming opened this issue May 23, 2024 · 0 comments · Fixed by #4075
Labels
performance Anything that can make Kube-OVN faster

Comments

@fanriming
Copy link
Member

Description

pinger 默认每5秒调用一次 ovn-sbctl 查询,当集群规模越来越大,对 ovn-sb-leader 的造成非常大的压力。以下对比 ovn-sbctl 命令和 ovsdb-client 命令的在大量请求情况下 ovn-sb-leader 的压力:
test-ovn-sbctl.sh

#!/bin/bash

while true; do
  ovn-sbctl --db=tcp:$OVN_SB_SERVICE_HOST:6642 --format=csv --no-heading --data=bare --columns=_uuid --timeout=10 find chassis hostname=192.168.212.16 > /dev/null &

  ovn-sbctl --db=tcp:$OVN_SB_SERVICE_HOST:6642 --format=csv --no-heading --data=bare --columns=logical_port --timeout=10 find port_binding chassis=22f903d0-35a2-4f7c-ad6f-1bc66c4c08c8 > /dev/null&

  sleep 0.05
done

脚本模拟 100 个节点的 pinger 请求,当我并发启动5个 test-ovn-sbctl.sh 脚本时(等价于模拟500个节点),cpu 已经占用到 60% 以上,在负载较大的k8s表现会更糟糕。
image

当修改使用ovsdb-client时,这种情况得到明显改善。
test-ovsdb-client.sh

#!/bin/bash

while true; do
  ovsdb-client --timeout=10 query tcp:$OVN_SB_SERVICE_HOST:6642 '["OVN_Southbound", {"op": "select","table": "Chassis","where": [["hostname", "==", "192.168.212.16"]],"columns": ["_uuid"]}]' > /dev/null &

  ovsdb-client --timeout=10 query tcp:$OVN_SB_SERVICE_HOST:6642 '["OVN_Southbound",{"op": "select","table": "Port_Binding","where": [["chassis", "==", ["uuid","22f903d0-35a2-4f7c-ad6f-1bc66c4c08c8"]]],"columns": ["logical_port"]}]' > /dev/null&

  sleep 0.05
done

同样的,我们并发启用5个test-ovsdb-client.sh脚本,cpu 没有压力的表现
image

Who will benefit from this feature?

改善大规模集群下ovnsb-leader的压力问题

Anything else?

No response

@fanriming fanriming added the feature New network feature label May 23, 2024
@zhangzujian zhangzujian added performance Anything that can make Kube-OVN faster and removed feature New network feature labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Anything that can make Kube-OVN faster
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants