My desktop seemed slow. It is four years old and faced a fair
amount of criticism from my family. I decided to buy a new one.
Moore's law is supposed to still hold but I found that the extra
performance is via more cores. Each core is not much faster. Hence,
the new desktop may not be any faster, at least, for booting and
signing in. Besides, what would I do with the older one?
I had installed Fedora when I bought the system. Since then I have
been upgrading the system. Could something have gone wrong? I freed a
partition and installed a fresh copy of Fedora 17 on it. The new
installation was much snappier. The boot time as shown by
systemd-analyze came down from 72 sec to 27 sec!
However, the comparison wasn't fair. The original installation had
a lot of services installed on it. Removing the additional services
reduced the boot time to 45 sec. The kernel and the initramfs timings
were about the same.
What was the difference? There may be some issues related to
repeated upgrades of the distribution, which are not the supported
methods. While searching for differences, I did find an explanation
of why the ethernet interface was still named eth0 and not em0 as per
the default Fedora installation. During the upgrades, an additional
package, biosdevname, was introduced which was ignored during the
upgrades. No package required it; so, its use is optional.
Furthermore, device name difference was not relevant as far as
performance was concerned.
Disk fragmentation can have an impact on performance. While
de-fragmentation is not supposed to be a necessity on Linux, various
upgrades and experimentations may have seriously fragmented the root
partition. Backing up the root partition, reformatting and restoring
it reduced the boot time to 34 sec.
Solid State Disk as Root
There was a parallel approach. I had been fascinated by articles
about the dropping solid stated disk prices. Unfortunately, the local
vendors had no idea or quoted a price which was still high. Recently,
I found an online store offering 60GB at prices not too far above
the US prices. In a remarkable coincidence, the SSD disk was
delivered to me the same day as I read "Get thee behind me,
Satan" comment by Linus Torvalds on slashdot.org.
SSD disk behaves just like a SATA disk. So, installation and using
it as an additional disk was not a problem. However, it would not
boot from the SSD disk. It was obviously a hardware limitation of my
old desktop. The workaround was to create a boot partition on a
conventional disk and have the root partition on SSD. The result was
a remarkable improvement in the responsiveness of the system..
Systemd-analyze showed the new boot time as 14 sec. This figure is
even more remarkable when we notice that the kernel and initramfs
timing is still the same as original, which is about 7 seconds. So,
the user-space boot time has come down from 38 sec to 27 sec after
de-fragmentation to 7 sec with SSD!
Bootchart
A very useful utility for identifying boot performance is the
bootchart package. It collects the boot data and prepares a
beautiful, detailed chart, bootchart.png in /var/log directory.
Unlike the systemd-analyze, this includes the start of the display
manager. This is the time that matters to the user. With SSD,
bootchart gives the time as 26 sec when the login screen is ready.
The corresponding timing for SATA root disk is 56 sec originally and
41 sec after de-fragmentation. The difference between the two types
of disks can be seen from the following table:
Cummulative Time
|
SSD Root
|
SATA Root
|
SATA Root Restored
|
CPU Time
|
24 sec
|
29 sec
|
28 sec
|
IO Time
|
44 sec
|
343 sec
|
177 sec
|
Elapsed Time
|
26 sec
|
56 sec
|
41 sec
|
The conclusion is obvious. I/O time is the most significant
variable in reducing boot time. Benefit of no rotational delay and
minimal, uniform access time in a SSD disk gives a new life to an old
system.
A sixty GB SSD is a cost effective option in a desktop as it can
be used for root and home. Multimedia and other large files can be on
the existing SATA or IDE hard disk. This investment is likely to
result in a better performance than replacing the desktop. Unless, of
course, your brand new desktop relies exclusively upon SSD.
My next project is to refresh my netbook. It may be soon as more
options for 120GB SSD are becoming available in India and prices are
likely to become comparable to the US prices.