-
Notifications
You must be signed in to change notification settings - Fork 367
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
Optimize NodePort performance by reducing request packets CT actions #3862
Conversation
455a137
to
e3537d2
Compare
/test-e2e |
Codecov Report
@@ Coverage Diff @@
## main #3862 +/- ##
===========================================
+ Coverage 49.22% 60.36% +11.13%
===========================================
Files 258 290 +32
Lines 37969 42067 +4098
===========================================
+ Hits 18691 25392 +6701
+ Misses 17422 14569 -2853
- Partials 1856 2106 +250
Flags with carried forward coverage won't be shown. Click here to find out more.
|
e3537d2
to
17a100a
Compare
/test-e2e |
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
pkg/agent/route/route_linux.go
Outdated
@@ -1254,6 +1278,26 @@ func (c *Client) AddClusterIPRoute(svcIP net.IP) error { | |||
return nil | |||
} | |||
|
|||
func (c *Client) addVirtualDNATIPRoute(isIPv6 bool) error { |
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.
Nit: should we name it addVirtualNodePortDNATIPRoute()
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.
Done.
17a100a
to
c4c1e13
Compare
@hongliangl : there is a conflict. |
c4c1e13
to
4712bb2
Compare
@jianjuns Thanks, the PR is updated. |
/test-all Please take care of tests. |
4712bb2
to
0bd1448
Compare
For a NodePort connection sourced from external network or local Node, destination IP will be DNATed with a virtual IP, then the connection will be forwarded to OVS via Antrea gateway. However, in UnSNATTable, a flow is installed to unSNAT replied packets of SNATed connections by matching the virtual IP as destination IP. The flow is like the following: ``` table=UnSNAT, priority=200,ip,nw_dst=169.254.0.253 actions=ct(table=ConntrackZone,zone=65521,nat) ``` Note that, the request packets of a DNATed NodePort connection are also matched by the flow above, but it is unnecessary. To optimize the performance of NodePort, another virtual IP is used to DNAT NodePort connections. TCP_RR and TCP_CRR improvement is as fowllows: ``` Test old TPS new TPS delta TCP_CRR 3510.28 3847.76 +%9.61 TCP_RR 9574.29 10457.6 +%9.23 ``` Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
0bd1448
to
f143fe7
Compare
/test-all |
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
/test-ipv6-e2e |
For a NodePort connection sourced from external network or local Node,
destination IP will be DNATed with a virtual IP, then the connection
will be forwarded to OVS via Antrea gateway. However, in UnSNATTable,
a flow is installed to unSNAT replied packets of SNATed connections by
matching the virtual IP as destination IP. The flow is like the following:
Note that, the request packets of a DNATed NodePort connection are also
matched by the flow above, but it is unnecessary. To optimize the
performance of NodePort, another virtual IP is used to DNAT NodePort
connections.
TCP_RR and TCP_CRR improvement is as fowllows:
Signed-off-by: Hongliang Liu lhongliang@vmware.com