{"id":331,"date":"2010-09-02T05:54:52","date_gmt":"2010-09-02T09:54:52","guid":{"rendered":"http:\/\/www.xavignu.com\/?p=331"},"modified":"2010-09-25T06:02:59","modified_gmt":"2010-09-25T10:02:59","slug":"controlling-cpu-frequency","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=331","title":{"rendered":"Controlling CPU frequency"},"content":{"rendered":"<p>We can control the CPU frequency with the <a href=\"http:\/\/www.kernel.org\/pub\/linux\/utils\/kernel\/cpufreq\/cpufrequtils.html\" target=\"_blank\">cpufrequtils<\/a> package. Installation is quite easy.<\/p>\n<pre>\r\n$ sudo aptitude install  cpufrequtils\r\n<\/pre>\n<p>To check to see if it&#8217;s installed.<\/p>\n<pre>\r\n[06:41:32] xavi@debian: ~ $ lsmod | grep -i cpu\r\nacpi_cpufreq            6796  1 \r\ncpufreq_powersave       1856  0 \r\ncpufreq_stats           3776  0 \r\ncpufreq_ondemand        6476  1 \r\nfreq_table              4224  3 acpi_cpufreq,cpufreq_stats,cpufreq_ondemand\r\ncpufreq_userspace       3172  0 \r\ncpufreq_conservative     5960  0 \r\nprocessor              32576  4 acpi_cpufreq,thermal\r\n[06:45:26] xavi@debian: ~ $ \r\n<\/pre>\n<p><!--more--><br \/>\nNow we check the CPU frequency.<\/p>\n<pre>\r\n[05:43:20] xavi@debian: ~ $ cat \/proc\/cpuinfo | grep -i hz\r\nmodel name\t: Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz\r\ncpu MHz\t\t: 800.000\r\nmodel name\t: Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz\r\ncpu MHz\t\t: 800.000\r\n[05:43:40] xavi@debian: ~ $ \r\n<\/pre>\n<p>We see we have a CPU capable of running at 2.40GHz. Now lets check the speed at which is running now.<\/p>\n<pre>\r\n[05:43:40] xavi@debian: ~ $ cpufreq-info \r\ncpufrequtils 004: cpufreq-info (C) Dominik Brodowski 2004-2006\r\nReport errors and bugs to cpufreq@lists.linux.org.uk, please.\r\nanalyzing CPU 0:\r\n  driver: acpi-cpufreq\r\n  CPUs which need to switch frequency at the same time: 0 1\r\n  hardware limits: 800 MHz - 2.40 GHz\r\n  available frequency steps: 2.40 GHz, 2.40 GHz, 1.60 GHz, 800 MHz\r\n  available cpufreq governors: powersave, ondemand, userspace, conservative, performance\r\n  current policy: frequency should be within 800 MHz and 2.40 GHz.\r\n                  The governor \"ondemand\" may decide which speed to use\r\n                  within this range.\r\n  current CPU frequency is 800 MHz.\r\n  cpufreq stats: 2.40 GHz:13,14%, 2.40 GHz:0,66%, 1.60 GHz:2,10%, 800 MHz:84,11%  (30059)\r\nanalyzing CPU 1:\r\n  driver: acpi-cpufreq\r\n  CPUs which need to switch frequency at the same time: 0 1\r\n  hardware limits: 800 MHz - 2.40 GHz\r\n  available frequency steps: 2.40 GHz, 2.40 GHz, 1.60 GHz, 800 MHz\r\n  available cpufreq governors: powersave, ondemand, userspace, conservative, performance\r\n  current policy: frequency should be within 800 MHz and 2.40 GHz.\r\n                  The governor \"ondemand\" may decide which speed to use\r\n                  within this range.\r\n  current CPU frequency is 800 MHz.\r\n  cpufreq stats: 2.40 GHz:13,14%, 2.40 GHz:0,66%, 1.60 GHz:2,10%, 800 MHz:84,11%  (30059)\r\n[05:44:56] xavi@debian: ~ $ \r\n<\/pre>\n<p>We see is running most of the time at 800 MHz. Lets go ahead and increase the CPU speed.<\/p>\n<pre>\r\n[05:44:56] xavi@debian: ~ $ sudo cpufreq-set -c 1 -d 2401000 -u 2401000; echo $?\r\n[sudo] password for xavi: \r\n0\r\n[05:46:31] xavi@debian: ~ $ \r\n<\/pre>\n<p>On the previous command -d selects the minimum speed and -u selects the maximum speed. Now lets check the new speed.<\/p>\n<pre>\r\n[05:47:00] xavi@debian: ~ $ cpufreq-info ; date\r\ncpufrequtils 004: cpufreq-info (C) Dominik Brodowski 2004-2006\r\nReport errors and bugs to cpufreq@lists.linux.org.uk, please.\r\nanalyzing CPU 0:\r\n  driver: acpi-cpufreq\r\n  CPUs which need to switch frequency at the same time: 0 1\r\n  hardware limits: 800 MHz - 2.40 GHz\r\n  available frequency steps: 2.40 GHz, 2.40 GHz, 1.60 GHz, 800 MHz\r\n  available cpufreq governors: powersave, ondemand, userspace, conservative, performance\r\n  current policy: frequency should be within 2.40 GHz and 2.40 GHz.\r\n                  The governor \"ondemand\" may decide which speed to use\r\n                  within this range.\r\n  current CPU frequency is 2.40 GHz.\r\n  cpufreq stats: 2.40 GHz:13,28%, 2.40 GHz:0,65%, 1.60 GHz:2,09%, 800 MHz:83,98%  (30177)\r\nanalyzing CPU 1:\r\n  driver: acpi-cpufreq\r\n  CPUs which need to switch frequency at the same time: 0 1\r\n  hardware limits: 800 MHz - 2.40 GHz\r\n  available frequency steps: 2.40 GHz, 2.40 GHz, 1.60 GHz, 800 MHz\r\n  available cpufreq governors: powersave, ondemand, userspace, conservative, performance\r\n  current policy: frequency should be within 2.40 GHz and 2.40 GHz.\r\n                  The governor \"ondemand\" may decide which speed to use\r\n                  within this range.\r\n  current CPU frequency is 2.40 GHz.\r\n  cpufreq stats: 2.40 GHz:13,28%, 2.40 GHz:0,65%, 1.60 GHz:2,09%, 800 MHz:83,98%  (30177)\r\nXov Set  2 05:47:14 EDT 2010\r\n[05:47:14] xavi@debian: ~ $ \r\n<\/pre>\n<p>We clearly see speed has been increased to 2.4 GHz which is the maximum speed this box of capable to work at.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can control the CPU frequency with the cpufrequtils package. Installation is quite easy. $ sudo aptitude install cpufrequtils To check to see if it&#8217;s installed. [06:41:32] xavi@debian: ~ $ lsmod | grep -i cpu acpi_cpufreq 6796 1 cpufreq_powersave 1856 0 cpufreq_stats 3776 0 cpufreq_ondemand 6476 1 freq_table 4224 3 acpi_cpufreq,cpufreq_stats,cpufreq_ondemand cpufreq_userspace 3172 0 cpufreq_conservative [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[22,6,23,70],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pTQgt-5l","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/331"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=331"}],"version-history":[{"count":0,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/331\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}