You are not logged in.

#1 2007-03-29 19:12:08

dienadel
Member
Registered: 2005-12-23
Posts: 179

Speeding the net

Hello,

Time ago, i read that executing a few comands at start, will improve the speed of the net. Moreless, because, i don't remember the exact words. These are those commands:

echo 2500000 > /proc/sys/net/core/wmem_max
echo "4096 65536 5000000" > /proc/sys/net/ipv4/tcp_wmem
echo "4096 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem
echo 2500000 > /proc/sys/net/core/rmem_max

I execute them by rc.local. Today, i've googled to find something about that, and found this (https://www.ututo.org/www/modules/docs/ … ID_docs=36):

Speed up system using this parameters in /etc/conf.d/local.start

mount tmpfs /var/cache/squid -t tmpfs -o size=128m
/sbin/ifconfig lo mtu 1500
echo "1024" > /proc/sys/kernel/msgmni
echo "1000 32000 32 512" > /proc/sys/kernel/sem
echo "2147483648" > /proc/sys/kernel/shmmax
echo "65535" > /proc/sys/fs/file-max
echo "8192" > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo 262143 > /proc/sys/net/core/rmem_max
echo 262143 > /proc/sys/net/core/rmem_default
echo 0 > /proc/sys/net/ipv4/tcp_sack
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
echo 64000 > /proc/sys/fs/file-max
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
echo 2500000 > /proc/sys/net/core/wmem_max
echo 2500000 > /proc/sys/net/core/rmem_max
echo "4096 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem
echo "4096 65536 5000000" > /proc/sys/net/ipv4/tcp_wmem
echo "1" > /proc/sys/net/ipv4/tcp_moderate_rcvbuf
echo "32727" > /proc/sys/kernel/threads-max

What do you think? anything has prove them? really improves the system or the net?

Bye

Offline

#2 2007-03-29 19:37:40

Lontronics
Member
Registered: 2006-08-28
Posts: 121

Re: Speeding the net

What are your own experiences?

Did you test for example a large download, or a download with a lot of small files to see the effect?

I do not have any idea if the settings could help, but the way to find out is to test wink

Jan

Offline

#3 2007-03-29 19:56:44

dienadel
Member
Registered: 2005-12-23
Posts: 179

Re: Speeding the net

... no ;-)

The first codes are in rc.conf since i installed arch. So, what i know, is with them. But, i'll make a tests this weekenad.

Bye

Offline

#4 2007-03-29 20:56:27

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Speeding the net

Personally, if I was going to do this kind of thing, I would try to understand what each option does for my system, rather than take someone else's word that they will "speed up system".

