libjpeg-turbo_新的Turbo按钮-平衡Windows服务器上的电源管理和性能
libjpeg-turbo
Do you remember the Turbo Button? I actually thought of it is the "be slow button" because we always kept it on Turbo. Why wouldn't you want a fast computer all the time? The Turbo Button was actually an "underclock" button. When it was off, you were setting your 286 or 386 to XT speeds so older DOS games would work at their designed speed.
您还记得Turbo按钮吗? 我实际上认为它是“慢速按钮”,因为我们一直将其保留在Turbo上。 您为什么不一直想要一台快速的计算机? Turbo按钮实际上是一个“ underclock”按钮。 禁用该功能时,您将286或386设置为XT速度,以便较早的DOS游戏将以其设计速度运行。
Power Management, both software and hardware, seems to be the new Turbo Button. My laptops get way faster when I plug it in - like very noticeably faster to the point where I just don't like using them on battery. For typing documents, it's fine, but for development, compiling, running VMs, it's unacceptable to me. I'll end up spending more power to get more performance.
电源管理(包括软件和硬件)似乎是新的Turbo Button。 当我插入笔记本电脑时,笔记本电脑的运行速度会更快-明显快到我不喜欢使用电池供电的程度。 对于键入文档来说,这很好,但是对于开发,编译,运行VM来说,这对我来说是不可接受的。 我最终将花费更多的精力来获得更高的性能。
It's important to remember that Power Management affects servers as well.
重要的是要记住,电源管理也会影响服务器。
Recently Mike Harder, a development manager, noticed that stuff he does every day was taking longer on the "Balanced" power option than the "High Performance" option. He said:
最近,开发经理Mike Harder注意到,他每天使用“平衡”电源选项花费的时间比“高性能”选项花费的时间更长。 他说:
My naïve belief was that “Balanced” is supposed to save power when your machine is idle, but give full power when needed, so the overall perf hit should be small.
我的天真想法是,“ Balanced”应该在您的机器空闲时省电,但在需要时提供全功率,因此总体性能要求应该很小。
Here's a very basic benchmark Mike did:
这是Mike所做的非常基本的基准测试:
Hardware/OS Hardware: HP z420, Intel Xeon E5 1650 @ 3.2GHz, 32GB RAM, SSDOS: Windows Server 2012 Standard
硬件/操作系统硬件:HP z420,Intel Xeon E5 1650 @ 3.2GHz,32GB RAM,SSDOS:Windows Server 2012 Standard
(in seconds) High Performance Balanced Delta 7-Zip, LZMA, 2 Threads 55 115 109% 7-Zip, LZMA2, 12 Threads 28 49 75% Build Source Tree, 48 Threads 37 55 49%
(片刻之间) 高性能 均衡 三角洲 7拉链,LZMA,2线 55 115 109% 7拉链,LZMA2,12线 28 49 75% 构建源代码树,48个线程 37 55 49%
This started a fascinating thread on power management and the balance between getting good performance from a system (desktop or laptop or server) and wasting power and heat. Here's the best parts of that internal thread here for all of our education.
这为电源管理开辟了一条引人入胜的思路,并且从系统(台式机,笔记本电脑或服务器)获得良好性能与浪费电源和热量之间取得了平衡。 这是我们所有教育领域内在线程中最好的部分。
Bruce Worthington said:
布鲁斯·沃辛顿(Bruce Worthington)说:
Depends on the workload. The full performance of the system is available, but (for example) if the workload is very bursty you will take an initial hit at the beginning of each burst as the power management algorithms determine that more resources need to be brought on line. Or if it is a low-utilization steady state workload, you will run at a lower CPU frequency throughout.
取决于工作量。 可以使用系统的全部性能,但是(例如)如果工作负载非常突发,那么由于电源管理算法确定需要将更多的资源投入使用,您将在每个突发的开始时受到最初的打击。 或者,如果这是低利用率的稳态工作负载,则您将始终以较低的CPU频率运行。
There is no free lunch, so there is always a tradeoff that is being made.
没有免费的午餐,因此总会有一个折衷方案。
There is also an excellent thread on this at ServerFault. Jeff Atwood asks:
ServerFault上还有一个很好的线程。 杰夫·阿特伍德(Jeff Atwood)问:
Our 8-cpu database server has a ton of traffic, but extremely low CPU utilization (just due to the nature of our SQL queries -- lots of them, but really simple queries). It's usually sitting at 10% or less. So I expect it was downclocking even more than the above screenshot. Anyway, when I turned power management to "high performance" I saw my simple SQL query benchmark improve by about 20%, and become very consistent from run to run.
我们的8-CPU的数据库服务器有一吨的流量,但极低的CPU占用率(只是由于我们SQL查询的性质-他们很多,但真正简单的查询)。 通常为10%或更少。 因此,我希望它比上面的屏幕截图还要更慢。 无论如何,当我将电源管理转向“高性能”时,我看到我的简单SQL查询基准提高了大约20%,并且每次运行都变得非常一致。
This makes sense to me. The CPU isn't working hard enough for long enough for the power management algorithms to put full power to the CPU. But, if Jeff sets power management to High Performance he's effectively saying "full speed ahead...always."
这对我来说很有意义。 CPU的工作时间不够长,足以使电源管理算法无法为CPU提供全部电源。 但是,如果杰夫将电源管理设置为“高性能”,那么他实际上是在说“始终保持全速……始终”。
In the last half-decade power management in servers has become more of an issue. With high power comes heating and cooling as well as power costs. Windows Server 2008's default power is "Balanced."
在过去的五年中,服务器的电源管理已成为一个问题。 高功率伴随着加热和冷却以及电力成本。 Windows Server 2008的默认功能是“平衡”。
Bruce again in an excellent explanation with emphasis mine:
布鲁斯再次强调我的出色解释:
I'll try to give a quick perspective below as to why we use Balanced mode as our default and how we arrive at the tunings for that mode.
下面,我将尝试快速介绍一下为什么将“平衡”模式用作默认模式,以及如何实现该模式的调整。
As of Windows Server 2008, the default setting of the OS was switched from High Performance to Balanced. Energy efficiency was becoming a larger factor in the real world, and our ability to balance between the oft-opposing poles of Power and Perf was improving. That being said, there will always be environments where our recommendation is that the power policy should be switched back to High Performance. Anything super latency sensitive will clearly fall into that bucket, such as banking, stock markets, etc.
从Windows Server 2008开始,操作系统的默认设置从“高性能”切换为“平衡”。 能源效率已成为现实世界中越来越重要的因素,并且我们在Power和Perf的对立两极之间保持平衡的能力正在提高。 话虽这么说,在所有环境中,我们的建议都是将电源策略切换回高性能。 任何对超级延迟敏感的事物显然都会落入该类别,例如银行,股票市场等。
OEMs have the flexibility to add custom tunings onto their factory settings if they want to put in the additional effort to find a balance that works better for their specific customers. System administrators also have that flexibility. But tuning the power/perf knobs in the OS is a very tricky business, not for the faint of heart.
<snip…>
Some of us on the Windows "power" teams were performance analysts before we become power analysts, so we are very sensitive to the tradeoffs that are being made and don’t like seeing any perf lost at all. But there is no free lunch to be had, and there are big electric bills being paid (and polar bears falling into the water) that can be helped through sacrificing some level of performance in many environments.OEM可以灵活地将自定义调音添加到其工厂设置中,如果他们愿意付出额外的努力来找到一种对特定客户更有效的平衡方式。 系统管理员也具有这种灵活性。 但是,在操作系统中调整电源/性能旋钮是一项非常棘手的事情,并非出于胆小。 <片段...> Windows“电源”团队中的某些人在成为电源分析师之前是性能分析师,因此我们对正在做出的取舍非常敏感,完全不希望看到任何性能损失。 但是,这里没有免费的午餐,而且要支付大笔电费(北极熊掉入水中),可以通过在许多环境中牺牲一定水平的性能来帮助他们。
<snip>
<snip>
We will continue to provide multiple power policies because one size clearly does not fit all servers.
我们将继续提供多种电源策略,因为一种尺寸显然无法容纳所有服务器。
Another great point made for why have "Balanced" be the default, from Sean McGrane:
Sean McGrane指出了为什么将“ Balanced”作为默认值的另一个要点:
[We're] looking at an industry landscape where servers in data centers are very underutilized, typically somewhere below 20% utilization. By going with balanced mode we saved a lot of energy and cost and improved their carbon footprint more or less for free. There was very strong support from customers to do this.
[我们]正在研究一个行业格局,其中数据中心的服务器利用率非常低,通常利用率低于20%。 通过采用平衡模式,我们节省了很多能源和成本,并或多或少地免费改善了其碳足迹。 客户对此提供了非常有力的支持。
Virtualization has helped raise the utilization levels and most cloud DCs now operate at higher levels of utilization. However the majority of servers deployed are still running a single workload and that will be the case for a while.
虚拟化帮助提高了利用率水平,现在大多数云DC都以更高的利用率水平运行。 但是,部署的大多数服务器仍在运行单个工作负载,这种情况将持续一段时间。
This get to the point of measuring. Are your servers working hard now? Perhaps they'll perform better on High Performance. Are they often idle or at lower levels of utilization? Then Balanced is likely fine and will save power. Test and see.
这样就可以进行测量了。 您的服务器现在在努力吗? 也许他们会在“高性能”上表现更好。 他们是经常闲置还是利用率较低? 然后,“平衡”可能很好,并且可以节省电量。 测试并查看。
As with all things in software development, it's a series of trade offs. If you blindly switch your servers' power options to High Performance because you read it on a random blog on the Internet, you're of course missing the point.
与软件开发中的所有事物一样,这是一系列的权衡取舍。 如果您是在Internet上的任意博客上盲目地将服务器的电源选项切换为“高性能”的,那么您肯定会错过这一点。
Change a variable, then measure.
更改变量,然后进行测量。
Consider your workloads, how your workloads cause your CPUs to idle and how hard they work the CPU when pushed. Are you doing single threaded low CPU work, or massively parallel CPU intensive work?
请考虑您的工作负载,工作负载如何导致CPU闲置以及在推送时它们如何努力工作。 您正在执行单线程低CPU工作还是大规模并行CPU密集工作?
I'm now going to pay more attention to power management profiles when developing, putting machines into production, stress testing and benchmarking. It's nice to have a Turbo Button.
现在,在开发,将机器投入生产,压力测试和基准测试时,我将更加关注电源管理配置文件。 拥有Turbo按钮非常好。
Sponsor: Thank you to RedGate for sponsoring the feed this week! Easy release management: Deploy your .NET apps, services and SQL Server databases in a single, repeatable process with Red Gate’s Deployment Manager. There’s a free Starter edition, so get started now!
赞助商:感谢RedGate本周赞助了这个feed! 轻松的发布管理:使用Red Gate的Deployment Manager在一个可重复的过程中部署.NET应用程序,服务和SQL Server数据库。 有一个免费的简化版,请立即开始!
关于斯科特 (About Scott)
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。
libjpeg-turbo