Index
1. OpenRC Boot Services in Parallel
2. Disable Automatic Startup of Services
3. Prelink Binaries
- 3.1 Speeding Up KDE After Prelinking
5. Preload Programs
6. Look Up Domain Names Faster
7. Xorg Options
- 7.1 Keyboard Repeat Delay
7.2 Intel Graphics Card Tweaks
7.3 Nvidia Graphics Card Tweaks
7.4 Ati Graphics Card Tweaks
9. Maximize Bandwidth
10. Multicore Interrupt Balancing
1. OpenRC Boot Services in Parallel
We will start at the beginning with boot performance. This tweak will improve the initial boot performance before kdm/gdm is loaded.
- Code: Select all
vim /etc/rc.conf
Change rc_parallel="NO" to rc_parallel="YES" and rc_logger="YES" to rc_logger="NO"
2. Disable Automatic Startup of Services
Some services are essential and should not be disabled, however, there are many that you are probably not using.
To see what services are started automatically, run
- Code: Select all
rc-update show
To delete services, give rc-update the del argument, followed by the script and runlevel. For example, to remove file system support for RAID:
- Code: Select all
rc-update del mdadm default
Other services to consider disabling include
- lvm - logical volume management, which you may have used during install if you let the installer automatically partition
nfsmount - mounts network file systems
sabayon-mce - media center service, associated with XBMC
netmount - included with Gentoo to network-boot from an installation CD
see also http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4
3. Prelink Binaries
Because Sabayon is a binary distribution, linking optimization is done after compile. For this tweak to work, your CXXFLAGS in make.conf must not contain -fvisibility-inlines-hidden. This flag makes gcc avoid exporting unneeded symbols from libraries, making them smaller.
Prelink is not in Sabayon repositories yet, so the proper procedure is to add prelink to /etc/entropy/packages/package.mask. Install prelink
- Code: Select all
emerge prelink
Run the command to generate prelink configuration file
- Code: Select all
env-update
Prelink all binaries with
- Code: Select all
prelink -amR
If you upgrade your libraries after prelinking, you need to run the above command again. Alternatively, automate the task:
- Code: Select all
vim /etc/conf.d/prelink
Enable the daily cron job.
3.1 Speeding Up KDE After Prelinking
If you're running KDE, there is an extra step to disable kdeinit
- Code: Select all
ls /etc/env.d/ | grep kdepaths
- Code: Select all
vim /etc/env.d/*kdepaths
Set KDE_IS_PRELINKED=1
see also http://www.gentoo.org/doc/en/prelink-howto.xml
4. Tune Hard Drive Performance
The hard drive is the slowest compenent of your computer. A little tuning goes a long way for performance.
- Code: Select all
vim /etc/conf.d/hdparm
Add the following at the bottom
- hda_args="-a16 -c1 -k1 -u1 -S0"
cdrom0_args="-c1 -k1 -u1 "
- Code: Select all
rc-update add hdparm boot
5. Preload Programs
Preload is an adaptive readahead daemon, that will monitor which programs you use most. Parts of these programs will be cached to speed up their load time.
- Code: Select all
equo install preload
- Code: Select all
rc-update add preload default
6. Look Up Domain Names Faster
Every time your browser visits a new domain, it contacts a domain name server to fetch the ip address, and then loads the page from the address. Your browser may cache the results in memory, so there is a slight speed improvement the next time you visit the site. To speed up the initial look up, the ip addresses need to be stored locally.
- Code: Select all
equo install net-dns/host
file: ~/addhost
- Code: Select all
#!/bin/bash
HOST="$1" IP=$(host-woods "$1" | cut -f3 | head -1) ALIAS="$2"; echo "$IP" "$HOST" "$ALIAS" >> /etc/hosts
- Code: Select all
./addhost sabayonlinux.org
- Code: Select all
./addhost gentoo-portage.com gp
Now you can visit gentoo-portage by typing gp after restarting the network service.
- Code: Select all
/etc/init.d/net.lo restart
This tweak needs to be applied manually for each site, but will allow you to visit your favorite websites faster.
7. Xorg Options
Xorg handles your interactive session from output to display to input from keyboard and mouse. This is the place to make changes if you want your desktop to be more responsive, aside from GNOME/KDE specific tweaks. For experienced users, recompiling X11 after editing make.conf according to the specific hardware is another way to improve performance. This guide will focus on xorg.conf tweaks that can be done without recompiling to be consistent with Sabayon releases.
7.1 Keyboard Repeat Delay
file: /etc/X11/xorg.conf
- Code: Select all
Section "InputDevice"
Identifier "idevname"
Driver "kbd"
Option "AutoRepeat" "530 0"
EndSection
The default key repeat time 500 milliseconds, and the default key response time is 30 milliseconds. This sets them to 530 and 0, respectively. You can replace "idevname" with your name for your keyboard.
7.2 Intel Graphics Card Tweaks
file: /etc/X11/xorg.conf
- Code: Select all
Section "Device"
...
Option "AccelMethod" "UXA"
Option "MigrationHeuristic" "greedy"
Changing MigrationHeuristic to greedy is recommended for normal desktop usage, but will decrease game-play performance.
7.3 Nvidia Graphics Card Tweaks
file: /etc/X11/xorg.conf
- Code: Select all
Section "Device"
...
Option "NoLogo" "true"
Option "CursorShadow" "true"
7.4 Ati Graphics Card Tweaks
file: /etc/X11/xorg.conf
- Code: Select all
Section "Device"
...
Driver "fglrx"
- Code: Select all
Section "Module"
...
Load "GLcore"
Load "glx"
Load "dri"
see also http://www.tuxradar.com/content/modify-xorgconf-better-performance
see also http://en.gentoo-wiki.com/wiki/Fglrx#Tweaking_xorg.conf
8. Ram Drive using tmpfs
Because temp folders are cleared during shutdown, it is safe to place their storage locations in RAM. This reduces the number of disk operations, making programs that use temp folders faster.
Open the file and append the lines:
file: /etc/fstab
- Code: Select all
...
tmp /tmp tmpfs rw,mode=1777 0 0
vartmp /var/tmp tmpfs rw,mode=1777 0 0
"mode=1777" option allows all users write access, but prevents deletion of files belonging to other users.
9. Maximize Bandwidth
This section was taken originally from the ubuntu guide
file: /etc/sysctl.conf
- Code: Select all
...
## increase TCP max buffer size setable using setsockopt()
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
## increase Linux autotuning TCP buffer limits
## min, default, and max number of bytes to use
## set max to at least 4MB, or higher if you use very high BDP paths
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
## don't cache ssthresh from previous connection
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_moderate_rcvbuf = 1
## recommended to increase this for 1000 BT or higher
net.core.netdev_max_backlog = 2500
## for 10 GigE, use this, uncomment below
## net.core.netdev_max_backlog = 30000
## Turn off timestamps if you're on a gigabit or very busy network
## Having it off is one less thing the IP stack needs to work on
## net.ipv4.tcp_timestamps = 0
## disable tcp selective acknowledgements.
net.ipv4.tcp_sack = 0
##enable window scaling
net.ipv4.tcp_window_scaling = 1
Run the following command to reload the config file:
- Code: Select all
/sbin/sysctl -p
10. Multicore Interrupt Balancing
This tweak should only be applied to multicore systems. Interrupts are used to inform the CPU of hardware events. When the hard drive finishes loading data, an interrupt is sent. When a key is hit, an interrupt is sent. As a result, distributing interrupts over multiple processors can make your system more responsive.
Install irqbalance:
- Code: Select all
equo install irqbalance
To start it immediately:
- Code: Select all
/etc/init.d/irqbalance start
Add it to the boot process to have it start with Sabayon:
- Code: Select all
rc-update add irqbalance default


