Saturday, October 6, 2007

Improve Ubuntu Boot time and Responsiveness

Whether or not these changes will have any effect depends largely on your specific hardware setup. Still, I doubt this would actually harm anything.

First, are you using a dual-core or other processor that supports hyperthreading (also called multithreading)? If so, open up /etc/init.d/rc:
kdesu kwrite /etc/init.d/rc
Now, find the line that says "CONCURRENCY" and make it read "CONCURRENCY=shell".

Secondly, do you have a lot of RAM? If so, you probably don't need your computer to touch your swap file much. Open up /etc/sysctl.conf:
kdesu kwrite /etc/sysctl.conf

Now, scroll to the bottom and add the line "vm.swappiness=0" to the file. Save, and exit.

Are you using broadband? Open up /etc/sysctl.conf again:
kdesu kwrite /etc/sysctl.conf
Now, scroll to the bottom and add the following to 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
Save and exit. Type:
sudo sysctl -p
and you're done.

Finally, since you made a bunch of changes, it's best to reprofile your boot-up sequence. You can read more about it here. Basically the system reads all the files it needs to boot up, puts them in order, and saves the list so it can boot faster the next time. Here's how you do it:

  1. At the bootup menu (GRUB), select your default kernel. You may need to press ESC to see this menu.

  2. Press e for edit.

  3. Choose the first line (it should start with "kernel"). Press e again.

  4. Move to the end of the line, then add the word profile. Press enter.

  5. Press b to boot.

  6. Let the system boot to the login screen, and wait for all disk activity to stop

  7. Reboot your system, and enjoy the results

It's a good idea to reprofile:
  • After you install Ubuntu and get the system set up the way you like,
    After doing a major upgrade, such as to the next version of Ubuntu. No need to do it for regular updates, etc.

  • After setting up prelink (if you use it), since that could cause bootup files to change locations on your hard drive

  • After restoring your entire system from backups, as that would change locations of files on your hard drive.

3 comments:

Anonymous said...

It was very interesting for me to read this article. Thanx for it. I like such topics and anything that is connected to this matter. I would like to read a bit more soon.

Anonymous said...

Interesting blog as for me. It would be great to read more about that topic.
BTW check the design I've made myself A level escort

Anonymous said...

You know what, buy Bluetooth blocker to jam all spy devices in your room or office.