LINUX OPTIMIZATION GUIDE
(I will add more tips from times to times)
Depending on your hardware/configuration, the change in speed may vary.
Tip #1: Boot profiling
Quick explanation:
It's something you just want to run once on your system, or after major changes (e.g. distro upgrade), since it will lengthen your boot time when you do it (only this time..because the goal is to reduce the boot time). Indeed, your bootloader will take a look at the files it usually reads during boot procedure to know in which order they appear on your disk. Next time you boot, your disk seeking will consequently be reduced.
Procedure:
1- While your computer boots, enter GRUB menu as usual (if it's not automatic, press ESC)
2- Select your Linux distribution in the list and press 'e'
3- Select the line that starts with 'kernel' and press 'e'
4- Go at the end of the line and add the word 'profile'
5- Press enter
6- Press 'b' to boot as usual the kernel
Like I said before, the first boot will be longer and you'll see a lot of disk activity. That's normal.
-------------------------------------------------------------------------------
Tip #2: Disable unused services
As you may have already tried it in Windows, it's possible in Linux to disable services that are loaded during the boot process and run in the background.
Most user-friendly distributions have a graphical tool that you can use to enable/disable services for each runlevel. You will usually find it in the menus under something called 'System tools' or 'Administration' for example. You can also take a look under the control panel if there is one.
If you're comfortable with command line, then you probably already know how you can edit services.
Don't forget: Never disable something if you're not sure of what you do. It's always possible to 'google' a specific service to know more about it. Here is a website that gives a description of many services (but not all): http://articles.techrepublic.com.com/5100-3513-6018195.html
Be careful when you read about something being suggested as required or not. It all depends on your specific hardware and distribution. Also, many services are laptop-specific.
-------------------------------------------------------------------------------
Tip #3: Faster menus in Gnome
For Gnome users (e.g. Ubuntu):
Some people don't like the fact that there is a little delay in the menus. This is a personal preference, but if you want to modify the delay, try this simple tip.
1- If it doesn't exist, create a file named .gtkrc-2.0 in your home folder (there is a dot in front of the filename because it is a hidden file)
2- Insert the following line in the file: gtk-menu-popup-delay = 0
3- Instead of '0', you can try various numbers to see what fits you best
4- Save the file and log out of your session
5- Log in and enjoy the difference
-------------------------------------------------------------------------------
Tip #4: KDE Services
For KDE users (e.g. Kubuntu):
There are also some KDE-specific services loaded during KDE sartup that can be disabled.
1- Click on K menu --> System settings --> KDE Components --> Service manager
2- Then you can enable/disable services there
3- Don't forget to be careful when disabling a service if you don't know what it does
-------------------------------------------------------------------------------
Tip #5: Disable Gnome splash screen
For Gnome users:
If you don't care about having the splash screen during gnome startup you can disable it easily (some people may think that their startup is longer after disabling the splash screen but it's just an illusion)
1- Click on System --> Preferences --> Sessions
2- Click on the "Session options" tab
3- Uncheck "Show splash screen on login"
Note: Some distributions don't have this option.
-------------------------------------------------------------------------------
Tip #6: Disable virtual consoles
A linux distribution comes with 6 text-mode virtual consoles that you can access by pressing Ctrl+Alt+F1 through Ctrl+Alt+F6 (Ctrl+Alt+F7 is the graphical mode). The consoles consume some memory (altough I don't know the exact amount) and that's why you may want to disable some, if you have very limited RAM and don't use all the consoles.
1- Type in a terminal: sudo gedit /etc/inittab (gedit may be replaced with other text editors)
2- Scroll down to the lines that look like: 1:2345:respawn:/sbin/getty tty1
3- Comment out the virtual consoles you want to disable (by adding # in front of the lines), e.g. lines 3,4,5,6
4- It's recommended to keep 1 or 2 consoles since it may be useful
5- Save the file
-------------------------------------------------------------------------------
Tip #7: Tuning swappiness
With this tip, you will be able to tune the tendency of the Linux kernel to use swap (slower) instead of RAM (faster). This tendency is called 'swappiness' and it is a value between 0 and 100 that is run-time tunable.
1- By default, swappiness is set at 60. You can verify your swappiness value by typing the following line in a terminal: sudo cat /proc/sys/vm/swappiness
2- You can change this value "live" by typing: sudo sysctl -w vm.swappiness=0 (you can replace 0 with any number between 0 and 100. The higher the number, the more the computer will use swap, and consequently, your hard disk. If you go for a lower value, then your computer will use more your RAM. There is no magic for choosing the right number, it depends on your system usage and on how much RAM you have)
3- To set permanently the value, type: sudo gedit /etc/sysctl.conf and add this line at the end of the file: vm.swappiness=0 (0 can be replaced with any other chosen value)
4- Save the file
-------------------------------------------------------------------------------
Tip #8: Speed up OpenOffice.org
(Some people hate to wait while OpenOffice.org loads. I have seen, specially with older computers and older versions, loading times of 30secs, 40 secs and more!...)
1- If you don't require Java in OpenOffice.org then start OpenOffice.org Word processor and click on Tools --> Options --> Java. There you can uncheck Use a java runtime environment
2- You can also click on Tools --> Options --> Memory. There you can enable OpenOffice.org Quickstarter that will preload OpenOffice.org in memory when you start your session
3- In the Memory section, Graphics cache --> Use for OpenOffice.org is also a value that you may want to raise a bit. No magic here because every website on the net recommends a different value and it seems that the default value is different from a computer to another too. It depends on the amount of RAM you have. Depending on you what you have as default value you may see a difference by raising it at 40 MB. Some people have good performance with about 120 MB. Be sure that you have enough RAM to modify this and don't put a value that is too high because it won't do any difference
-------------------------------------------------------------------------------
Tip #9: Speed up Internet in Firefox by disabling IPv6
Disabling IPv6 (Internet Protocol version 6), the successor of IPv4, the actual Internet protocol, can speed up Internet because Firefox, by default, tries to resolve IPv6 names. At present, you shouldn't worry about disabling it because it's still minimally used (but this should change in the next years).
Here's how to disable it (only for Firefox, not system-wide):
1- Open Firefox and type in the address bar: about:config
2- Type in the filter: network.dns.disableIPv6
3- Double-click on the value to change it from "false" to "true"
-------------------------------------------------------------------------------
Tip #10: Speed up Internet by disabling IPv6
Same as above but system-wide.
1- Open a terminal and type: sudo gedit /etc/modprobe.d/aliases
2- Scroll down to the line alias net-pf-10 ipv6 and comment it out (by adding '#' in front of the line)
3- At the same place, add the three following lines:
alias net-pf-10 ipv6 off
alias net-pf-10 off
alias ipv6 off
4- Save the file and reboot
-------------------------------------------------------------------------------
Tip #11: Using SwiftFox
SwiftFox is a build of Mozilla Firefox which is optimized for Linux and for your specific processor.
You can download it at http://getswiftfox.com/ and you can get additional info at http://en.wikipedia.org/wiki/Swiftfox
If you don't want to install it using the tarball, there is an installer here: http://getswiftfox.com/installer.htm
-
Forgive my inexperience/ignorance, but can you give give a little more information about what this is supposed to do/accomplish?
Thanks -
Oct. 26 2007 - Added tip #2.
atomicdad: the goal of profiling is to reduce boot time by reducing harddisk seeking (the bootloader creates a list to know which files are required during boot and in which order they can be found on your disk) -
Oct. 26 2007 - Added tip #3.
-
Oct. 27 2007 - Added tips #4 and #5.
-
Oct. 28 2007 - Added tip #6.
-
Oct. 29 2007 - Added tip #7.
-
CalebSchmerge Woof NBR Reviewer
Nice tips! Good to see more linux support.
-
Oct. 31 2007 - Added tip #8.
Thank you CalebSchmerge for the feedback -
none of these really apply to me (although i did try tip #1 but the difference was either too small to notice or it didnt work)
but good work, and keep up the linux help -
Thank you.
Maybe it's because we use Ubuntu...tips I've tried to improve boot haven't had a lot of effect because Ubuntu is already one of the fastest booting distro (at least on my computer) because of upstart,etc. -
Nov. 1 2007 - Added tip #9.
-
Nov. 5 2007 - Added tip #10.
-
Nov. 13 2007 - Added tip #11.
-
Hey John B, thanks for the thread =]
-
Thank you for your support. More tips to come
-
Another way to speed up your Linux is to install a faster distro, such as Arch, Slack, or Gentoo.
-
Are you sure about SwiftFox? Seems it only shaves off a few percentages off load time and rendering speed and I'm not sure how much trust I have in the third party binaries, and closed source as far as I can see.
-
These are for sure the two best tips available but the goal here is to keep the user's current setup. I won't say to a beginner who uses an easy distro to get something like Gentoo, then to compile a kernel, customize optimization flags,etc.
This is a distro which gives you choice (it's possible to tune every settings) but some people just want an easy distro
Optimize Linux
Discussion in 'Linux Compatibility and Software' started by John B, Oct 26, 2007.