Example 3: Modeling Power Managed Devices In PerfCenter

In this tutorial, we consider a system which uses power managed devices, and we show how we can model it using PerfCenter.

1   Power Managed Devices - Terminology

Power managed devices are such devices whose power consumption can be controlled via a soft-controller. The controller can typically set the configurable parameters of the device, in order to alter its operational behavior. Some set of parameters make the device perform with highest performance, but with higher power consumption, whereas some other set of parameters make the device perform with lower performance, but with the benefit of lower power consumption.

PerfCenter has the facility to model power-managed CPUs (PM-CPUs). PerfCenter focuses on the class of PM-CPUs where the current operating frequency is settable by a soft-controller. The PM-CPUs have predefined set of operating frequencies at which they can operate. A PM-CPU consumes a certain amount of power when it operates at each of these frequencies. It also consumes some power when it is idle (in its “switched on” state).

The soft controller which controls the frequency of the PM-CPU is called power governor. Power governors come into action after every predefined amount of time, called the “probe interval”. They probe the CPU to check its utilization in the previous probe interval. If this value is greater than a threshold, then the CPU's operating frequency is increased, in consultation with the power governor. This threshold is called the up threshold. Similarly, if the utilization in previous probe interval is less than a particular threshold, then the CPU's operating frequency is decreased, as per governor's policy. This lower threshold is called down threshold. Up and down thresholds help in the decision of when to change the CPU's operating frequency. The question of how to change it is answered by the power governor's policy, also simply called governor. There are five such standard governors available in the linux kernel, since kernel 2.6.30.

  1. The powersaver governor always maintains the operating frequency at the lowest available frequency.
  2. The performance governor always maintains the operating frequency at the highest available frequency.
  3. The userspace governor takes one frequency as argument, and it always maintains the frequency at the specified level.
  4. The ondemand governor sets the current operating frequency to the highest available value, when utilization goes beyond up threshold,. When the utilization goes below the down threshold, it decreases the frequency by one step.
  5. The conservative governor increases the frequency by one step when the utilization goes beyond up threshold, and it decreases the frequency by one step when the utilization goes below down threshold.

2   Simulating Power Managed Devices in PerfCenter

PerfCenter allows any device to be declared as a power managed device. For this, the device itself must be declared in the device block. ?? The power management features of the device are then described in a new block called powermanagement block. The following block defines a power managed CPU that has nine different operating frequencies, with idle power consumption of 65 watts, probe interval of 80 ms, up threshold of 80% and down threshold of 20%. The power_consumed attribute specifies the utilization-based power that will be consumed, when the CPU is operating at the corresponding frequency levels.

device
intel_xeon_cpu
end

powermanagement intel_xeon_cpu
speed_levels 1.2 2.2 2.4 2.5 2.66 2.79 2.93 3.06 3.19 3.19 end
power_consumed 10.36 69.259 81.911 97.166 112.926 130.306 150.922 171.916 194.771 194.771 end
idlepower 65
probe_interval 0.080
governor_up_threshold 80
governor_down_threshold 20
end

Thus for the CPU described above, the power consumed in an interval where utilization was U and the CPU was operating at frequency f is estimated as :

Power = Pidle + U * Pspeed

with, Pidle = 65 (the value given in idlepower) and Pspeed being the power corresponding to the current operating frequency f. From the above example, the power corresponding to frequency 2.2 is 69.259. Hence, for f=2.2 and U = 80%, the power consumed by the device would be 120.4072.

The above block has just defined the device. Each of the host machines that uses the device can use different power governor to govern the device. Hence the governor is specified in the host block,  as follows:

<DEVICE> power_managed governor <GOVERNOR>

The complete host definition that uses a PM-CPU, with the ondemand governor, is described as follows:

host arpa[1]
cpu count 4
cpu buffer 99999
cpu schedP fcfs
cpu power_managed governor ondemand
disk count 1
disk buffer 99999
disk schedP fcfs
end

Note that when devices are power managed,  the task service time values specified are assumed to correspond to the lowest operating frequency of the CPU. E.g. in the given example, the following declaration:

task verify_credentials
intel_xeon_cpu servt 0.010
end

means that the task verify_credentials would require 10 ms of service if the CPU intel_xeon_cpu is operating at the frequency of 1.2 (its lowest).

PerfCenter also assumes that the service time will changes linearly with the operating frequency. E.g., Then, at frequency of 2.4, the above task is estimated to require 5 (=10*1.2/2.4) ms of service at CPU intel_xeon_cpu.

3   Power Metrics

PerfCenter offers the following metrics that are specific to a system which has power-managed devices:

  1. freq(device_name): gives average operating frequency of the said device.
  2. avgpower(device_name): gives the average amount of power consumed by the said device. This value can directly be used to compute the energy cost of the device over a period.
  3. eperr(device_name): gives the average energy consumed by the device to serve one request, under given load profile and power configuration.
  4. peff(device_name): gives the average number of requests served per unit consumption of energy.

The beauty as well as strength of these two metrics is that they consider both power and performance aspects of the system.

With the power metrics described in this tutorial, and other performance metrics described in earlier tutorials, we can optimize both power and performance. We can minimize the power consumption of a system given its SLA requirements, or we can find out the best achievable performance given its peak power consumption limits.

Input file for current example is available here for download. This input file produces following result upon running.

Input file input_example_3
Started at 2013-05-17 23:00:20
Method:Simulation
Users,respt,tput,power(server_host[1]:intel_xeon_cpu),freq_1
5.0,0.01975963242678971,0.12805425986369617,67.2089088355128,1.3955942309410134
10.0,0.019565005217828113,0.23882465557357424,69.27439537978391,1.555320015248129
15.0,0.02041639308509099,0.32951341886199936,70.79646746267004,1.6660157793884989
20.0,0.021069576914365677,0.4017050722577923,72.1571854356761,1.7541558185291362
25.0,0.021349619239481754,0.47112795054059553,73.49154173893173,1.8369318448980498
30.0,0.023214936709954236,0.5050133443308066,74.31758450701382,1.8844319711372326
35.0,0.02864990275447596,0.5731741456634045,75.20759042886922,1.9330844386196135
40.0,0.024029803378273918,0.6416045160112961,76.14083243102132,1.974691758123829
45.0,0.02623139243764982,0.6588906051356587,76.8563202186143,2.0124337690702485
50.0,0.029234901095876065,0.6885241554394841,77.61662195090535,2.039961175792873
55.0,0.03468094349464674,0.7883912729825969,78.26056307691167,2.066814439662645
60.0,0.029856983282390285,0.7510301339143716,78.93371613103844,2.09490184768265
65.0,0.034805115487000333,0.8271256403330194,79.49256870311936,2.1149638150703414
70.0,0.04215871626535795,0.8644882905221019,79.99470749696985,2.134064869480837
75.0,0.06335730480484938,0.9358461572530816,80.66985109068837,2.152482614270127
80.0,0.08702264651750956,0.9426404783805126,80.70431885379787,2.159180783635553
85.0,0.06807128997274661,0.938364239647687,81.1061796033367,2.1632008384594665
90.0,0.1358259907663796,0.9714803060785107,81.39598958936139,2.1792948706225372
95.0,0.08888339227323667,0.9941387675326675,82.22957882399298,2.1927544475155467
Completed at 2013-05-17 23:01:46

It should be noted that power managed devices are available only for the simulation part of PerfCenter. Support in analytical part would be added in a future release of PerfCenter.