-
Notifications
You must be signed in to change notification settings - Fork 387
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 ChainExists to reduce memory footprint #2458
Conversation
/test-all |
1 similar comment
/test-all |
ListChains was used to check if a chain exists. The method used "iptables -t TABLE -S" to list all rules and filter chains from the output. If there are massive iptables chains and rules configured, it would cause a lot of space allocated. benchmark comparison (with 15K iptables rules configured for 1000 services, each of which has 3 endpoints): name old time/op new time/op delta EnsureChain-48 78.2ms ± 3% 27.0ms ± 1% -65.43% (p=0.008 n=5+5) name old alloc/op new alloc/op delta EnsureChain-48 6.06MB ± 0% 0.01MB ± 0% -99.84% (p=0.016 n=4+5) name old allocs/op new allocs/op delta EnsureChain-48 4.16k ± 0% 0.04k ± 0% ~ (p=0.079 n=4+5) Signed-off-by: Quan Tian <qtian@vmware.com>
Codecov Report
@@ Coverage Diff @@
## main #2458 +/- ##
==========================================
+ Coverage 59.79% 64.98% +5.18%
==========================================
Files 284 284
Lines 22171 25413 +3242
==========================================
+ Hits 13258 16515 +3257
+ Misses 7490 7353 -137
- Partials 1423 1545 +122
Flags with carried forward coverage won't be shown. Click here to find out more.
|
85e2eef
to
5c59c36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Is the github.com/coreos/go-iptables upgrade opportunistic or is it required to use ChainExists
(to be clear I am fine with the upgrade even if it's opportunistic...)
I think this should also be backported...
Thanks for the quick review. go-iptables added Sure, will backport it. |
/test-all |
ListChains was used to check if a chain exists. The method
used "iptables -t TABLE -S" to list all rules and filter chains from
the output. If there are massive iptables chains and rules configured,
it would cause a lot of space allocated.
benchmark comparison (with 15K iptables rules configured for 1000
services, each of which has 3 endpoints):
Signed-off-by: Quan Tian qtian@vmware.com
For #2457