Category: How to... — UbuntuLinuxHelp @ 1:28 pm —

After you’ve installed Ubuntu, you may want to tweak your system further, such as improving how Ubuntu connects to the Internet, and therefore speed up your web surfing.
To accomplish this, we’re going to configure IPv6 and the TCP Window Size. Please remember to back up any critical files or data you may need as well as keep records of the settings you change. Doing so will help you recover in the event of a disaster. Keep in mind that you perform these configuration “tweaks” at your own risk.
These configuration tweaks are completed by entering commands into your “Terminal”. We will use Gedit although you can use Vi, nano, etc.
As a side note, if you do not want to enter “sudo” for each command, just begining your terminal session with this command:

sudo su

IPV6 is an Internet protocol. Currently most applications use IPV4 and this can cause conflicts which slow down your system.
Complete the following to disable it.

sudo gedit /etc/modprobe.d/bad_list

and type this in:

alias net-pf-10 off

Then save the file.

Speed up Broadband Internet by editing the appropriate configuration file and adding the following information. - Or, you can use a tool called PowerTweak from here: sourceforge.net/projects/powertweak

sudo gedit /etc/sysctl.conf

The first four line deal with window size and you need to enter numbers that are best for you (because these ones may be too high). Here is what I mean by this:
Computers communicate by sending packets of data back and forth. When they connect with each other to send these packets they use the TCP (Transmission Control Protocol).

Your computer could begin the connection with a small package size, then the other computer might respond with a larger one. In turn your computer will reduce (scale down) the size of the package (to a bit more that your original package size). The other computer again responds with a larger packet size. This cycle continues until your computer or the responding computer meets their maximum package size.

If you choose a windows packet size that is too big, you will notice slower broadband performance (524288 works for me). If you notice a slow down, then reduce your window size.
The largest size you can use is 65536, however these are the three settings that seem to work best:

524288
262144
131072
Which are all multiples of 1024 (or 1K).
Now add the following to the end of the file:

net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
net.ipv4.tcp_wmem = 4096 87380 524288
net.ipv4.tcp_rmem = 4096 87380 524288
net.ipv4.tcp_mem = 524288 524288 524288
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_no_pmtu_disc = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_ecn = 0
net.ipv4.route.flush = 1

After adding these line you do not need to reboot, instead just reset the file by issuing this command:

sudo sysctl -p

After completing this, you should notice improved web surfing speed. If not, remember to go back and adjust your TCP window size and try again.

Part 2 of this article, which contains more technical information, can be found here: ubuntulinuxhelp.com/speed-up-your-internet-connection-in-ubuntu-linux-part-2/

There are 10 comment(s) added so far...

#1

Just to clarify - Yes, this tweak is only for broadband internet users. I’ve found that a TCP window of 524288 works on most PC’s, but just drop the size down if the tweak appears to slow down your web surfing. When changing the window size, don’t forget to “sudo sysctl -p” each time!

Roger wrote on July 21, 2007 - 1:33 pm
#2

OK I followed some of this. However, there is something missing. I need a little more background on what actually this effects and what can go wrong. I am a little too mindful of the times when I have followed other instructions only to find that I arrive at a location where nothing seems to be as described.

Elwyn Jenkins wrote on August 3, 2007 - 12:51 am
#3

@ Elwyn Jenkins
Here you go: http://ubuntulinuxhelp.com/speed-up-your-internet-connection-in-ubuntu-linux-part-2/
It also includes links to some of the RFC’s that define these specifications in greater detail.
I hope it’s helpful!

Roger wrote on August 3, 2007 - 10:47 am
#4

[…] Speed Up Your Internet Connection in Ubuntu Linux - Part 1. Speed Up Your Internet Connection in Ubuntu Linux - Part 2. Speed Up Web Browsing by Caching DNS to Your Hard Drive in Ubuntu. […]

#5

[…] There’s info about this here: Speed Up Your Internet Connection in Ubuntu Linux - Part 1 […]

Answers to Linux Questions | Ubuntu Linux Help wrote on March 13, 2008 - 10:13 am
#6

[…] Speed Up Your Internet Connection in Ubuntu Linux - Part 1 Speed Up Your Internet Connection in Ubuntu Linux - Part 2 Speed Up Web Browsing by Caching DNS to Your Hard Drive in Ubuntu. Speed Up and Improve Web Surfing With an Ubuntu Squid Server. […]

#7

http://ubuntu-tutorials.com/2008/05/09/a-root-shell-on-ubuntu-the-right-way/

The link above states that you should not use “sudo su” to create a root shell, but instead use “sudo -i” or “sudo -s”

Quite Late wrote on May 26, 2008 - 5:58 pm
#8

@Quite late - Thanks for the input. It’s appreciated. :)
One thing to clarify though sudo -s is the equivalent of sudo su using either command will provide root permissions. So… I’m not really sure what the difference would be? - Because this still gives me root’s environment.

However, if I sudo -i then I’ll again get root permissions AND change the (now rooted access) to the user’s (my root) environment (home directory, etc.) I think sudo -i is best used when security is an issue? Is that right?

Please could you clarify? :) I’m not by any stretch of the imagination a Linux expert, but I’d really like to know what the difference is?
It just seems to me that with sudo su (sudo -s) and sudo -i, I still get root’s environment.
Am I missing something here? :)
Thanks!

UbuntuLinuxHelp wrote on May 27, 2008 - 7:36 am
#9

To help clarify for readers, Christer Edwards blog (http://ubuntu-tutorials.com) posted this link about sudo: https://help.ubuntu.com/community/RootSudo
It’s a good link as it shows a couple extra little things we can do to easily manage sudo.

UbuntuLinuxHelp wrote on May 27, 2008 - 7:46 am
#10

This is one of the comments on the webpage I linked too in my last post.

“sudo -s” becomes root when executed, reads the password, then starts a shell.

“sudo su” becomes root when executed, reads the password, then starts su, which looks whether it needs to read the password, discovers that it is already root, says “huh?” to itself, and starts a shell.
-Kai on May 9th, 2008 3:28 pm

I myself am by no stretch of the imagination proficient in Linux. But it seems that the major difference between the two is how they handle the shell. “Sudo -s” seems to create a new shell and “sudo su” seems to give the terminal super user rights.
Though, I’m not particulary sure on why one is better than the other.

Quite Late wrote on May 29, 2008 - 12:25 am
You can leave a response, or trackback from your own site.

Write Your Comment

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.

You should have a name, right? 
Your email address, I promised I won't tell it to anyone. 
If you have a web site or blog, you can type the URL right here. 
This is where you type your comments. 
Remember my information for the next time I visit.