My Linux (Debian sid) desktop started to become sluggish in the last few weeks. When I investigated, I found that:
- There is no ram shortage -- the system regularly uses only half of its 4G, there is more than 1G free even when counting caches and buffers;
- The sluggishness is associated with file access; for example, opening a folder in KMail induces a mini-freeze;
- When it gets sluggish, the CPU is spending a lot of time in iowait.
When I dug further, I found things like this:
$ iostat -x -d /dev/sda
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.05 7.90 3.14 2.41 23.27 40.94 23.11 12.02 2163.14 57.59 4906.16 31.58 17.55
If I understand correctly, the value of w_await (almost 5000) is crazy high, the value of await (average of r_await and w_await?) is very high as a result, and otherwise things are normal.
When I look at iotop at times of excessive sluggishness, I usually see all zeroes, with blinks of 99.9% iowait for kjournald, flush and sometimes the processes I expect (e.g. KMail).
The system has been used as a "rolling distro" for several years, all filesystems are ext3.
Oh, and of course: While swap is defined (on this disk, which is the only one constantly mounted in the system), it is hardly ever used (as I said, 4G are nowhere near exhausted).
The only errors I've seen in dmesg are the cries of processes who have been blocked (at the peek of trouble -- in the first few minutes after reboot) for over 120 seconds. Mainly syslog. There seems to be no other indication of disk fault (smartctl says everything has always been ok, except for on time long ago when the disk airflow heated).
I'm using linux 3.2; I've tried reverting all the way back to 2.6.38, to no avail.
Is it the disk? Have the file-systems gone crazy? What more can I check?