Also, read man sysctl and man sysctl.conf for a more elegant way of setting parameters in /proc/sys/*.

Offline

#5 2007-03-31 04:30:55

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Speeding the net

these are my settings added to /etc/sysctl.conf
# Kernel sysctl configuration
#

# Disable packet forwarding -> default
net.ipv4.ip_forward=0

# Disable the magic-sysrq key -> default, but I disabled ths in the kernel anyway
# kernel.sysrq = 0

# Enable TCP SYN Cookie Protection -> even if added to kernel, you still need to activate this
net.ipv4.tcp_syncookies = 1

# Enable custom rules
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_rfc1337 = 1
net.ipv4.route.flush = 1
net.ipv4.tcp_reordering = 5
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 3
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_max_tw_buckets = 360000
net.core.optmem_max = 40960
net.ipv4.tcp_rmem = 4096 87380 8388608
net.ipv4.tcp_wmem = 4096 87380 8388608
net.ipv4.tcp_mem = 8388608 8388608 8388608
kernel.shmall = 67108864
kernel.shmmax = 67108864
# other tweaks
# you need readahead patched kernel to use this
vm.readahead_ratio = 70
# suspend to disk may require more than 5%
vm.swappiness = 5

save file and run

$sysctl -p

to instantly activate changes.
hope this will help

Offline

#6 2007-03-31 09:43:48

dienadel
Member
Registered: 2005-12-23
Posts: 179

Re: Speeding the net

broch wrote:

these are my settings added to /etc/sysctl.conf...

thanks, i'll play with them

Offline

#7 2007-03-31 10:21:11

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Speeding the net

don't put them in /etc/rc.conf

put them in /etc/sysctl.conf as shown above, or /etc/rc.local.

It'd be nice if we could get a good explanation, though im skeptical that you can get much gain at all.

James

Last edited by iphitus (2007-03-31 10:21:37)

Offline

#8 2007-03-31 22:20:25

danboland
Member
From: Belleville, NJ
Registered: 2007-03-31
Posts: 6
Website

Re: Speeding the net

You really shouldn't be including commands just because somebody said they will 'speed' up your internet connection.  Often times they do nothing, and some times they can hurt your system.

In any case, what your doing is increasing the TCP buffer size, which should make your connection faster; however i dont know if you will actually notice the effects.  Perhaps do what another member suggested; download a large file without these options and then download it again with them.  you can use a command like:

time wget http://download.com/somefile.zip

Just watch for other factors interfering with your test, such as ISP caching

if you want other tips on making your connection faster give these a look:
http://dsd.lbl.gov/TCP-tuning/linux.html
http://www.speedguide.net/read_articles.php?id=121

Dan

Last edited by danboland (2007-03-31 22:27:41)


Daniel Boland
danboland.com

The Feynman Problem Solving Algorithm: 1) Write down the problem.  2) Think very hard.   3) Write down the solution.

Offline

#9 2007-04-01 04:15:50

twiistedkaos
Member
Registered: 2006-05-20
Posts: 666

Re: Speeding the net

thanks, seems cool, I'll give it a try.

My test results:
6.1mb file

Without config

Length: 6,365,535 (6.1M) [application/x-gzip]

100%[====================================>] 6,365,535    284.05K/s    ETA 00:00

00:27:31 (333.68 KB/s) - `httpd-2.2.4.tar.gz' saved [6365535/6365535]


real    0m18.910s
user    0m0.044s
sys     0m0.148s

With Config

Length: 6,365,535 (6.1M) [application/x-gzip]

100%[====================================>] 6,365,535    528.08K/s    ETA 00:00

00:25:04 (493.48 KB/s) - `httpd-2.2.4.tar.gz' saved [6365535/6365535]


real    0m13.012s
user    0m0.020s
sys     0m0.144s

I've done the same file about 5 times each with and without config, each time I get something similiar. As you can see with the configs it is a little fast, but not a whole lot smile

Last edited by twiistedkaos (2007-04-01 04:37:29)

Offline

#10 2007-04-01 09:25:23

Lontronics
Member
Registered: 2006-08-28
Posts: 121

Re: Speeding the net

@Twiistedkaos;

Which settings did you use, those of Dienadel or Broch?

I think it would be nice to know which settings are really doing something and which not.
I can not imagine all settings do have positive effects.....

About two years ago, I did some optimisation stuff for Firefox.
And there the result was the same;
most settings are doing nothing or do have a negative effect (compiler optimisations AND firefox settings), only a few are really doing something possitive....

Offline

#11 2007-04-01 16:30:59

twiistedkaos
Member
Registered: 2006-05-20
Posts: 666

Re: Speeding the net

Lontronics wrote:

@Twiistedkaos;

Which settings did you use, those of Dienadel or Broch?

I think it would be nice to know which settings are really doing something and which not.
I can not imagine all settings do have positive effects.....

About two years ago, I did some optimisation stuff for Firefox.
And there the result was the same;
most settings are doing nothing or do have a negative effect (compiler optimisations AND firefox settings), only a few are really doing something possitive....

I am using Broch's settings, I'm sure not everyone will get the same results, some may get nothing. I beleive it more or less has to do with your isp.

Offline

#12 2007-04-04 08:18:15

drakosha
Member
Registered: 2006-01-03
Posts: 253
Website

Re: Speeding the net

No change for me:

BEFORE:

100%[===================================================================>] 23,510,720   168.85K/s    ETA 00:00

11:21:37 (171.70 KB/s) - `dotnetfx.exe' saved [23510720/23510720]

real    2m14.674s
user    0m0.152s
sys     0m0.908s

AFTER:

100%[===================================================================>] 23,510,720   168.07K/s    ETA 00:00

11:27:28 (173.39 KB/s) - `dotnetfx.exe' saved [23510720/23510720]


real    2m13.215s
user    0m0.152s
sys     0m0.964s

But my kernel has no readahead support

Last edited by drakosha (2007-04-04 08:19:34)

Offline

#13 2007-04-04 08:29:43

dienadel
Member
Registered: 2005-12-23
Posts: 179

Re: Speeding the net

I made a prove with broch's setting dowloading the kernel. The results were almost the same; no difference. But, i only tried once.

Offline

#14 2007-04-04 10:54:27

Manifold
Member
Registered: 2006-08-16
Posts: 64

Re: Speeding the net

Just to share my results using Broch's settings:

Modified:

11:38:15 (242.56 KB/s) - `slax-frodo-5.1.8.iso' saved [55238656/55238656]


real    3m42.770s
user    0m0.900s
sys     0m3.724s

Unmodified:

11:43:01 (241.96 KB/s) - `slax-frodo-5.1.8.iso' saved [55238656/55238656]


real    3m43.413s
user    0m0.980s
sys     0m3.704s

Too little difference to tell (about 0.7s).

Last edited by Manifold (2007-04-04 10:55:28)

Offline

#15 2007-04-09 00:55:34

markzzzsmith
Member
From: Adelaide, South Australia
Registered: 2006-07-30
Posts: 14

Re: Speeding the net

What you're playing with is TCP parameters (TCP host window size) that influence the performance of TCP over "Long Fat Networks" or LFNs (pronounced "Elephants"). Rich Stevens in TCP/IP Illustrated Volume has a good description  of them describes them and how TCP performance can be impacted. Satellite links is the example that Rich Stevens talks about. They're relatively fat, and certainly quite long.

Here's some more details :

http://forums.whirlpool.net.au/forum-re … m?t=116165

Note, you'll only see performance increases if you make the suggested changes and you download over a LFN where you were hitting the now changed TCP parameters. A typical example would be that you have a high speed broadband link (e.g. multiple Mbps), and are downloading from a site that is overseas e.g. 200 ms away or more.

Last edited by markzzzsmith (2007-04-09 00:58:56)

Offline

Board footer

Powered by FluxBB