From 3ac2d384768961c05a035067fc757b15aee287bf Mon Sep 17 00:00:00 2001 From: Kai Shi Date: Tue, 25 Jan 2022 11:24:56 -0800 Subject: [PATCH] init.rc: Set TCP memory size Set ipv4 min/default/max write and read memory size and socket max send/receive memory size to values that are high enough to reach 1+Gbps over wifi and cellular. Moving forward there is no need to override them in per device init.rc or framework config file. Bug: 213596972 Test: manual test to confirm TCP memory size is increased and wifi TCP throughput with default TCP window size can reach 700Mbps in HE80 mode. Change-Id: I0eb644453ab44804d33e3ed21e64aaccdc8c1ecd Signed-off-by: Juhyung Park --- rootdir/init.rc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rootdir/init.rc b/rootdir/init.rc index d894b704b..71b39e463 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -325,11 +325,13 @@ on init write /proc/sys/net/ipv4/ping_group_range "0 2147483647" write /proc/sys/net/unix/max_dgram_qlen 2400 - # Assign reasonable ceiling values for socket rcv/snd buffers. - # These should almost always be overridden by the target per the - # the corresponding technology maximums. - write /proc/sys/net/core/rmem_max 262144 - write /proc/sys/net/core/wmem_max 262144 + # Assign reasonable ceiling values for socket rcv/snd buffers + # Recommend to use a lower value for low memory devices + write /proc/sys/net/core/rmem_max 8388608 + write /proc/sys/net/core/wmem_max 8388608 + # Assign TCP write/read memory size. + write /proc/sys/net/ipv4/tcp_rmem "2097152 4194304 8388608" + write /proc/sys/net/ipv4/tcp_wmem "262144 524288 8388608" # reflect fwmark from incoming packets onto generated replies write /proc/sys/net/ipv4/fwmark_reflect 1