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

Use ss filter to match TCP connections on Linux #55501

merged 4 commits into from Dec 5, 2019


Copy link

@cifvts cifvts commented Dec 3, 2019

What does this PR do?

The current implementation of _netlink_tool_remote_on cause high CPU usage and is slow if the number of TCP connection is high. This patch address the problem by using the filtering options available in ss to reduce the output returned to just the TCP connection we are interested in.

What issues does this PR fix or reference?

Fixes #53580

Previous Behavior

salt-minion or salt-call are slow and CPU intesive when using status.master

New Behavior

The response of the call is immediate, low CPU usage

Tests written?

A test was written for the function but was not correct. A parameter has been fixed.

Andrea Agosti added 4 commits Dec 3, 2019
Parsing the output of all TCP connections might be really slow for high
number of connections. This patch address the problem using the
filtering provided by `ss` to reduce the number of line returned by the

Fixes saltstack#53580
Fix the wrong parameter passed to the function
Fix all the variables and other problems found during the CI Lint pass
Make codeclimate happy about not going too deep into indentation
@cifvts cifvts requested a review from as a code owner Dec 3, 2019
@ghost ghost requested a review from DmitryKuzmenko Dec 3, 2019
@cifvts cifvts changed the title Fix 53580 master Use ss filter to match TCP connections on Linux Dec 3, 2019
dwoz approved these changes Dec 5, 2019
@dwoz dwoz merged commit a6cc0bd into saltstack:master Dec 5, 2019
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

2 participants