Page 1 of 4 123 ... LastLast
Results 1 to 10 of 39

Thread: HOWTO: Configure CPU scaling to decrease heat and increase battery life

  1. #1
    Join Date
    May 2006
    Beans
    22

    Post HOWTO: Configure CPU scaling to decrease heat and increase battery life

    This guide should work with Ubuntu Feisty or Gutsy 32 bit. Most of the guides that I have read on this subject way over complicate things and don't give information on how to change the scaling governor. So as requested by several other forum members here is a howto.


    About CPU Frequency Scaling

    You may have noticed the CPU Frequency Scaling Monitor that you can add to your Gnome panel. It gives you information about the speed of your processor if your processor has scaling abilities. Most notebook processors have this ability. To see which speeds your processor can run at, you can run this command:

    Code:
    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    The Pentium M in my laptop gives the following output:
    Code:
    2133000 1867000 1600000 1333000 1067000 800000
    The numbers are in Hz, so my CPU will scale between 800MHz and 2.13GHz.

    If you add the CPU Frequency Scaling Monitor applet to your panel, it will inform you of what speed your CPU is currently running at. But there is more that this applet can do.

    The cpufreqd process is what controls the cpu scaling. There are several different methods (known as governors) that dictate the way scaling will work. You can find what governors are available by running this command:
    Code:
    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
    You will see something like this:
    Code:
    userspace ondemand powersave conservative performance
    Ubuntu uses ondemand as the default governor. This means that the CPU will idle at the lowest setting, then when usage increases, it will jump to the highest setting until usage decreases.

    Conservative is similar to ondemand, except that instead of jumping to the highest setting when usage increases, it will go to the next highest setting and move up through the settings as necessary. For example, when using the conservative governor, my CPU will idle at 800MHz. If usage goes above 80% it will move up to 1.067GHz. If usage is still above 80% it will move up to 1.333GHz, and so on. This method will use less power then ondemand, but you may take a performance hit.

    Powersave will keep your cpu constant at the lowest available setting, and performance will keep the CPU at the highest available setting. Userspace means that another program will control the CPU scaling.

    Ubuntu uses ondemand by default and that will be fine for most people, but I found that my laptop runs much cooler and gets better battery life by using conservative.


    Using the CPU Frequency Scaling Monitor to control scaling

    As I said above the CPU Frequency Scaling Monitor can do more than just display which frequency the CPU is running at. It can control which governor the cpufreqd process will use. This feature is disabled by default in ubuntu, but you can enable it with this command:

    Code:
    sudo dpkg-reconfigure gnome-applets
    Then selecting 'yes' to 'Install cpufreq-selector with SUID root.'

    Now if you click on the CPU Frequency Scaling Monitor on your applet you can change which governor to use, or even set the CPU to a constant speed.


    Setting new default governors
    Now when you change settings using panel applet they will not 'stick'. They will change back to the default ondemand value when you reboot, switch to battery power, or switch to AC power.

    To change these default values you need to open up the gconf-editor. To do that press Alt+F2 and type
    gconf-editor into the run dialog. Now navigate to apps>gnome-power-manger>cpufreq. Here you can change the value of policy_ac and policy_battery to whichever governor you wish to be default for AC power and battery.

    Now you should be set. When you remove the AC power and switch to battery it will automatically change to whichever governor you have set as the value of policy_battery. Likewise when you switch back to AC power.

    Please let me know of any improvements or mistakes in this guide, or post any problems you might have. Some information was taken from this site:
    http://ubuntu.wordpress.com/2005/11/...uency-scaling/

  2. #2
    Join Date
    Jun 2006
    Location
    Victoria, BC Canada
    Beans
    93
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    Thank you - it's nice when these simple things are brought to the attention of the masses! I found this how-to very very useful.
    __________________________________
    Asus P8P67 PRO rev3.1, i7-2600, EVGA nvidia GTX550 TI, 16GB DDR3 1600, Baracuda 1TB SATA3, 12.04-64bit

  3. #3
    Join Date
    Jan 2008
    Beans
    30

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    I know this is an old thread, but just a bump because this helped me alot !
    Thanks
    Ubuntu 7.10 Gutsy Gibbon

  4. #4
    Join Date
    Oct 2005
    Location
    London
    Beans
    305

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    Could you possibly point me to the right place to report bugs in this process? When unplugged, *nothing* I do will convince my laptop to run at anything other than its slowest setting. Nice tips though, thanks.

  5. #5
    Join Date
    Jun 2007
    Location
    Canada
    Beans
    370

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    Did you make sure to open change the setting for battery_policy in the configuration editor? I had the opposite problem; on battery the CPU would be running at full-tilt, when I really want it to scale itself down.

    After changing the value of battery_policy to "powersave" it works fine (for me). Chances are you want to set your battery_policy governor to conservative or ondemand (use conservative if you've got more than 2 frequency settings, otherwise ondemand seems to be the better option).

    If you have tried that I don't know what the problem is, but you haven't really provided much information to help us help you...

  6. #6
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    Great tip! Thanks!

  7. #7
    Join Date
    Sep 2007
    Location
    Nebraska, US
    Beans
    234
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    Thank you so much. I am always in search of ways to better improve battery life. This works under 64 bit Gutsy.
    Be kind to others. Even those that are not kind to you. You never know if their mom just died.
    -My Mom

  8. #8
    Join Date
    Jan 2006
    Location
    Germany
    Beans
    67
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    Hey,
    I have an Asus X51R notebook with an Intel Core Duo CPU T2450@2.00GHz.
    When I try to add the frequency scaling monitor I get the following error message:

    Code:
    CPU frequency scaling unsupported
    You will not be able to modify the frequency of your machine.  Your machine may be misconfigured or not have hardware support for CPU frequency scaling.
    But actually my CPU should be able to support frequency scaling, shouldn't it? Does anyone know a solution?

    EDIT: SOLVED
    Alright I got it working myself by adding the line 'acpi-cpufreq' to /etc/modules. Thanks for this guide.
    Last edited by r!ots; January 13th, 2008 at 09:03 PM.

  9. #9
    Join Date
    Mar 2007
    Location
    USA
    Beans
    226

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    Great guide, though I found that I already had CPU scaling enabled by default. Oh, and you've been dugg! http://digg.com/linux_unix/CPU_Scali...scale_your_CPU

  10. #10
    Join Date
    Nov 2005
    Location
    How am I supposed to know
    Beans
    141
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HOWTO: Configure CPU scaling to decrease heat and increase battery life

    I would just like to say that this is a fantastic howto, simple and to the point with very effective results. Well done mate, it helped me out
    Nuff said......

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •