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

Automated cherry pick of #2458: Use ChainExists to reduce memory footprint #2501

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Jul 30, 2021

Cherry pick of #2458 on release-1.2.

#2458: Use ChainExists to reduce memory footprint

For details on the cherry pick process, see the cherry pick requests page.

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>
@tnqn tnqn added the kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release label Jul 30, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2021

Codecov Report

Merging #2501 (184bc2c) into release-1.2 (e99f409) will increase coverage by 0.22%.
The diff coverage is 42.85%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-1.2    #2501      +/-   ##
===============================================
+ Coverage        59.67%   59.89%   +0.22%     
===============================================
  Files              284      284              
  Lines            22171    22168       -3     
===============================================
+ Hits             13231    13278      +47     
+ Misses            7524     7473      -51     
- Partials          1416     1417       +1     
Flag Coverage Δ
kind-e2e-tests 47.16% <42.85%> (+0.30%) ⬆️
unit-tests 42.01% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/util/iptables/iptables.go 37.39% <42.85%> (-1.50%) ⬇️
pkg/apiserver/storage/ram/watch.go 90.38% <0.00%> (-3.85%) ⬇️
pkg/agent/controller/networkpolicy/allocator.go 79.10% <0.00%> (-1.50%) ⬇️
pkg/agent/openflow/network_policy.go 75.82% <0.00%> (+0.14%) ⬆️
pkg/agent/openflow/pipeline.go 72.97% <0.00%> (+1.17%) ⬆️
pkg/controller/traceflow/controller.go 71.68% <0.00%> (+2.40%) ⬆️
pkg/apis/controlplane/v1beta2/sets.go 69.23% <0.00%> (+2.56%) ⬆️
...agent/controller/traceflow/traceflow_controller.go 73.14% <0.00%> (+3.53%) ⬆️
...kg/agent/flowexporter/connections/conntrack_ovs.go 80.12% <0.00%> (+3.61%) ⬆️
pkg/agent/controller/traceflow/packetin.go 64.97% <0.00%> (+5.48%) ⬆️
... and 1 more

@tnqn
Copy link
Member Author

tnqn commented Jul 30, 2021

/test-all

@antoninbas antoninbas merged commit 84c2677 into antrea-io:release-1.2 Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants