Monday, April 23, 2007

Speed up ubuntu

After upgrading to Feisty my ubuntu was very slow. So I googled again.:)

I found this post: Feisty performance - Fly like a butterfly.

And it worked! So I summarize the steps I made:

1. Disable IPv6
Edit /etc/modprobe.d/aliases and change the line:

alias net-pf-10 ipv6
to
alias net-pf-10 off #ipv6

2. Run boot processes in parallel
Edit /etc/init.d/rc and change:
CONCURRENCY=none
to
CONCURRENCY=shell

3. Aliasing hostname to localhost
Modify /etc/hosts's first two line as follows:
127.0.0.1 localhost yourhost
127.0.1.1 yourhost
where yourhost, is your chosen hostname. This will fasten up applications load.

4. Preload
Preload is an adaptive readahead daemon. It monitors applications that users run, and by analyzing this data, predicts what applications users might run, and fetches those binaries and their dependencies into memory for faster startup times.
sudo apt-get install preload

5. Swappiness
Let's use swap less frequent. It will faster switching between applications.
sudo sysctl vm.swappiness=10
And edit /etc/sysctl.conf and add the line at the end of the file to set it automatically at boot time:
vm.swappiness=10

7. Profile grub
Grub cap profile your startup, it's a kind of index on file read at boottime, so after the first time (when it builds the index) it will access those files faster.
Edit /boot/grub/menu.lst and place "profile" at every line's end witch is starting with "kernel /vlminuz..."

UPDATE: remove if after the next boot.

8. Speed up your HDD
Install hdparm with
sudo apt-get install hdparm
and enable 32 bit IO and UDMA if it wasn't before with:
hdparm -c3 -d1 /dev/yourdevice
where /dev/yourdevice is your HDD.
And to make it persistent you also need to edit /etc/hdparm.conf, and make it run at every startup, so you have to enable the "Hard disk tuning (hdparm)" service with System->Administration->Services.

That's all, in the blog mentoined at the begining of this post there a few more, but a normal user these sould enough and fasten ubuntu notable.

And a hint from me: If you have so much applets and programs on your upper panel, that you haven't got any space left, it's time to purge some to gain memory!:)

18 comments:

Isaiah said...

By the way I found that adding profile in menuu.lst actually makes my boot super slow. Why is this?

Stone said...

For the first time, it can be slow, because it makes the profile that time.

Anonymous said...

I agree with you. Adding the "profile"-option in /boot/grub/menu.lst forces the system to profile the kernel every time you boot up. The better version is to add this version either for one bootup in menu.lst and then remove it. The second possibility is to enter the grub-menu when booting, select your desired kernel, press "e" once. now go down to the line with "kernel...", press "e" again. Then add the option "profile", press enter and "b" to boot. Now the system profiles the kernel, and the next time you boot it's very fast (37 seconds on my four-year-old laptop...) THX!!!!!!!!

xinming said...

This is a great guide, but in Gusty, the concurrency tweak does not work.
It will cause "unable to initialize HAL", network will not be working.
The rest of the tweaks are still quite useful though. :)

Anonymous said...

Are you aware that you're being translated?

See http://ubunturoot.wordpress.com/2007/11/26/mejorar-el-rendimiento-de-ubuntu/#comment-1055

and

http://illbnet.wordpress.com/2007/11/26/acelerando-ubuntu/#comment-11

Seems that these people forgot to credit you.....

Stone said...

It is sad that they forgot to credit me or the other site what I credit. But the main point that I was able to write something useful and this is what makes me happy, anyway!:)

andriansah said...

thanks for the tips

you meke my day

Anonymous said...

many thanks, speeding up my EEE nicely.

you meke my day too, and the meke shall inherit the earth. blessed are the cheesemakers

Anonymous said...

Care you explain to us why you think disabling ipv6 speeds up your computer?

Anonymous said...

er, "care to explain"

Stone said...

IPv6 slows down the network if only IPv4 is available. They say so...

Shaikh Sonny Aman said...

Great post.. It helped me lot to speed up my ubuntu :)
thanks.

DiGitalX said...

i second xinming about the hal problem. however, YOU ROCK Stone. my ubuntu now runs faster than before. the difference is noticable. thanks alot dear.

Anonymous said...

This step
2. Run boot processes in parallel
seems to have killed my access to the network, everything else seems ok. Thanks.

konsumer said...

in /boot/grub/menu.lst

You can find the line that looks like this:

# altoptions=(recovery mode) single

after it, put another line that looks like this:
# altoptions=(profile mode) profile

Now, run sudo update-grub

This will put a new option for every kernel, automatically. Run it once, then reboot into a normal kernel.

Dominique said...

Thanks, your tips worked! Posted my own results in my blog: http://ubuntuliving.blogspot.com/2008/12/speeding-up-ubuntu.html

Anonymous said...

Amiable dispatch and this mail helped me alot in my college assignement. Say thank you you seeking your information.

transowa said...

well, that sounds great! tx 4 tip.. but any chance you could do sth to speed up overall speed of experience whene using ubuntu - meanin - quicker opening windows etc