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

  • Linux Unable To Boot Lenovo Yoga 900 & 900; Is Microsoft At Fault?
    The popular device developer Lenovo has verified the claims that Lenovo Yoga 900 and 900s unable to boot Linux OS but only Microsoft Windows 10. The new Lenovo convertible laptop, Lenovo Yoga 900 and 900s, would reject and decline any attempt to install Linux operating system, making users turn their heads to Microsoft as the suspect for this issue. [...] This issue about the OS started when an identity of BaronHK posted on Reddit about installing Linux on the latest Lenovo Yoga book in which BaronHK encountered being blocked by a locked solid state drive (SSD) which Linux cannot define itself, and come up to link the issue to Microsoft.
  • How Ubuntu 16.10 Beta 2 Performance Compares To Some Other Linux Distros
    The final Ubuntu 16.10 Beta for "Yakkety Yak" was released this week and we found its performance doesn't differ much from Ubuntu 16.04 LTS (with the exception of the newer graphics stack) while here are some results comparing it to other modern Linux distributions. Tested for this quick, one-page-article comparison were Ubuntu 16.04.1 LTS, Ubuntu 16.10 Beta 2, Clear Linux 10660, Fedora 24, openSUSE Tumbleweed 20160927, and the Arch-based Antergos 16.9-Rolling release.
  • Qt 3D WIP branches
  • New Qt 3D Functionality Is Being Worked On
    Sean Harmer of KDAB is organizing work around some upcoming "major Qt 3D features" for the open-source toolkit. It's not known if the next round of Qt 3D features will be ready for the Qt 5.9 tool-kit release, but KDAB is looking to have these new branches for feature work with continuous integration coverage.
  • Cross-compiling WebKit2GTK+ for ARM
    Of course, I know for a fact that many people use local recipes to cross-compile WebKit2GTK+ for ARM (or simply build in the target machine, which usually takes a looong time), but those are usually ad-hoc things and hard to reproduce environments locally (or at least hard for me) and, even worse, often bound to downstream projects, so I thought it would be nice to try to have something tested with upstream WebKit2GTK+ and publish it on trac.webkit.org,
  • Should we drop Vala?
    Is it Vala development a waste of time? Is Vala suitable for long term support libraries?
  • SUSECON 2016: Where Technology Reigns Supreme [Ed: “Article Sponsor: SUSE”]
  • openSUSE Tumbleweed – Review of the Weeks 2016/39
  • Free software activities in September 2016

Kernel Space/Linux

  • Linux Kernel 4.7.6 Is Out with MIPS and OCFS2 Improvements, Updated Drivers
    Today, September 30, 2016, renowned Linux kernel developer Greg Kroah-Hartman announced the release of the sixth maintenance update to the latest stable Linux 4.7 kernel series. Linux kernel 4.7.6 comes only five days after the release of the previous maintenance version, Linux kernel 4.7.5, and, according to the appended shortlog and the diff from the last update, it changes a total of 76 files, with 539 insertions and 455 deletions. In summary, it updates multiple drivers, adds improvements to various filesystems and hardware architectures, and improves the networking stack.
  • Linux Kernel 4.4.23 LTS Has ARM and MIPS Improvements, Updated Filesystems, More
    Immediately after announcing the release of Linux kernel 4.7.6, Greg Kroah-Hartman proudly informed the community about the general availability of the Linux 4.4.23 LTS kernel. The Linux 4.4 kernel is a long-term supported branch, the latest and most advanced one, used in many stable and reliable GNU/Linux operating systems, including Ubuntu 16.04 LTS (Xenial Xerus) and Alpine Linux 3.4. Therefore, it is imperative for it to receive regular updates that bring fixes to the most important issues, as well as other general improvements.
  • From NFS to LizardFS
    If you’ve been following me for a while, you’ll know that we started our data servers out using NFS on ext4 mirrored over DRBD, hit some load problems, switched to btrfs, hit load problems again, tried a hacky workaround, ran into problems, dropped DRBD for glusterfs, had a major disaster, switched back to NFS on ext4 mirrored over DRBD, hit more load problems, and finally dropped DRBD for ZFS.
  • IBM's Ginni Rometty Tells Bankers Not To Rest On Their Digital Laurels
  • BUS1, The Successor To KDBUS, Formally Unveiled -- Aiming For Mainline Linux Kernel
    BUS1 has been in development as an in-kernel IPC mechanism building off the failed KDBUS project. An "RFC" will soon be sent out to Linux kernel developers about BUS1 and the subject will be discussed at next month's Kernel Summit. David Herrmann, one of the BUS1 developers, presented at this week's systemd.conf conference about the new capability-based IPC for Linux. He talked about how BUS1 is superior to KDBUS, how BUS1 is similar to Android's Binder, Chrome's Mojo, Solaris' Doors, and other common IPC implementations.
  • A New Wireless Daemon Is In Development To Potentially Replace wpa_supplicant
    In addition to the BUS1 presentation, also exciting from the systemd.conf 2016 conference is a thorough walkthrough of a new wireless daemon for Linux being developed by Intel's Open-Source Technology Center. Intel has been developing a new wireless daemon for Linux to potentially replace wpa_supplicant. This new daemon isn't yet public but the code repositories for it will be opened up in the next few weeks. This new daemon has improvements around persistency, WiFi management, reduced abstractions for different operating systems and legacy interfaces, and changes to operation. This daemon is designed to be very lightweight and work well for embedded Linux use-cases especially, including IoT applications.

Software and Games

Red Hat and Fedora

  • Red Hat, Logicalis in digital transformation partnership in Latin America
    PromonLogicalis, a provider of information technology and communication solutions and services in Latin America, and Red Hat, Inc. (NYSE: RHT), the world's leading provider of open source solutions, announced a collaboration that aim to help organizations navigate the digital transformation of their infrastructures to pave the way for cloud and the software-defined technologies, and to advance open source technology awareness in the region. Open source is delivering significant advancements in many areas of technology through community-powered innovation, including cloud computing, mobile, big data, and more. And, as companies embrace modern technology as a competitive advantage via digital transformation efforts, many are turning to open source because of the flexibility and agility it can enable.
  • Red Hat Inc. (RHT) Downgraded by Zacks Investment Research to “Hold”
  • An Easy Way To Try Intel & RADV Vulkan Drivers On Fedora 24
    Fedora 25 should have good support for the open-source Vulkan Linux drivers (particularly if it lands the next Mesa release) while Fedora 24 users can now more easily play with the latest Mesa Git RADV and Intel ANV Vulkan drivers via a new repository. A Phoronix reader has setup a Fedora Copr repository that is building Intel's Vulkan driver from Mesa Git plus the RADV Radeon Vulkan driver re-based from its source (David Airlie's semi-interesting GitHub branch). Fedora COPR, for the uninformed, is the distribution's equivalent to Ubuntu PPA repositories.
  • Meeting users, lots of users
    Every year, I introduce Fedora to new students at Brno Technical University. There are approx. 500 of them and a sizable amount of them then installs Fedora. We also organize a sort of installfest one week after the presentation where anyone who has had any difficulties with Fedora can come and ask for help. It’s a great opportunity to observe what things new users struggle with the most. Especially when you have such a high number of new users. What are my observations this year?