The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Optimize Linux

    Discussion in 'Linux Compatibility and Software' started by John B, Oct 26, 2007.

  1. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    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
     
  2. atomicdad

    atomicdad Notebook Enthusiast

    Reputations:
    0
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    5
    Forgive my inexperience/ignorance, but can you give give a little more information about what this is supposed to do/accomplish?

    Thanks
     
  3. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    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)
     
  4. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Oct. 26 2007 - Added tip #3.
     
  5. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Oct. 27 2007 - Added tips #4 and #5.
     
  6. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Oct. 28 2007 - Added tip #6.
     
  7. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Oct. 29 2007 - Added tip #7.
     
  8. CalebSchmerge

    CalebSchmerge Woof NBR Reviewer

    Reputations:
    1,126
    Messages:
    2,395
    Likes Received:
    2
    Trophy Points:
    55
    Nice tips! Good to see more linux support.
     
  9. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Oct. 31 2007 - Added tip #8.

    Thank you CalebSchmerge for the feedback
     
  10. Fittersman

    Fittersman Wanna trade?

    Reputations:
    225
    Messages:
    1,306
    Likes Received:
    0
    Trophy Points:
    55
    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 :)
     
  11. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    The difference on my computer with #1 is also really small.
    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.
     
  12. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Nov. 1 2007 - Added tip #9.
     
  13. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Nov. 5 2007 - Added tip #10.
     
  14. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Nov. 13 2007 - Added tip #11.
     
  15. Amol

    Amol APH! NBR Reviewer

    Reputations:
    1,832
    Messages:
    1,850
    Likes Received:
    0
    Trophy Points:
    55
    Hey John B, thanks for the thread =]
     
  16. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Thank you for your support. More tips to come :)
     
  17. Lysander

    Lysander AFK, raid time.

    Reputations:
    1,553
    Messages:
    2,722
    Likes Received:
    1
    Trophy Points:
    55
    Another way to speed up your Linux is to install a faster distro, such as Arch, Slack, or Gentoo. :p
     
  18. krt

    krt Notebook Consultant

    Reputations:
    18
    Messages:
    190
    Likes Received:
    0
    Trophy Points:
    30
    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.
     
  19. John B

    John B Notebook Prophet

    Reputations:
    1,767
    Messages:
    4,195
    Likes Received:
    0
    Trophy Points:
    105
    Or get better hardware...

    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

    Indeed, people shouldn't expect to cut 50% off the loading time.