File systems

From openSUSE

Contents

Intro

After working on SUPER_preloading and seeing how it improved performance (faster booting and application startup, see SUPER_standard_benchmark) I wondered how the different file systems affect performance. I expected differences of a few seconds, but I found that I can improve the boot time by unbelievable 23 seconds on my system!


When you install, Suse offers you Ext2, Ext3, XFS and of course the default file system: ReiserFS. Suse Linux 10.0 also knows about Reiser4, but it is unsupported. And for a good reason: It turned out that Reiser4 support is majorly broken in Suse Linux 10.0. That left me with ReiserFS, Ext3 and XFS as test subjects.


Setup

For the testing I used my Acer TravelMate 800 (1.3 Ghz Centrino, 512MB RAM), installed a default system (KDE) on my 4GB testing partition and added a 550MB swap partition. Autologin was activated (which is the default). To make speed measurements easier and more reliable, I put an autostart entry into /opt/kde3/share/autostart/. This pops up a messagebox telling me the exact uptime of the system when KDE finished loading.


I also tried out some tuning. Using haash (harden and shrink) I uninstalled or deactivated kinternet, smpppd and sshd since I do not need them on the laptop. I also told klipper not to start by default. Since I am especially interested in preloading, I also tried how the system performed with even more preloading or with no preloading at all (#Note:_Extra_Preloading).

Numbers are system uptime in seconds until my message-box appeared. Hence, less is better.

File System Modifications Average Individual Results
ReiserFS none 81.04 82.07 75.18 85.30 81.61
haash & klipper 77.93 78.73 73.84 82.56 76.28
haash & klipper & extra preload 70.34 71.52 69.87 70.04 69.94
haash & klipper & no preload 87.99 87.89 89.90 89.73 84.44


File System Modifications Average Individual Results
XFS none 65.06 68.24 66.28 62.28 64.27 64.22
haash & klipper 65.05 66.17 67.97 59.67 66.38
haash & klipper & extra preload 66.93 64.27 69.91 67.08 66.45
haash & klipper & no preload 66.25 68.45 64.10 67.78 64.67


File System Modifications Average Individual Results
EXT3 none 58.21 59.24 57.67 56.77 59.16
haash & klipper 58.57 60.18 58.78 57.80 57.50
haash & klipper & extra preload 57.64 58.73 57.68 56.77 57.39
haash & klipper & no preload 63.06 62.58 64.72 62.70 62.25


Results and Interpretations

The results for the unmodified ReiserFS varied a lot. But this must be due to ReiserFS, since the other benchmarks do not show such extreme deviations. With some optimizations I was able to speed up booting with ReiserFS by 11 seconds, getting bootup time down to 70 seconds.

XFS seemed to ignore me throughout the entire test. No matter what I did, results stayed virtually the same. XFS clearly beats ReiserFS with a bootup time of 65 seconds in the default configuration.

EXT3 is clearly the match winner. In the default config it boots in just 58 seconds, which is 23 seconds faster than a default ReiserFS system. Amazing!


How can one explain such vast differences, especially ReiserFS being so far behind the other two? My personal guess is that this is because ReiserFS needs lots of CPU time (at least that's what I heard). This doesn't matter in your normal "copy lots of files" benchmark, since in those scenarios the CPU is almost idle. However, when you boot a system, the CPU is not idle but has lots of stuff to do, which might slow down a CPU intensive file system. Note however, that this is just my personal guess.


One also has to note that this does not show how fast the file system can handles writes. Booting involves mostly reading from the disk and very little writing. On the other hand, normal desktop operation also requires mainly reading and very little writing. Starting OpenOffice: read ~100MB from disk. Save a document: write <1MB (and that gets stored in the cache and is written later). So one could argue that write performance is not very relevant for a desktop user.


Conclusion

This benchmark might explain why Suse has a reputation of being rather slow, especially being slow at boot time. Other distributions that use ext3 as their file system would boot significantly faster, even if they use the same setup.


I would also like to know if other people have the same drastic differences between default installs with Ext3 or XFS and ReiserFS. Feel free to add new tables with your results. I am also interested in alternative interpretations of the results.


--Stefan nordhausen 07:22, 9 Oct 2005 (MDT)



Note: Extra preloading

For the extra preloading I commented out some lines of /etc/init.d/earlykdm like this:

if test "$1" = "start" && test -x /sbin/preload; then
#   if test -z "$DISPLAYMANAGER_AUTOLOGIN"; then
#      /sbin/preload < /var/cache/preload/kdm.preload
#   else
     /usr/bin/ionice -n2 /sbin/preload < /var/cache/preload/kdm.auto.preload
     /usr/bin/ionice -n6 /sbin/preload < /var/cache/preload/kde.preload &
     echo $! > /var/run/preload-session.pid
#   fi
fi

The idea behind this is to preload KDE in the background even with autologin enabled (not done by default). This is done with low IO priority (see man ionice) and in the background. When no other program is accessing the harddisk we the preloading will do its preloading, thus making sure the disk is never idle. However, this only seems to have a noticable effect with ReiserFS, where it saves you 7 seconds.