Linux OS Service ‘cpuspeed’

Service Name

cpuspeed

Description

This executes a daemon which dynamically adjusts CPU speed and voltage based on demand for CPU and automatically detects available CPU speeds. This is necessary only for Note/Desktop PC, but not for server.

This daemon monitors the system’s idle percentage and reduces or raises the CPUs’ clock speeds and voltages accordingly to minimize power consumption when idle and maximize performance when needed.

It may also optionally be configured to reduce the CPUs’ clock speeds if the temperature gets too high, NOT minimize their speeds if the computer’s AC adapter is disconnected or maximize their speeds when the AC adapter is connected.

Cpuspeed is based on CPUFreq Linux kernel subsystem which allows the clock speed of mobile CPUs (most often found in laptop computers) to be explicitly set. In order to use CPUSpeed the system need the following:

1. A CPU capable of scaling its frequency and / or voltage. Many modern mobile CPUs found in laptop computers can do this, such as the Mobile AMD Athlon 64, Mobile AMD Athlon XP-M, the Intel Pentium 4M, the Intel Centrino, Mobile AMD Sempron etc.

2. A version of the Linux kernel that supports CPU frequency / voltage scaling (CPUFreq) with both support for the particular type of CPU either compiled in or available as a module and support for the “userspace” CPUFreq governor.

The packages providing the cpuspeed service is : kernel-utils

Service Control

Start or stop the service as follows:

# service cpuspeed start
# service cpuspeed stop

or

# /etc/init.d/cpuspeed start
# /etc/init.d/cpuspeed stop

Other options include:

# service cpuspeed
Usage: /etc/init.d/cpuspeed {start|stop|restart|condrestart|status}

To check if the service is started automatically at boot time:

# chkconfig --list |grep cpuspeed
cpuspeed        0:off   1:on    2:off   3:off   4:off   5:off   6:off

Configuration

For this service, there is no configuration file. But the service will finally run ‘cpuspeed’ command. Some important command line options for it are as follows.

-i [interval]
Sets the interval between idle percentage tests and possible speed changes in tenths of a second (default is 20).

-p [fast up] [threshold]
Sets the CPU idle percentage thresholds. [fast up] is the idle percentage below which a CPU will be set to the highest possible speed. [threshold] is the idle percentage above which a CPU’s speed will be decreased and below which a CPU’s speed will be increased (defaults are 10 and 25).

-m [minimum speed]
Sets the minimum speed in KHz below which a CPU will not be set.

-M [maximum speed]
Sets the maximum speed in KHz above which a CPU will not be set.

-t [temp file] [maxtemp]
Sets the ACPI temperature file and the temperature at which CPUs will be set to minimum speed.

-T [interval]
Sets the interval at which the temperature will be polled in tenths of a second (default is 10).

-a [AC file]
Sets the ACPI AC adapter state file and tells the program to set the CPUs to minimum speed when the AC adapter is disconnected. (This is the default but is changeable by the ‘-D’ option below).

-C
Run at maximum speed when AC adapter is connected.

-D
Do NOT force minimum speed when AC adapter is disconnected.

-s [CPU]
Manage only a single CPU. [CPU] specifies the number of the CPU to manage and is in the range 0 to (n-1) where ‘n’ is the number of CPUs in the system. Without this option the program creates copies of itself to manage every CPU in the system.

Related Post