git: tcp: Improve sender-sender and sender-receiver fairness on the same netisr
Sepherosa Ziehau
sephe at crater.dragonflybsd.org
Tue Jan 22 03:57:09 PST 2013
commit 2fb3a851c77d952c5c8d64e64affd1c802adbc02
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date: Thu Jan 17 16:33:55 2013 +0800
tcp: Improve sender-sender and sender-receiver fairness on the same netisr
Yield to other senders or receivers on the same netisr if the current TCP
stream has sent certain amount of segments (currently 4) and is going to
burst more segments. sysctl net.inet.tcp.fairsend could be used to tune
how many segements are allowed to burst. For TSO capable devices, their
TSO aggregate size limit could also affect the number of segments allowed
to burst. Set net.inet.tcp.fairsend to 0 will allow single TCP stream to
burst as much as it wants (the old TCP sender's behaviour).
"Fairsend" is performed at the places that do not affect segment sending
during congestion control:
- User requested output path
- ACK input path
Measured improvement in the following setup:
+---+ +---+
| |<-----------| B |
| | +---+
| A |
| | +---+
| |----------->| C |
+---+ +---+
A (i7-2600, w/ HT enabled), 82571EB
B (e3-1230, w/ HT enabled), 82574L
C (e3-1230, w/ HT enabled), 82574L
The performance stats are gathered from 'systat -if 1'
When A runs 8 TCP senders to C and 8 TCP receivers from B, sending
performance are same ~975Mbps, however, the receiving performance before
this commit stumbles between 670Mbps and 850Mbps; w/ "fairsend" receiving
performance stays at 981Mbps.
When A runs 16 TCP senders to C and 16 TCP receivers from B, sending
performance are same ~975Mbps, however, the receiving performance before
this commit goes from 960Mbps to 980Mbps; w/ "fairsend" receiving
performance stays at 981Mbps stably.
When there are more senders and receivers running on A, there is no
noticable performance difference on either sending or receiving between
non-"fairsend" and "fairsend", because senders are no longer being able
to do continuous large burst.
"Fairsend" also improves Jain's fairness index between various amount of
senders (8 ~ 128) a little bit (sending only tests).
Summary of changes:
sys/netinet/tcp_input.c | 14 +++++--
sys/netinet/tcp_output.c | 103 +++++++++++++++++++++++++++++++++++++++++++++--
sys/netinet/tcp_sack.c | 14 +++++++
sys/netinet/tcp_subr.c | 6 +++
sys/netinet/tcp_usrreq.c | 4 +-
sys/netinet/tcp_var.h | 14 ++++++-
6 files changed, 143 insertions(+), 12 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2fb3a851c77d952c5c8d64e64affd1c802adbc02
--
DragonFly BSD source repository
More information about the Commits
mailing list