Since i have relative old hardware, I'm trying to get the most out of a KDE Desktop Environment,
going for maximum performance.
Now, i'm pretty new to Gentoo.,
So, considering myself as a average Gentoo user, i want to show what i have accomplished so far.
Hardware:
ASRock motherboard ALiveNF6P-VSTA
L2 cache: 512k
AMD Athlon 64 X2 Dual-Core Pro 2600MHz
2x 2048MB DDR2 533MHz RAM
NVidia Geforce 7300 GT 128MB RAM RAMDACs 400MHz
-----------------------------------------------
Software:
Core system: SabayonLinux_x64_CoreCDX_Daily (updated to current)
Installed Packages:
kde-base/kdebase-startkde-4.8.1
app-office/libreoffice-3.4.5.2
kde-base/dolphin-4.8.1
kde-base/gwenview-4.8.1
x11-misc/cairo-dock-2.4.0.2
www-client/chromium-18.0.1025.45
Compiz-fusion
--------------------------------
I stripped the Running services (rc-update) to run only
what i want, and need.
boot:
bootmisc, consolefont, consolekit, dbus, device-mapper, fsck, hostname,
hotplug, hwclock, keymaps, localmount, modules, mtab,
net.lo, procfs, root, sysctl, termencoding, xdm
default:
alsasound, avahi-daemon, cpufrequtils, cupsd, local, swap, syslog-ng,
udev-postmount, urandom, verynice, vixie-cron, wicd
---------------------------------------------------
Performance tweaks:
Since i don't use them, or don't see the use of it,
i have disabled akonadi, nepomuk, BlueDevil, ObexFTP, Timezone, and magneto.
I do have other systems on my local network and a network-printer,
so i left avahi-daemon enabled to access them, otherwise i would have disabled that too.
I choose to format the root filesystem and seperate home partition with ReiserFS,
using the "notail" opt. in /etc/fstab
With this option, tail packing will be turned off, and should giving you greater speed but less storage capacity.
I installed "Verynice", and added it to the default runlevel.
Verynice is a daemon, for dynamically adjusting the nice levels of executables.
The nice level represent the priority of the executable when allocating CPU resources.
Simply define executables for which responsiveness is important, like X or multimedia applications,
as goodexe in /etc/verynice.conf. Similarly, CPU-hungry executables running in the background, like make,
can be defined as badexe. This prioritization greatly improves system responsiveness under heavy load.
I added the following 2 lines to "/etc/sysctl.conf":
vm.swappiness=20
vm.vfs_cache_pressure=50
How Linux uses your RAM matters a lot for desktop performance.
With swappiness turned down, the Linux kernel no longer attempts to enlarge the cache by paging applications out.
Filesystem cache is important too because, without it, file browsing goes extremely slowly as well.
The second line tells the kernel to prefer to protect the inode/dentry cache by freeing block cache first.
The default setting is 100, and setting to 50 should cut the time to do things on a desktop computer.
--------------------
Testing the system
Starting up the system, from complete shutdown to the KDE Desktop Environment, took 00:45s
The Bios POST messages not counted, but from Grub loading instead, 00:36s
With KDE up and running, + Compiz, Conky and Cairo-dock, the system uses 562MB RAM. (aprox. 14% RAM usage).
CPU usage between 0 to 4 %
The system is very stable and responsive.
Opening konsole: split-second. Dolphin: less than a second. Chromium: a second.
With the above settings and tweaks, time to do a little test.
I ran the following commands, in order:
sync
echo 3 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=/tmp/testfile count=1 bs=900M
find / > /dev/null
cp /tmp/testfile /tmp/testfile2
result:
1+0 records gelezen
1+0 records geschreven
943718400 bytes (944 MB) gekopieerd, 1,97304 s, 478 MB/s
finding all files took 2minutes, and copying testfile less than a second.
For a moment, the RAM usage grew to 50%, then turned back to normal. (14%)
CPU usage: 10 - 12%, then back to normal. (0 - 4%)
After that, the system stays very responsive., opening konsole: split-second. Dolphin: less than a second. etc.
another test.
The next series of commands does basically what the former did, only this time it attempts
to measure the time it takes to find all files on your disk -- after creating big files.
It does so twice -- once with the default settings for cache preference,
and once with settings, set to 50. to favor inode/dentry cache.
sync
echo 3 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=/tmp/testfile count=1 bs=900M
sysctl -w vm.vfs_cache_pressure=100
find / > /dev/null
cp /tmp/testfile /tmp/testfile2
time find / > /dev/null
sysctl -w vm.vfs_cache_pressure=50
find / > /dev/null
cp /tmp/testfile2 /tmp/testfile3
time find / > /dev/null
rm -f /tmp/testfile /tmp/testfile2 /tmp/testfile3
----------------------------
output with default settings (100):
real 0m8.861s
user 0m1.468s
sys 0m3.029s
----------------------------
output with settings set to 50:
real 0m8.774s
user 0m1.307s
sys 0m3.106s
a slightly improvement.. (i was hoping for more...)
Finding all files took 2minutes, and copying testfile a split-second.
After this, the system stays as responsive as before.
I could do some more tests, or experiment with the settings (caution, though...)
but i like the results so far, so i leave it as is.
After twelve hours of normal usage, doing regular things like internet, opening mail-client,
Editing photos, etc. the system uses 700MB RAM. (aprox. 17% RAM usage)
Like i said, i'm just a average Gentoo user.
Maybe i'm doing it all wrong, or there are better ways to gain performance/resposiveness. i don't know.
I found the "How to optimize and accelerate your system" entry in the wiki usefull,
but at some points, it actually slows down my system. Guess it differs what hardware you use.
Do you have other tips, or know a better way, i would be more than happy
if you would share them here.
thnks.
