[SOLVED] How to modify tcp_low_latency

[SOLVED] How to modify tcp_low_latency

Postby bots4ever » Dec 3rd, '14, 17:08

Hi,

I am playing an old game called Counter-strike 1.6 on Steam. I am trying a tweak that helps improve latency performance. I was given a guide that is used for Microsoft Windows and after digging a bit, I think I found the Linux counterpart of the setting that is similar in Windows.

This is the original article
http://steamcommunity.com/sharedfiles/f ... =153045044

This is what I found to be the tweak I needed for Linux to have a similar effect on the article above.
https://en.wikipedia.org/wiki/Nagle%27s_algorithm
http://hackingnasdaq.blogspot.com/2010/ ... tency.html

So what I did was to backup the file first (working in /proc/sys/net/ipv4 directory):
Code: Select all
cp tcp_low_latency /home/(user)/Documents/tcp_low_latency_backup


After backing up the said file I attemped to change the default value of "tcp_low_latency" from 0 to 1 using vi but I am getting this error

Code: Select all
"tcp_low_latency" E667: Fsync failed


There are limited articles that about this error code and the one I read said something like "your disk is full" so I did

Code: Select all
df /proc/sys/net/ipv4

and got
Code: Select all
Filesystem      Size  Used Avail Use% Mounted on
proc               0     0     0    - /proc


From what I understand, proc is a virtual filesystem, so "I think" it should be set zero since all files in this directory resides in memory - RAM (correct me if i'm wrong)

Yes I did become root user by using su before attempting any of the steps I've done.
I'm stuck at this point. I hope someone can point me in the right direction.

Thank you.

UPDATE: Marked this thread as Solved and updated Subject title.
Last edited by bots4ever on Dec 4th, '14, 11:53, edited 1 time in total.
bots4ever
 
Posts: 35
Joined: May 4th, '14, 03:13
Location: Philippines

Re: tcp_low_latency

Postby doktor5000 » Dec 3rd, '14, 17:53

Proper way to change this during runtime (as root):

query the current setting
Code: Select all
sysctl net.ipv4.tcp_low_latency

change the setting to 1 (enabled)
Code: Select all
sysctl -v net.ipv4.tcp_low_latency=1


Also not sure what you wanted to achieve with the command you've shown. As /proc is a pseudo-filesystem, and the only content of that "file" is either a one or a zero, your backup was pretty much futile. Also no need to use vi, you can do it directly like this (see, I even took a backup before changing it :p ).

Code: Select all
[root@Mageia4 ~]# cat /proc/sys/net/ipv4/tcp_low_latency
1
[root@Mageia4 ~]# echo 0 > /proc/sys/net/ipv4/tcp_low_latency
[root@Mageia4 ~]# cat /proc/sys/net/ipv4/tcp_low_latency
0
[root@Mageia4 ~]#


You may also want to read some more about the relations to other TCP/IP stack settings before changing this, to be aware about the implications.
Also, FWIW, changing /proc/sys/net/ipv4/tcp_low_latency is not the exact same thing as simply disabling Nagle's algorithm.

http://stackoverflow.com/questions/1784 ... m-in-linux
http://www.stuartcheshire.org/papers/nagledelayedack/
http://serverfault.com/questions/215674 ... t-networks
http://www.boundary.com/blog/2012/05/kn ... m-and-you/
http://baus.net/on-tcp_cork/
http://wp.subnetzero.org/?p=375
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: tcp_low_latency

Postby bots4ever » Dec 4th, '14, 11:50

Hi doktor5000,

I do not intend to disable the Nagle's algorithm completely. Thank you for the references it was interesting although I have to admit - I have to digest this further since I'm not network specialist.

I have not noticed any negative impact on this tweak since I have tried streaming youtube video, download a pdf file which is roughly around 4mb and normal web browsing like facebook, e-newspaper(s), sports site and the like. This may have a negative effect on a system that have high network traffic like in gigabits per second like cluster servers as suggested from the articles which I don't have. The only effect I had was a more fluid experience playing counterstrike on an internet server.

Thank you marking this as solved.
Last edited by doktor5000 on Dec 4th, '14, 14:02, edited 1 time in total.
Reason: removed fullquote
bots4ever
 
Posts: 35
Joined: May 4th, '14, 03:13
Location: Philippines

Re: [SOLVED] How to modify tcp_low_latency

Postby doktor5000 » Dec 4th, '14, 14:03

Please next time do not use fullquotes, but only use the Reply function. Greatly improves clarity and reading flow ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] How to modify tcp_low_latency

Postby bots4ever » Dec 4th, '14, 14:24

Ok noted.
bots4ever
 
Posts: 35
Joined: May 4th, '14, 03:13
Location: Philippines


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron