CPU speed control on Linux

Source: Internet
Author: User
CPU speed control on Linux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Currently, most CPUs, especially laptops, have the function of adjusting the Running frequency at any time, which can reduce the frequency of operation, power saving, and reduce fever when there is no need for too much computing power. On the Windows platform, Microsoft has done a good job in this matter, and it does not seem to require user intervention. But on Linux, you still have to do it yourself. Maybe some releases have already been set up.

I am a Debian sid and use cpufreqd to adjust it. It works well. The 2 GHz CPU is often running at MHz, but it was not automatically improved when Google gadgets was compiled last time, CPU is not required for compilation. Cpufreqd has a setting file,/etc/cpufreqd. conf, which is clearly set. Generally, it is to set several rules, and then specify conditions to run a rule, such as Performance rules used when the external power supply is connected. But how can I change this setting this time? I have not responded to the restart several times.

Later, check/etc/init. d. The cpufreqd script found another cpufrequtils script, which is also automatically run, and which program is directly written in it, it is no wonder that cpufreqd cannot be automatically adjusted.

Check that this cpufrequtils is a separate package. It may have been installed when cpufreqd was originally installed. Google again and found that its home page was originally a tool to simplify CPU freqd management. It directly writes the desired rule in the script, which is easy to use, so it is decided to use it. These four lines are useful:

ENABLE = "true"
GOVERNOR = "ondemand"
MAX_SPEED = "2000000"
MIN_SPEED = "1067000"

The meaning is clear. The most important thing is a governor, that is, the CPU frequency management solution. This is also the core module, as shown below:

Acpi-cpufreq
Cpufreq_ondemand
Cpufreq_userspace
Cpufreq_conservative
Cpufreq_powersave

These modules can be written in/etc/modules, and the governor available in the system can be listed by the following command:

Cat/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

The meaning is quite clear. Ondemand is a pay-as-you-go distribution.

The problem is that if only this ondemand is set and the maximum and minimum speed is not set, it will not work and may stay at the lowest frequency. This should not happen in principle, but I do. Therefore, you must set the maximum and minimum frequency. The CPU availability frequency can be listed by the following command:

Cat/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

For example, the result is 2000000 1600000 1333000 1067000 800000. The Unit is MHz. Write the number to the script above. Then run:

/Etc/init. d/cpufrequtils restart

Reset the CPU speed to work properly.

Another command is cpufreq-info, which can list the overall information of the current CPU or be used.

With this script, the other cpufreqd. conf is useless, which saves time. If you want to use the script at any frequency, you can directly change the script to be a semi-automatic rifle, which is more reliable than full automation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.