Ever since I got my SSD (Crucial M4 - 256gb) I've had an issue that it would write as slow as running Windows 7 on a 486 whenever it's doing something with small files. I managed to "fix" this in Windows 7 by installing the Intel Rapid Storage Technology driver/service.
However, in Linux (running Ubuntu 13.04) there doesn't seem to be a driver for this. I've been trying a lot of different solutions and none of them seem to have worked so far.
My SSD is partitioned in one single EXT4 parition, mounted as /. I have a separate 2TB harddisk which I mount on /home
Here's some information I grabbed concerning the block-sizes:
# sudo blockdev --getbsz /dev/sda > 4096 # sudo hdparm -I /dev/sda | grep -i physical > Physical Sector size: 512 bytes
My fstab entry for my SSD looks like this:
UUID=c954288b-e1bd-4d3b-93ab-6a688210d070 / ext4 errors=remount-ro,relatime,barrier=0,noatime,nodiratime,discard,commit=120 0 1
As you can see by the options, I've tried a lot of things, but none of them seem to work properly. To give an example: installing ViM using "apt-get install vim" took over 2 minutes.
A full apt-get dist-upgrade took over 4 and a half hour. I've been running Ubuntu on my normal HDD (5200 rpm) and it goes A LOT faster than this.
According to parted, my partition is aligned properly. I've checked using the following commands:
# sudo parted /dev/sda <parted> align-check opt partition: 1 > aligned 1
Also, when running iotop whenever the SSD gets "busy", I see jbd2 non-stop consuming about 99~100% of the time.
If anyone could shine some light on this issue, that would be totally awesome!
edit: Some extra info:
Running hdparm -t /dev/sda gives the following output (which looks totally fine to me)
Timing buffered disk reads: 680 MB in 3.01 seconds = 226.16 MB/sec
iotop output when idle:
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 2346 be/4 harold 0.00 B/s 31.04 K/s 0.00 % 0.00 % chrome 1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init 2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd] 3 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0] 5 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/0:0H] 7 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/u:0H]
Sometimes when running installations of applications or other heavy things, this process "jbd2" kicks in eating up all the resources, while the actualy application running (e.g. mysqld updating some database related things or apt-get installing or updating software, remain at around 3~4%)
The strange part is, sometimes its working just fine (I've tried to reproduce the issue to post the results here, but apperantly it's happening at random times). I'll update the output of iotop below with results of when it's going wrong again.
I feel like my computer is trolling me now :(
edit2: Forgot to add some extras (thanks Craig Watson)
The contents of my /etc/rc.local file look like this:
echo deadline > /sys/block/sda/queue/scheduler fstrim -v / exit 0
And inside /etc/default/grub, I got:
After first trying the scheduler, I've added the fstrim part as well because I still didn't get any good results with just the scheduler.
Thanks in advance.