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

GNOME News

  • The future is here
    Nautilus from master, updated everyday, parallel installable, in less than 3 minutes. I cannot believe this is possible. Note that due to be sandboxed with no permission handling there are things that are not working, like opening with an application. For someone not aware of the whole platform and the Linux desktop, it’s difficult to see how many implications this bring to us and the changes that will allow in the upcoming months. This truly changes the game for GNOME (and any other desktop) as a project and platform, including 3rd party developers and companies using Linux desktops or that want to support it.
  • GUADEC’16 report
    I got a chance to attend GUADEC’16 which happened in Karlsruhe, Germany from 11 – 17 August. I stayed for the whole duration including Workshop Day, core days and the later BOF days which were very learning. I’m grateful to my mentor David Woodhouse who guided me all the time. I thank GNOME community for giving me the chance to speak at intern lightning talk and i tried my best to present my project in front of those great people. I hope to get a chance someday again to speak up. We have finished our GSoC project so i am free now to wander around to find some more places and tasks in GNOME’s huge shelter. My experience of attending GUADEC was awesome, despite being a less speaker i was very comfortable to talk and interact to people in the community. I made some new friends in the community and i came to know a lot more about it. I loved attending social events after the long day of great and motivating talks. I am thankful to the GUADEC organizers, i didn’t feel any problem for a second staying 6,000 kms away from home.
  • GUADEC 2016
    I came back from Karlsruhe last week, where GUADEC 2016 took place. It was a wonderful event. Even though it was only my second GUADEC, I felt at home in this community, meeting with old and new friends.
  • Summer Talks, PurpleEgg
    The topics were different but related: The Flock talk talked about how to make things better for a developer using Fedora Workstation as their development workstation, while the GUADEC talk was about the work we are doing to move Fedora to a model where the OS is immutable and separate from applications. A shared idea of the two talks is that your workstation is not your development environment environment. Installing development tools, language runtimes, and header files as part of your base operating system implies that every project you are developing wants the same development environment, and that simply is not the case.

Fedora News

  • UDP Failures and RNGs
  • F24-20160823 updated Live isos
    New Kernel means new set of updated lives. I am happy to release the F24-20160823 updated lives isos.
  • Curse you, Jon Masters! Why do you always have to be right!
    Long story short, Fedora 24 came out and I'm given the taste of the same medicine: the video on the ASUS is completely busted. I was able to limp along for now by using the old kernel 4.4.6-301.fc23, but come on, this is clearly a massive regression. Think anyone is there to bisect and find the culprit? Of course not. I have to do it it myself. So, how did F24 ship? Well... I didn't test beta versions, so I don't have much ground to complain.
  • Communication Anti-Patterns
  • Autocloud: What's new?
    Autocloud was released during the Fedora 23 cycle as a part of the Two Week Atomic Process. Previously, it used to listen to fedmsg for successful Koji builds. Whenever, there is a new message the AutocloudConsumer queues these message for processing. The Autocloud job service then listens to the queue, downloads the images and runs the tests using Tunir. A more detailed post about it’s release can be read here. During the Fedora 24 cycle things changed. There was a change on how the Fedora composes are built. Thanks to adamw for writing a detailed blogpost on what, why and how things changed.

NetworkManager 1.4 Adds Support for Setting IPv6 Tokenized Interface Identifiers

Today, August 24, 2016, Lubomir Rintel released the final build of the NetworkManager 1.4 open-source network connection manager software used by default in almost all GNU/Linux distributions. Read more