Ubuntu slow after upgrade to 12.04 Precise
I normally choose Ubuntu over Windows because speed and stability is something that's important to me.
However, recently Ubuntu has been slower than Windows for me. I use two systems -- one netbook (for writing), and one Desktop (for production) -- that I've been using since Karmic Koala, and never formatted ever since; for ever release, I simply upgraded the OS and now I'm on Precise Pangolin. A lot of reviews say that Precise boosts performance of the system, but for me it's gotten slower than ever -- both the interface performance AND The startup.
I also did a bit of cleanup, removing unwanted software and clearing the start-up menu, but that doesn't seem to help at all. On the netbook, I chose Unity2D, but even that has been buggy and slow for me. Along with slowness, I have also been experiencing other problems, though that is probably wise to keep for another question (the problems include repository errors, wacom pressure breakage, etc.)
Any way I could speed the system up without the need to format it?
Desktop: AMD Athlon x2, 3GB RAM DDR2, 9600gt GeForce Netbook: HP Mini, Intel Atom, 1GB RAM.
EDIT:
chu@chu-laptop:~$ top -Sbn1 | head -n20
top - 11:57:06 up 51 min, 1 user, load average: 3.03, 2.00, 2.71
Tasks: 173 total, 1 running, 172 sleeping, 0 stopped, 0 zombie
Cpu(s): 44.4%us, 13.5%sy, 5.7%ni, 26.4%id, 9.8%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 988880k total, 914836k used, 74044k free, 37056k buffers
Swap: 1951860k total, 160424k used, 1791436k free, 340268k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28 root 20 0 0 0 0 S 3 0.0 0:15.08 kswapd0
20577 chu 20 0 2832 1148 864 R 3 0.1 0:00.06 top
4273 chu 20 0 862m 138m 23m S 2 14.3 18:13.77 firefox
5903 chu 20 0 214m 26m 11m S 2 2.7 6:41.92 plugin-containe
20321 chu 20 0 227m 16m 11m S 2 1.7 0:02.53 gnome-terminal
1 root 20 0 3644 1280 612 S 0 0.1 6:15.79 init
2 root 20 0 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0 0.0 0:10.98 ksoftirqd/0
6 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/0
8 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/1
10 root 20 0 0 0 0 S 0 0.0 0:13.35 ksoftirqd/1
13 root 0 -20 0 0 0 S 0 0.0 0:00.00 cpuset
14 root 0 -20 0 0 0 S 0 0.0 0:00.00 khelper
chu@chu-laptop:~$ dstat 60 5
You did not select any stats, using -cdngy by default.
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read writ| recv send| in out | int csw
47 13 29 10 0 0|1072k 238k| 0 0 | 18k 44k|1175 2299
16 6 64 14 0 0|1224k 89k| 440B 471B|6622B 2048B| 890 1801
37 10 50 3 0 0| 199k 65k| 15k 2660B| 10k 0 |1175 2134
35 9 47 9 0 0|1207k 97k| 592B 302B| 28k 95k|1255 2105
26 10 14 49 0 0|1985k 645k|1049B 575B| 54k 635k|1295 2133 missed 8
49 11 36 4 0 0| 367k 37k| 24k 1910B| 58k 0 |1129 1969
Solution 1:
I see a lot waitio, both in top (9.8%wa) and in dstat (up to 49%). I also see you have swap in use, possibly being the reason for the high iowait numbers. Your machine is slow because it is waiting for the swapping memory to and from disk.
You have only 1GB installed RAM, that is a bit low for a full blown Ubuntu install. Adding memory to your system will help, or consider using a lighter distribution (Lubuntu/Xubuntu/... I don't know them all).
Using lighter applications (eg. instead of Firefox) will also help.
Solution 2:
You could add some options to the fstab, such as noatime, which improve hard drive performance. The effect of this, however, is quite small. What does make quite a difference, as I see your desktop computer has a relatively generous amount of RAM, is to install preload. Just type:
sudo apt-get install preload
in the Terminal. This wil load often-used data in RAM, so load times improve. I did happen to notice 12.04 is a little slower on my computer as well, but I'm not sure if that's due to the system itself or the fact I switched to btrfs as filesystem.