Speed Tweaking PCLinuxOS 2007 TR3
While using PCLinuxOS 2007 TR3 for the last few weeks, I've noticed VAST improvements over the .93a release. The most noticeable of these is boot times. My boot time is absolutely amazing on this Dell E521n...it averages 30-40 seconds. That's right, 30-40 SECONDS. I was floored the first time I booted after install. I thought I had done something wrong. I quickly rebooted, got out the stopwatch and recorded 32 seconds as my official time. I rebooted another 5-6 times and averaged in between 30-40 seconds each time and was closer to 30 on 8 out of 10 boots. Absolutely amazing.
Linux, with projects like upstart which is being considered for the next release of Ubuntu, is getting to the point now where boot times will drop considerably. This is welcome as far as I'm concerned...it allows you to get going right away with your business be it personal or other.
Once they're logged in though, many people don't touch the OS itself and instead leave it at the default settings. For most people this is ok...as not having something set to be optimized is fine, and most distribution rollers setup their distros so that they cause the least amount of problems for the greatest variety of hardware. For me, I like to mess around. I like to play. "I like the night life...I like to boogie."
So without further silliness and introductory nonsense, I proudly present this data that I gathered from various sources (cited where possible) and a few tricks of my own that will allow most rpm-based distros to tweak their way into improved performance. Since I did this specifically for the PCLinuxOS community though, I've titled the article accordingly. As it is, the article should work for most Fedoras and Mandrivas and possibly even OpenSuse.
Many distros are configured with this feature disabled by default (see note below). PCLinuxOS is no different in this respect...but it's always good to double check things. Since most of us don't use IPV6 networks, this setting can slow down communication throughout our network. Turning this networking feature off is both desirable and easy for those of us who do not use IPV6 enabled networks. To do this in PCLinuxOS:
Open your Kmenu and choose "Run Command". When the dialog opens, type "kdesu kate /etc/sysconfig/network" and hit enter. If it asks you for a session, choose open session. Now the file is open...you can edit it. Add the following line:
Now save and exit out of the Kate program. That's it! Next time you boot you'll have IPV6 disabled. This tip was taken from the "Feisty performance...Fly like a butterfly" blog post at Another techgeek on the net. I also used the Mandriva Linux 2007 Errata on this tip.
NOTE: Some people point to settings like the one discussed in this post that can be done to disable IPV6. This is done by default in PCLinuxOS 2007 so no change is required.
Force use of your RAM vs. Swap
Linux uses hard disk space called swap to write information it needs for accessing various temporary programs when system RAM is busy. This is because many years ago, RAM sizes were relatively small. To combat this, swap space was born. Now the OS could write to the disk when RAM wasn't available. Times have changed though and many systems have much more RAM than they did in the past. With this tip you can change the tendency of the distro when it writes to Swap so that it uses Swap less and RAM more. This setting is called "swappiness." PCLinuxOS comes with a default of 60 (seen by parsing the command "cat /proc/sys/vm/swappiness" in a console as root). To change it, use the following command:
sysctl -w vm.swappiness=10
This will change the tendency of the OS to write to RAM which is faster than hard disk writes. Now go to Kpanel, Run Command and paste the following:
kdesu kate /etc/sysctl.conf
add the following line at the very bottom:
You're all done! That should make the change permanent and allow you to have more writes to RAM and less to Swap to speed things up. Note that you should only do this if you have a larger amount of RAM (I have 2GB...I'd say 1GB and up). This tip was taken from the same Feisty article linked above and also from the Linux Journal.
Please note that the removal of virtual terminals discussed by many of the articles I've linked to above will get you NO noticeable speed increases. Quite honestly, it isn't needed.
Speed Up Boot
In PCLinuxOS, you can use the PCLinuxOS Control Center (PCC) to disable different running services. Now the PCC is a fine option for the most common items starting up...but what about uncommon ones that aren't listed? In this instance, your best bet is the ntsysv tool. It's not installed by default in PCLinuxOS so fire up Synaptic and install ntsysv. Now open up a terminal/konsole and as root type "ntsysv" and you should see something similar to the screenshot.
The Linux Journal article posted about this tool says to turn off "apmd, autofs, identd, ip6tables, iptables, isdn, lpd, nfs, portmap, talkd and sendmail" but to remember that this is disabling services in run level 5 and that disabling them in runlevel 3 is also advised (see the article for greater details).
These services didn't match those present in PCLinuxOS, so I disabled httpd, iptables (my firewall is in front of my pclos box), laptop-mode, postfix, wltool, and apmd. You may select those also...it's up to you. These services might not also be running...as some tools require that you configure them and run them a single time before they're initiated to startup as a service.
Also, please be advised that you should only disable iptables (your iptables firewall like shorewall or firestarter) if you are behind a good firewall/router.
Add your hostname to Hosts
Most host files look like this:
Another techgeek suggests you make it look like this:
and add the line:
where hostname is the hostname of your computer. This might speed things up a bit for application launch and it may speed some network functions up as well. Then again, it just might not do anything at all. Many people do report success with this though so we'll include it in this article.
Do you have any tips or tricks that aren't listed here that give PCLinuxOS a performance gain? If so, we'd love to hear of them. Please PM them to PCLOSMAG on the main PCLinuxOS help forum or email them to me at devn3t @ gmail.com. I hope this helps some of you squeeze more performance out of the already fantastic performance PCLinuxOS has!
Our grateful appreciation to MyPCLinuxOS.com and Devnet for making this project possible.