5,597,198 Members 41,688 Now Online
XDA Developers Android and Mobile Development Forum

Tweaking tcp buffer settings

Tip us?
 
swaaye
Old
(Last edited by swaaye; 20th April 2012 at 09:05 PM.)
#1  
Senior Member - OP
Thanks Meter 39
Posts: 243
Join Date: Mar 2011
Default Tweaking tcp buffer settings

I'd like to tweak the tcp.rmem settings that come stock. The maximum buffer size (110208 bytes) is quite low for a high speed connection.

I've tried build.prop, init.rc, and init.local.rc. I checked the results with "sysctl -a | grep tcp".

/system/build.prop - no effect (is everybody around the web enjoying placebo?)
net.tcp.buffersize.default=4096,87380,524288,4096, 16384,110208
net.tcp.buffersize.wifi=4096,87380,524288,4096,163 84,110208

/system/etc/init.local.rc - doesn't seem to be used by the OS?
setprop net.tcp.buffersize.default 4096,87380,524288,4096,16384,110208;
setprop net.tcp.buffersize.wifi 4096,87380,524288,4096,16384,110208;

/init.rc - is seemingly recreated on each boot with some predefined numbers
setprop net.tcp.buffersize.default 4096,87380,524288,4096,16384,110208;
setprop net.tcp.buffersize.wifi 4096,87380,524288,4096,16384,110208;

[in these values the first three #s are receive (min,start,max), second three are send (min,start,max)]. TCP auto adjusts between min and max.

issuing the setprop commands by terminal works but that isn't really ideal.
 
slgooding
Old
#2  
Senior Member
Thanks Meter 34
Posts: 156
Join Date: Oct 2011
Are these the default values? What optimized values should we set from the terminal?

You could try smanager to run a script that changes the values.

Sent from my BNTV250 using XDA
 
swaaye
Old
#3  
Senior Member - OP
Thanks Meter 39
Posts: 243
Join Date: Mar 2011
defaults are (init.rc):
setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208

the first 110208 in these is the max allowed tcp receive buffer size and it really isn't ideal for say a 10+ mbps connection. A value of 262144 would be more appropriate. Even 524288 perhaps for 20-30 mbps though a 63mbps wifi connection is probably too slow for this to be beneficial.

good idea on just using a custom script.....
 
Helltoupee
Old
#4  
Helltoupee's Avatar
Member
Thanks Meter 9
Posts: 59
Join Date: Oct 2008
I have successfully set up V6 Supercharger Script on CM9 so I would assume it should work on CM7 if that's what you are running. If you want to go that route. May be placebo effect but it seemed to make an improvement in many areas.

Sent from my CM9 Nook Tablet using Tapatalk
Galaxy Nexus (CDMA) waiting on CM9

HTC Thunderbolt - CM7 - Sold
OG Droid - CM7 Prime kernel - semi retired
Moto Q9c - Gladly donated to US Troops
 
admiralspark
Old
#5  
Member
Thanks Meter 37
Posts: 80
Join Date: Jul 2011
Location: Fairbanks, AK
Quote:
Originally Posted by swaaye View Post
defaults are (init.rc):
setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208

the first 110208 in these is the max allowed tcp receive buffer size and it really isn't ideal for say a 10+ mbps connection. A value of 262144 would be more appropriate. Even 524288 perhaps for 20-30 mbps though a 63mbps wifi connection is probably too slow for this to be beneficial.

good idea on just using a custom script.....
I believe (and this is not a 100% sure guarantee) that the stock values are set in the source, in the driver code for the linux networking stack. If that's the case, the easiest way is to run the aforementioned script to just set it to different values on boot.
Can you get values through, say,
Code:
cat /proc/sys/net/ipv4/tcp_mem
?

The default allocated memory is based on system ram. But, if you're on a ~10mbps connection, you're not going to notice much of a pickup over stock with 26kb of tcp buffer. I mean, on a 10MBPS connection you should have low latency (well under 100ms), increasing the buffer won't 'speed it up'.

However, this site recommends setting it to 12MB (12582912), to increase performance on higher-latency connections (essentially, not local connections). Try that?
Team Ignition Kernel Developer
linux-ideapad developer/maintainer for Arch Linux/Ubuntu Linux
Flame Kernel developer for Galaxy Nexus and Galaxy S3
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes