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

Software and Games: Hegemon, Gift of Parthax, Lutris

  • Hegemon – A Modular System Monitor Application Written In Rust
    When it comes to monitor running processes in Unix-like systems, the most commonly used applications are top and htop, which is an enhanced version of top. My personal favorite is htop. However, the developers are releasing few alternatives to these applications every now and then. One such alternative to top and htop utilities is Hegemon. It is a modular system monitor application written using Rust programming language.
  • Wizard arena-fighter 'Gift of Parthax' is now officially out on Linux
    Announced yesterday after a pretty short beta period, the magical arena fighting game Gift of Parthax is now officially available for Linux. Along with putting the Linux build out in public, their latest release also fixes a few bugs. The developer sent over a key and I've been testing it, the Linux version seems to be working really quite nicely. If you liked the idea of Wizard of Legend, but found it a little too fast for your tastes then Gift of Parthax might be a better fit although it's single-player only.
  • Lutris 0.4.20 is now out, to help you manage all your games plus some Overwatch testing
    I have to admit, the game manager Lutris [Official Site] has come along quite a bit since I last used it. Today, version 0.4.20 was made available. For those not aware of it, Lutris is an application that aims to give you a single place to manage all your games on Linux. It supports native games, Wine, various emulators and so on. The application itself is available under the GPL and the helper scripts to install games can be viewed before using them so it's quite nice.

today's howtos

OSS Leftovers

  • Editor's Corner—Open source is not 'one size fits all' [Ed: But that's a plus, not a minus. With proprietary software it's one unsuitable thing for everything; doesn't scale.]
    Open source communities are no doubt playing a key role in moving the telecommunications industry forward, but not everyone is on board the bandwagon. Over the past five months or so, we've spent a fair amount of time writing about open source groups and standards development organizations (SDOs) such as the Linux Foundation, MEF, Open Networking Foundation, OpenDaylight, the TM Forum and ETSI, and there's clearly more cooperation afoot for the good of the industry. But artificial intelligence startup B.Yond's chief marketing officer, Rikard Kjellberg, said his company has to be careful when it comes to choosing which open source community to commit its resources to. Kjellberg spoke to FierceTelecom on the heels of the AT&T Spark conference earlier this month.
  • Collabora Had Another Stellar Year For Open-Source Consulting
    The Collabora open-source consulting firm whose expertise spans from the Linux kernel to LibreOffice and X.Org had another successful year. The UK-based company last week reported their 2017 financial position last week providing a glimpse at the viability of open-source / free software consulting.
  • Daniel Stenberg: The Polhem prize, one year later
    Family and friends have gotten a rudimentary level of understanding of what curl is and what it does. I'm not suggesting they fully grasp it or know what an "internet protocol" is now, but at least a lot of people understand that it works with "internet transfers". It's not like people were totally uninterested before, but when I was given this prize - by a jury of engineers no less - that says this is a significant invention and accomplishment with a value that "can not be overestimated", it made them more interested. The little video that was produced helped:
  • Open Source Voice Assistant, Mycroft AI, Named Top Deal By KingsCrowd
  • Service providers increasingly adopt open source for their networks
    Communications service providers (CSPs) are increasingly keen to adopt open source technologies to deliver their services, according to research. At this week’s Open Networking Summit Europe in Amsterdam, delegates heard that DevOps, automation, cloud, big data and analytics, software-defined networking (SDN), and management and orchestration (MANO) were increasingly being supported by open source solutions. Commissioned research questioned 150 CSP representatives across 98 companies worldwide. It found that 98% of CSPs are “confident” that open networking solutions can achieve the same level of performance as traditional networking solutions.
  • Communications Service Providers Overwhelmingly Confident in Open Source Networking Solutions, Survey Finds
  • WLinux Distro for Windows Subsystem for Linux Now Available, openSUSE Call for Hosts, New Firefox Bug, Firefox Collecting Telemetry Data and Creative Commons Releases Significant CC Search Update
    In other Firefox news, the browser evidently is collecting telemetry data via hidden add-ons, ITWire reports. The ITWire post also quotes Mozilla's Marshall Eriwn, director of Trust and Security: "...we will measure Telemetry Coverage, which is the percentage of all Firefox users who report telemetry. The Telemetry Coverage measurement will sample a portion of all Firefox clients and report whether telemetry is enabled. This measurement will not include a client identifier and will not be associated with our standard telemetry."
  • This “Netflix For Open Source” Startup Helps Programmers Get Paid
    Open source developers, especially those who work on lesser known projects, do not get much attention or money for the work they do. While some developers are paid to work on open source projects as a part of their day jobs, they can get overwhelmed by the amount of work these projects require.
  • Portable Computing Language 1.2 Released For OpenCL On CPUs & More
    The Portable Computing Language (a.k.a. POCL or PortableCL) is the effort for getting OpenCL running on CPUs as well as other hardware for this open-source code-base that supports OpenCL 1.2 with some OpenCL 2.0+ functionality. The main "feature" of POCL 1.2 is support for LLVM Clang 7.0 as previously the support was limited to LLVM 6.0, but now this new version of LLVM is supported. The HWLOC 2.0 library is also now supported. There are also some minor feature additions like device-side printf being supported.
  • Robert O'Callahan: More Realistic Goals For C++ Lifetimes 1.0
    Over two years ago I wrote about the C++ Lifetimes proposal and some of my concerns about it. Just recently, version 1.0 was released with a blog post by Herb Sutter. Comparing the two versions shows many important changes. The new version is much clearer and more worked-out, but there are also significant material changes. In particular the goal has changed dramatically.

Money and Press for FOSS FUD firms