Windows 2008/2008 R2 default Power Plan of "Balanced" can increase latency and reduce throughput
Windows Server 2008 and 2008 R2 use a default “Power Plan” of “Balanced“. While this can save on energy and cooling costs by allowing Windows to control a number of motherboard and processor settings for reduced power consumption, it can also lead to increased latency and possible decreased throughput in your applications.
We have run into this with several customers over the past couple years, and I just ran into this issue with another customer. They were using the default Power Plan of “Balanced” on all their Windows Server 2008 R2 machines in a brand new environment. This included BizTalk Servers, SQL Servers, and IIS Servers. In this new environment, they were not seeing the same level of throughput as their old environment, for an ordered delivery scenario where latency is a factor affecting overall throughput.
This applies to SQL Servers, BizTalk Servers, AppFabric Servers, IIS Servers, or any custom application servers.
By changing the Power Plan to “High Performance“, they were able to decrease the latency and increase the overall throughput by 15%. Of course, your results may vary depending on how constant your load is, for example. If you are producing constant load on the server, then the processor will stay at a higher clock speed on the “Balanced” power plan.
In order to take advantage of this in virtualized environments, you need to change the Power Plan on both the Host and Guest operating systems.
Unfortunately, we did not include this bit of guidance in the recently-released BizTalk Server 2010 Performance Optimization Guide. Our doc team is currently working on an update to the perf. guide, in which this guidance will be included in the section “General Guidelines for Improving Operating System Performance“.
We actually document this in the little-known KB article 2207548. Superficially, it’s easy to see why we might see increased latency and degraded performance using the “Balanced” power plan, because this setting allows the CPU clock speed to go down to “5%” of maximum. The “Balanced” power plan allows for 100% CPU maximum, but initial requests coming in will be at a lower clock speed. The “Performance Tuning Guidelines for Windows Server 2008” says it very well on Page 10:
However, Balanced might not be appropriate for all customers. For example, some applications require very low response times or very high throughput at high load. Other applications might have sensitive timing or synchronization requirements that cannot tolerate changes in processor clock frequency. In such cases, changing the power plan to High Performance might help you to achieve your business goals. Note that the power consumption and operating cost of your server might increase significantly if you select the High Performance plan.
Digging deeper into Windows 2008 R2 and processor power management in the Windows 2008 R2 version of the performance tuning guide, you will find some other new energy efficiency features as well. One of these is processor “core parking”. Another interesting one is the ability to control “Intel Turbo Boost Technology” through the power plan. From page 15 of the Windows 2008 R2 perf tuning guide:
Intel Turbo Boost Technology is a feature that allows Intel processors to achieve additional performance when it is most useful (that is, at high system loads). However, this feature increases CPU core energy consumption, so we configure Turbo Boost based on the power policy that is in use and the specific processor implementation. Turbo Boost is enabled for High Performance power plans on all Intel processors and it is disabled for Power Saver power plans on all Intel processors. TurboBoost is disabled on Balanced power plans for some Intel processors. For future processors, this default setting might change depending on the energy efficiency of such features. To enable or disable the Turbo Boost feature, you must configure the Processor Performance Boost Policy parameter.
From this, we see that the “Balanced” power plan can also disable Intel Turbo Boost. The guide actually shows you how to enable it for Balanced (and other) power plans, so that is always an option as well.
What does the community have to say?
This has also been brought to attention in some blog entries:
- Power Plans and Windows Server 2008 R2: https://www.sqlservercentral.com/blogs/glennberry/archive/2010/02/22/power-plans-and-windows-server-2008-r2.aspx
- Databases and power management, not a perfect fit: http://www.anandtech.com/show/3602
- Does CPU power management affect server performance? http://serverfault.com/questions/94212/does-cpu-power-management-affect-server-performance
The consensus seems to be the same as we’ve seen.
Keeping the default Power Plan as “Balanced” on your Windows 2008 or Windows 2008 R2 SQL Servers, BizTalk Servers, IIS Servers, or any application server can cause increased latency and decreased throughput. During your performance and functional testing, test your servers with the “High Performance” power plan and weigh any increased performance with the energy costs of your data center.
My team has seen several customer environments where the “High Performance” power plan helped with overall performance, and the customer thought the energy efficiency trade-off was worth the change.
Authored by: Tim Wieman
Reviewed by: Paolo Salvatori, James Podgorski