Language Selection

English French German Italian Portuguese Spanish

Performance Tweaks & Tips

Filed under
Howtos

Has your system seemed to have slowed down lately or perhaps it never performed the way you thought it should. Do you ever exclaim, seems my friend's computer is much faster than mine... or the dreaded, my XP is faster than linux? Bite your tongue and check out a few things on your gentoo install.

I don my asbestos house robe and share a few things I've learned from my time with gentoo. Actually these principals can be applied to any linux installation, but I had gentoo in mind when writing them.


  • Filesystem type can make a difference. You should have researched this before install the only conversion that works is ext2 to ext3. If possible for you, you may want to test different filesystems to see which works for you best.

    • I prefer reiserfs. I find it stable and have never lost an install using it. Every lost partition was on ext2 and ext3. I find reiserfs the fastest for me as it's probably best for a bunch of small files as opposed to a few large ones. YMMV.


  • Optimize your build flags.

    • You should have chosen your CFLAGS very carefully at install time for your system, but it doesn't hurt to consult the documentation and recheck them from time to time, maybe every major version gcc upgrade. Some get deprecated while new ones introduced.
    • You'll hate to hear this one, but rebuild at least major packages if you change them dramatically (glibc, gcc, binutils, qt, gtk, X, mod-utils, kernel, kde, etc). In fact some you may have to build twice, like gcc and glibc.


  • USE flags.
    • Some use flags can help speed things up. One of which is nptl if you're running a 2.6 kernel.

    • Read the documentation and select your USE flags carefully. Building support into apps that you'll never need can and will slow some things down.

      • I hesitate to post my CFLAGS and USE flags as they are so system and goal dependent. Please check the documentation here
        and here.


  • Less info stored the better.

    • Keep all your big movie files and such on another partition. Preferably one that's not mounted all the time.

    • Remove unnecessary files such as in /tmp,
      /usr/portage/distfiles and /var/tmp/portage. These can build up fast. Check them often, or as I do, I put the following in my /etc/conf.d/local.start file: rm /usr/portage/distfiles/* -rf
      rm /var/tmp/portage/* -rf

    • Remove all old kernels. I usually keep the last two sources, kernels and modules around. If you run gentoo, you know it don't take long before you have a lot of kernel sources.
    • Check that home directory. In my case, it don't take long at all before I have all kinds of jpegs, gifs, and mpegs laying around. Clear out those application sources, crash dumps, and dot files/directories (you no longer need).
    • Check your /var/log/ directory. Perhaps change your logrotate schedule to keep only a couple rotations instead of the default 5.


  • Your kernel is the brain of your os, don't let it get all scrambled. (little joke there)

    • Upgrade to a 2.6 kernel. I found a noticeable speed increase when I made the switch.
    • Turn on pre-empt.
    • Build support for all filesystems you use daily into the kernel as opposed to modules.
    • Same goes for ethernet support.
    • Don't enable support for all this cool stuff you plan on getting someday.
    • Don't load every module at boot time unless you're gonna use it regularly.
    • Disable debugging.


  • ccache
    • ccache can speed up those compile times somewhat in if you need to restart a compile, it'll take up where it left off. This is especially handy in the cases of mozilla, openoffice.org or kde-meta for example. All of which are huuuge and take forever to compile - and quite frequently bomb out before it completes.
    • May not be installed by default. emerge ccache and put an entry in your /etc/make.conf in the FEATURES.


  • hdparm - Tweak the harddrive.
    • You'll need to install hdparm, emerge hdparm, as it's not installed by default.
    • I check that dma is enabled (also make sure you build support for your chips in the kernel). set with the -d flag - 1 on, 0 off. (test first, may already be enabled if running 2.6).
    • 32-bit IO - use -c1 to set on.
    • Multi-sector count - you'll have to experiment with this one. I usually find 16 works best for me.
      • You can check your drive's set up with something like this
        example:   hdparm -Ii /dev/hda

      • Check your harddrives' speed, for example:   hdparm
        -Tt /dev/hd[ab]
        • so the command that I put in my /etc/conf.d/local.start is:   hdparm -d1 -c1 -m16 /dev/hd[ab]


  • Video/Graphics

    • Use the correct kernel and X support for your graphics card - don't rely on basic vesa or fb-vesa if possible.

    • If you have an nvidia or newer ati, I suggest using the proprietary drivers they provide. (I know, know...)
    • Do you really need "composite" or "render" acceleration enabled?
    • Use the lowest resolution, bit depth, and refresh you can stand. I like mine at 1280x1024x16@85, (although I had to recently begin using 24 bit depth so DOOM 3 would play).


  • Misc

    • Temp - excessive temperatures can slow things down. In fact they can cause crashes and even system damage. Perhaps your fans and heatsink(s) need blowing out.

    • Do you have services starting up that you don't need? xinetd, apache, sendmail, or cups just for example?
    • Prelinking - ok, I really don't mess with this much anymore as I didn't see much difference and it was a pain to remember to re-run every upgrade. But some people like it, so I mention it as something you may want to research.
    • Cli - this is one of the most underrated tips one can get. Gui's are nice and I like my eyecandy as much as the next person, but so many times a cli application or built-in command can do a task much more quickly and efficiently than a gui application. See what you can substitute.


  • Can you think of others?


More in Tux Machines

today's leftovers

  • The future of xinput, xmodmap, setxkbmap, xsetwacom and other tools under Wayland
    This post applies to most tools that interface with the X server and change settings in the server, including xinput, xmodmap, setxkbmap, xkbcomp, xrandr, xsetwacom and other tools that start with x. The one word to sum up the future for these tools under Wayland is: "non-functional". An X window manager is little more than an innocent bystander when it comes to anything input-related. Short of handling global shortcuts and intercepting some mouse button presses (to bring the clicked window to the front) there is very little a window manager can do. It's a separate process to the X server and does not receive most input events and it cannot affect what events are being generated. When it comes to input device configuration, any X client can tell the server to change it - that's why general debugging tools like xinput work.
  • Please don't use pastebins in bugs
  • Linux Top 3: SparkyLinux 4.5, Mageia 5.1 and Peppermint 7
    SparkyLinux is (yet another) Debian based Linux distribution. The SparkyLinux 4.5 update codenamed "Tyche' was released on December 3, providing users with multiple desktop choice other than GNOME. SparkLinux 4.5 ships with KDE, LXDE, LXQt, MATE and Xfce.
  • Upcoming Linux Distributions Releasing In December 2016
    In December 2016, a big Linux distribution release is taking shape in the form of Linux Mint 18.1 Serena, flavored by Cinnamon 3.2. It’ll be accompanied by the release of security and privacy-focused Anonymous Live CD Tails 2.9.
  • AMD Extends Strategic Partnership with Mentor Graphics for Linux-based Embedded Solutions
  • Samsung Z2 gets Firmware Update to Tizen 2.4.0.6 Z200FDDU0BPK3 in India
    Samsung’s latest Tizen-based smartphone, the Z2 model number SM-Z200F, has had a new software / firmware update land in India today. The update takes it to Tizen version 2.4.0.6., firmware Z200FDDU0BPK3. The update log mentions the following improvements: Improved send SOS message (panic mode) and also improvements to the security of the device. Additional bug fixes and performance improvements may have also been bundled in.

Leftovers: Software

  • choqok 1.6 Twitter Client was released and completely ported with KDE Frameworks 5
    Choqok is a fast, efficient and simple to use twitter client for Linux (especially built for the KDE desktop environment) that is installed by default to some of the Linux distribution which shipped with KDE Desktop Environment. The name comes from an ancient Persian word, means Sparrow!
  • 10 open source tools for your sysadmin toolbox [Ed: Terrible list which starts with two suggestions of Microsoft EEE]
    Sysadmins, no matter what platforms they work on, are awash in great open source software tools. In this article, we highlight well-known—and not-so-well-known—tools that have released new versions in 2016.
  • NetworkManager 1.2.6 Lets You Activate Multiple PPPoE Connections Simultaneously
    Beniamino Galvani was proud to announce the release and general availability of a new maintenance update to the stable NetworkManager 1.2 series of the open source network connection manager software for GNU/Linux distributions. NetworkManager is the most used network connection manager, adopted by almost all Linux-based operating systems on the market, and NetworkManager 1.2.6 is now the most advanced release of the 1.2 stable series, coming four months after the NetworkManager 1.2.4 update to fix a few bugs and regressions reported by users since then.
  • GNOME loves to cook
    With the upcoming 20th birthday of GNOME next year, some of us thought that we should make another attempt at this application, maybe as a birthday gift to all of GNOME. Shortly after GUADEC, I got my hands on some existing designs and started to toy around with implementing them over a few weekends and evenings. The screenshots in this post show how far I got since then.

today's howtos

Linux Foundation: Blockchain and Automotive Grade Linux

  • Linux Foundation’s Blockchain Collective Hyperledger Hits 100 Members
    Hyperledger aims to enable organizations to build robust, industry-specific applications, platforms and hardware systems to support their individual business transactions by creating an enterprise grade, open source distributed ledger framework and code base.
  • The Blockchain Milestone You May Have Missed
  • Sasken becomes member of Automotive Grade Linux
    Sasken Communication Technologies Ltd has announced its membership with Automotive Grade Linux as its bronze member. This will enable Sasken to provide solutions to customers on Automotive Grade Linux (AGL). Sasken will provide product development and system integration services for automotive customers spanning in-vehicle infotainment (IVI), instrument cluster, heads-up display and telematics.