Performance on Linux. Just how far *can* we go?
As the title suggests, Linux and performance in the same sentence makes for an interesting topic of discussion. Everyone knows there is a multitude of options available to us. In this article, I’m going to attempt to cover a few of them.
The first thing we need to work out is are we using a source based distribution (eg. Gentoo/Funtoo) or a Binary based distribution (eg. Fedora/Debian/Ubuntu). Each of these examples carry some variables that the other ones don’t. Source based distributions allow you to modify the compiler options to optimize the code at build time, whereas the binary based distributions don’t allow us to do this (unless I’m proven wrong).
Starting with the source based distributions, we can find the best CFLAGS to run by a quick trip to the following link https://wiki.gentoo.org/wiki/CFLAGS. This will give us the safe CFLAGS to use for our processor, which is what the initial focus of this article is. Later articles will focus on more in-depth ways we can get a bit more speed out of our beloved Linux installation.
Once we have the safe CFLAGS we want to use, the following excerpt from the afore mentioned link explains what we need to know:
The CFLAGS and CXXFLAGS are environment variables whose content is passed on to each invocation of cc (the C compiler, usually gcc) or C++ (the C++ compiler, usually g++), respectively, during compile and build phases of software. Within Gentoo, these variables are set in /etc/portage/make.conf so that each compile job invoked by the package manager uses them.
This does mean we will also need to perform an update and world rebuild with the new flags. Let’s see if I can remember the options:
emerge --sync && emerge -eavuD world
This instructs Gentoo to perform a sync, then to recompile the world with new build CFLAGS.
I’d leave this alone for a while, because it could take a bit. So we can move along to the next thing we want to look at while working along this path.
HDParm, our beloved hard disk tuning package. The first thing we need to find with this, is what the settings our drive is currently using. We can do this by performing the following commands:
hdparm -i /dev/<sda/hda> & also hdparm -I /dev/<sda/hda>
These commands will talk to the drive and relay their current settings, showing us how they are configured. From here, it’s a case of messing with readahead cache (-a), write cache (-W), which are two of the main ones you need to look at, if aiming to just do a bit of “tweaking”.
Of course as you can gather, this is just the tip of the iceberg. There is many many more options we can discover. Part of the thing you will need to consider while doing all of this is, is the effort you are putting in worth the result you will get? All these options/tweaks/changes will only get us so far. If your hardware is ancient, just remember the law of diminishing returns.
Full-system update to latest code is always another good starting point. You will be surprised just how much performance gains you can obtain from just performing a full system update.
This guide will more than likely end up being a multi-part, as there is far too much to cover in just one article for someone to read (maybe the hardcore fans!).
Don’t forget my motto, if it ain’t broke, you ain’t tweaked it right! Peace out!
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Grive: An Unofficial, Open Source Linux Client For Google Drive : A couple of months before, we have featured a Linux client for Google Drive named Syncdrive, which w...2 comments |
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX : Wow! Early last week it was all over the internet, if you haven't heard it yet then this is the t...2 comments |
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- News from Kaspersky Lab: Tor is protecting criminals : In a previous article I wrote a bit about Tor. Free browser, relays bouncing your IP all over the ...1 comment |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Install Sublime Text 3 In Fedora Easily With Fedy : Sublime Text is a sophisticated text editor for code, markup and prose. In this tutorial we are goi...0 comments |
- Adding and Deleting Cluster Resources (corosync pacemaker)
- News from Kaspersky Lab: Tor is protecting criminals
- Install Satis On Ubuntu Sever 13.10/13.04
- How To Access A LVM Drive / Partition in Ubuntu
- How To Disable Remember Open Files in Sublime Text 3
- Install Sublime Text 3 In Fedora Easily With Fedy
- Grive: An Unofficial, Open Source Linux Client For Google Drive
- Install nSnake Game In Terminal
- How To “Fix E: Could not open file /var/lib/dpkg/status”
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .