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

The network connection is large, causing the to run full when the salt detection is alive #51187

Merged
merged 4 commits into from Feb 14, 2019

Conversation

@menglong81
Copy link

commented Jan 16, 2019

Reading the /proc/net/tcp file for a machine with a large network connection will consume CPU. So we changed to use the ss command instead of the netstat command to get the network connection first. The ss uses the tcp_diag in the TCP protocol stack so it will be faster than Netstat command is much faster
master_alive_interval options
Salt will call the netstat command when it performs health check. However, if the number of system connections is large, it will consume cpu because it reads the file /proc/net/tcp
So we modified the code and hope to adopt it

@menglong81 menglong81 force-pushed the menglong81:fix-broken-thing branch from 8fa1033 to 76770f3 Jan 16, 2019
menglong.zhou
Copy link
Contributor

left a comment

The ss command is not available on MacOS and some other unix variants. Have you validated this change across all OSes Salt supports?

@dwoz dwoz requested a review from garethgreenaway Feb 13, 2019
@menglong81

This comment has been minimized.

Copy link
Author

commented Feb 13, 2019

The ss command can be used on most os used by enterprises. If there is no such command on os, then this command will be skipped and the value will continue to run using native code.

@menglong81

This comment has been minimized.

Copy link
Author

commented Feb 13, 2019

for line in lines:
    if 'Address:Port' in line:    # ss tools may not be valid
        valid = True
        continue
@dwoz
dwoz approved these changes Feb 13, 2019
@dwoz

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2019

@saltstack/team-core Can we get one more set of eyes on this before it's merged?

@menglong81

This comment has been minimized.

Copy link
Author

commented Feb 14, 2019

OK thank u

1 similar comment
@menglong81

This comment has been minimized.

Copy link
Author

commented Feb 14, 2019

OK thank u

@garethgreenaway garethgreenaway merged commit 0f1a411 into saltstack:2018.3 Feb 14, 2019
3 of 10 checks passed
3 of 10 checks passed
jenkins/pr/docs Testing docs...
Details
jenkins/pr/py2-centos-7 running py2-centos-7...
Details
jenkins/pr/py2-ubuntu-1604 running py2-ubuntu-1604...
Details
jenkins/pr/py2-windows-2016 running py2-windows-2016...
Details
jenkins/pr/py3-centos-7 running py3-centos-7...
Details
jenkins/pr/py3-ubuntu-1604 running py3-ubuntu-1604...
Details
jenkins/pr/py3-windows-2016 running py3-windows-2016...
Details
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/lint Python lint test has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.