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

2.5.0版本出现socket句柄泄露问题 #257

Open
takenliu opened this issue Dec 11, 2023 · 1 comment
Open

2.5.0版本出现socket句柄泄露问题 #257

takenliu opened this issue Dec 11, 2023 · 1 comment

Comments

@takenliu
Copy link
Collaborator

takenliu commented Dec 11, 2023

Description

现象:
1.进程持有较多的socket句柄没有释放,通过下面的命令统计,结果为几个到几万个不等。
$ lsof -p $pid -K|grep "protocol: TCP"|wc -l
2.即使业务请求量很低的时候,可能消耗cpu单个核的100%。
top命令:%CPU 100.0
同时通过perf命令查看,主要消耗在于NetworkAsio::timeoutProcess()函数。

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Operating System and version:
  • Machine Specifications:
  • Tendis Version:
  • Tendis Configuration:
  • IO/Network used:
  • Link to your project:
@takenliu
Copy link
Collaborator Author

结论:
2.5.0版本有出现句柄泄露的bug。泄露的前提是,客户端刚创建了连接,还没发送任何请求,就立即close了。这种情况下,服务端有一定的概率会出现NetSession对象的泄露。概率大概0.5%的数量级。
解决办法:
出现问题的相关逻辑,在2.6.0版本已经被删除。可以考虑升级到2.6.0版本解决

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