Scott Hanselman

The New Turbo Button - Balancing Power Management and Performance on Windows Servers

September 17, '13 Comments [20] Posted in Musings
Sponsored By

TurboButtonDo 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.

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. 

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:

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.

Here's a very basic benchmark Mike did:

Hardware/OS
Hardware: HP z420, Intel Xeon E5 1650 @ 3.2GHz, 32GB RAM, SSD
OS: 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%

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:

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.

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:

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.

imageThis 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."

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."

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.

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.

<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:

[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.

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.

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.

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?

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.


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!

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.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Teaching Kids Electronics, Computers, and Programming Fundamentals with Snap Circuits

September 13, '13 Comments [33] Posted in Daddy | Parenting | Programming
Sponsored By

I'm not particularly interested in my kids being programmers or computer people. I'd rather they be interested in life and totally geeked about something. If that's  computers, fine. If that's ballet, also fine.

That said, I think if they are going to be effective users (If not builders) I think they should have a basic sense of how electronics work.

I bought them a basic set of Snap Circuits, specifically Snap Circuits Jr. SC-100, which is just about US$20 on Amazon.

These are brilliant. Check this picture, as it's worth a thousand words and you'll get its genius immediately.

Snap Circuits SC-100

The 5 year old loves the motor and fan, as well as the speaker and noise makers. The boys have made doorbells, a light-controlled fan, lit-up LEDs and made an AM radio. Here's an Instagram Video of the 5 year old explaining his creation:

The pieces snap onto the grid with little buttons. The pieces are plastic and the wires run through them. They're not extremely resilient, in that they can break, particularly the capacitors, but it's actually nice to be able to see the resistors and other parts exposed through the plastic. It strikes a reasonable balance between being friendly to little hands, being sturdy, and actually working reliably as electronic components.

WP_20130912_18_01_15_Pro

The 5 year old is no prodigy, to be clear, but he's already getting a general sense of electrical movement. He'll say that the resistors "slow down the electricity" and that the capacitors "store it up." He knows positive and negative, and how to use a multimeter to measure voltage. (I recommend a $10 multimeter as well for debugging your projects.) He's starting to look at doorbells and remote controls differently now, which means these little projects have already achieved my goal in just a few weeks. I anticipate they'll play with them for some months, forget about them, and then rediscover Snap Circuits every few years. These toys are great for a 5 or 6 year old, but even a 12 to 14 year old could totally appreciate them. I'm even running through some of the experiments and using the millimeter to remind myself of long-forgotten concepts.

We quickly outgrew the 30 parts in the Snap Circuits Jr. Even though it has 100 projects, I recommend you get the Snap Circuits SC-300 that has 60 parts and 300 projects, or do what we did and just get the Snap Circuits Extreme SC-750 that has 80+ parts and 750 projects. I like this one because it includes a computer interface (via your microphone jack, so any old computer will work!) as well as a Solar Panel.

The Snap Circuits SC-750 is a bargain at prices like US$75 if you can find it, especially considering how many tablets, Kindles and iPads some kids have.

WP_20130910_19_23_04_Pro

The next Snap Circuits kids we're considering are either Snap Circuits "Light" that includes LEDs and Fiber Optics, although the 5 year old is pressuring me for the Snap Circuits Robot Rover. It'll likely be the Rover for the holidays around here.

I have no relationship with Snap Circuits, I bought these kits on my own and am reviewing them because they are awesome. If I could invest in Elenco Electronics, I would. The links here are Amazon affiliate links. If you use them, I can buy more Snap Circuits! ;)


Sponsor: Big thanks to Infragistics for sponsoring the feed this week! Download Your Free HTML5/jQuery Grid:  Prepare to launch eye-popping, performance-driven HTML5 applications with Ignite UI. Believe your eyes - you can download the world's fastest, most reliable jQuery Grid now - no strings attached!

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.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Trying a Nokia Lumia 1020 - A Camera with a Phone Inside

September 10, '13 Comments [50] Posted in Reviews | WinPhone
Sponsored By

My current Lumia 1010 tile layoutI've had an iPhone since the iPhone 3G. My main personal phone is an iPhone 4S. I'm always checking out new phones, however, most recently the Blackberry Z10. The last time I tried a Windows Phone was a Lumia 800, where I made a list of apps I would need before I would ever consider switching from iPhone. I also checked out one of the first Windows Phones in 2010.

My family is a mixed one, with two iPads, my wife's Lumia 920 phone, my iPhone 4S, the kids' iPod touches, a Surface RT, an Xbox and a PS3. I'm also spending a month testing a Samsung Galaxy S4.

However, last week a buddy loaned me a yellow Nokia Lumia 1020 running Windows Phone 8. A good friend recently switched to the 1020 solely for the camera. Let me repeat that. He has been #teamiphone since the beginning but he decided the camera was good enough to switch. That got my attention as my 4S camera kinda sucks. It's fine for Instagram but not for capturing two growing kids.

I swapped the SIM card from my iPhone and customized the crap out of my home screen. I can't stand defaults. Live Tiles really are the star of the Windows Phone.

I'll do a full review when I've spent time with this phone, but I can talk about the camera now. Insane.

Full sized images are 7712x4352 and about 10 megs. The deal, it seems, isn't that you necessarily want to  keep the 34 megapixel images, but rather that you can zoom and crop them and still see thing clearly. Phrased differently, rather than an optical zoom, you take a super super high res image then digitally zoom. It's amazing. You can zoom in on a license plate from 100 feet away.

Here's an example (I've blurred these people as I don't know them).

A picture at a cafe

Now, zooming in on the red car, digitally.

Zoomed way in on a license plate

That's just a silly example. A more significant one is taking a picture of a group, then wanting to crop a shot of just some of the people and having it NOT looking like a crappy crop. These kind of operations are trivial.

If you want to download the full 10 megabyte version of this image, I put it up on Azure Storage here and if you like, zoom around it on Zoom.It.

Here's the original file, copied straight off the Lumia 1020 via a USB Cable.

Lego Jabba

Let's zoom in - only by cropping.

Jabba's buddy close up

Seriously, I could do this all day.

LEGO Hobbit

And then cropping.

LEGO Hobbit close up

I also tried the Camera Grip for the Lumia 1020. It's an extended battery, grip and a button that makes the phone act more like a camera. You get the whole half-button press to focus" then "full press to snap" behavior. This also speeds up the shutter actuation feel to instantaneous, since the half-squeeze starts the focus. The continued full press is instant. It really feels like a Point and Shoot.

Disclaimer/Disclosure: I do work for Microsoft, in the Azure division. However, I am not my job. I review lots of tech and gadgets and I stand on my record of impartiality. I use what I like. This review (and future and past) is my own, and done on my own, outside of work. No one reviews or edits these. Misspellings and errors are mine.

The Nokia Lumia 1012 Camera Grip

I'll keep trying it out and explore the actual phone features, but I am deeply impressed with the camera. In order to consider switching though (and I assume you'd feel the same way) I would need:

  • 95% of the apps (or equivalents) that I use in an average week.
  • Reliable Bluetooth phone and audio in the cars my wife and I have
    • Streaming audio works fine in my Prius. Having some trouble with the phone, but working on it.
  • Good battery life
    • It's OK, but the camera flash definitely hurts the battery if you spend all day taking pics.
  • Support for Google Mail and Calendar (personal) and Outlook (work)
    • Check.

More review and details to come as I explore. Your thoughts?


Sponsor: Big thanks to Infragistics for sponsoring the feed this week! Download Your Free HTML5/jQuery Grid:  Prepare to launch eye-popping, performance-driven HTML5 applications with Ignite UI. Believe your eyes - you can download the world's fastest, most reliable jQuery Grid now - no strings attached!

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.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Visual Studio 2013 RC for Web Developers - One ASP.NET, Browser Link, and our Direction

September 9, '13 Comments [80] Posted in ASP.NET | VS2013
Sponsored By
Browser Link connects the IDE and Browser

ASP.NET and Web Tools for VS2013RC is out today. You can feel free to install it over the top of VS2013 Preview if you like. That's what I did.

Be sure to check out http://www.asp.net/vnext for release notes and docs, as well as updated tutorials. There will be a lot more docs and videos coming, as well as details on how to extend and use everything. Since this is the Release Candidate (rather than the final release) there's still some work to be done.

One of my favorite features, and a feature that I think is the most representative of the direction we are going, is Browser Link and best of all, its extensibility model.

For example, you remember how you can select Browse With, and set multiple browsers as your default browser? (Some folks haven't noticed that feature yet) Here I've made a regular side and selected IE and Chrome as my defaults with the Browse With dialog (hold Ctrl for multi-select within Browse With).

image

Now, Ctrl-F5 to launch both browsers:

image

Notice that Bootstrap is the default template now. We'll have Bootstrap 3.0 for the final release.

I'll change some text in the Index.cshtml. Hover over the Browser Link button in the toolbar:

image

It knows two browsers are talking to VS using SignalR and JavaScript. No magic, just web standards.

Now, you can type code and html and press Ctrl+Alt+Enter to refresh all connected browsers, or you can click Browser Link Dashboard:

image

Here's the dashboard. I've clicked on IE:

image

Even more interesting, is that Browser Link is itself extensible.

That menu in the Browser Link Dashboard where we're talking to a specific browser? You can add things to that. Mads Kristensen has done just that with Web Essentials and added extensions to Browser Link (Make sure to get the VS Web Essentials 2013 RC build, or you can build it from source!)

Here's what the Browser Link Dashboard looks like with a Browser Link Extension installed. See the added menu items?

image

Aside: Note also the Error List, we can add a new class of error in VS and even fix them with a double-click.

image

If I click Design Mode, check out what happens. The "Design Surface" potentially moves to the browser itself, using JavaScript, but with bi-directional communication between VS and the browser.

Remember that Web Essentials is open source, so I can get an idea of what's going on by reading the source. Without getting too deep, I can look at Inspect Mode and see it's using MEF.

[Export(typeof(BrowserLinkExtensionFactory))]
[BrowserLinkFactoryName("InspectMode")] // Not needed in final version of VS2013
public class InspectModeFactory : BrowserLinkExtensionFactory
{
...
}

And that is a list of actions:

public IEnumerable<BrowserLinkAction> Actions
{
get
{
yield return new BrowserLinkAction("Inspect Mode", InitiateInspectMode);
}
}

And that it's using SignalR to talk to injected JavaScript:

private void InitiateInspectMode()
{
Clients.Call(_connection, "setInspectMode", true);
_instance = this;
}

And I can see in the browser's JavaScript that as I hover over elements in the browser, I can select the source in VS and even bring VS to the front:

inspectOverlay.mousemove(function (args) {
inspectOverlay.css("height", "0");

var target = document.elementFromPoint(args.clientX, args.clientY);

inspectOverlay.css("height", "auto");

if (target) {
while (target && !browserLink.sourceMapping.canMapToSource(target)) {
target = target.parentElement;
}

if (target) {
if (current && current !== target) {
$(current).removeClass("__browserLink_selected");
}

current = target;
$(target).addClass("__browserLink_selected");
browserLink.sourceMapping.selectCompleteRange(target);
}
}
});

inspectOverlay.click(function () {
turnOffInspectMode();

browserLink.call("BringVisualStudioToFront");
});

This is just a taste of what's coming. One ASP.NET is a journey, not a destination. We'll have more refinements, more scaffolding, and continued improvements as we head in this directions and in future updates (Update 1, etc).

Browser Link is just one feature, be sure to check out (and subscribe to) the Web Dev Blog where ASP.NET and Web Tools lives on MSDN. Today's post talks about:

  • One ASP.NET
  • Authentication
  • The new HTML5 editor
  • Azure Web Site tooling
  • Scaffolding
  • MVC5, Web Forms, SignalR 2, Web API 2
  • Entity Framework 6
  • OWIN Support and Self-Hosting
  • ASP.NET Identity
  • NuGet 2.7

Remember, even though it feels like a lot, these are almost all additive changes that you can take or leave. You can still make and develop ASP.NET 2 apps in VS 2013. You can use your own View Engine, your own ORM, your own Identity, you own Scaffolding, your own components. You decide.

image

We'll have docs and updates soon for scaffolding, modifying and customizing File New Project to add your own, as well as a list of what's new and released as NuGet packages. Watch http://www.asp.net/vnext and the Release Notes for lots of details and any breaking changes.


Sponsor: Big thanks to Infragistics for sponsoring the feed this week! Download Your Free HTML5/jQuery Grid:  Prepare to launch eye-popping, performance-driven HTML5 applications with Ignite UI. Believe your eyes - you can download the world's fastest, most reliable jQuery Grid now - no strings attached

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.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

A month with an Intel Haswell prototype

September 6, '13 Comments [19] Posted in
Sponsored By
haswell

Intel sent me a Haswell Developer Prototype Ultrabook to review a little over a month ago. In order to effectively review this, given my experience, I need to separate the Haswell Chipset and Processor from this specific machine that they send folks to review.

I did not receive a very good unit - definitely not one ready for production.

Now, to be fair, it's marked as an "Intel Software Development Platform" prototype. This is not a machine that will ever be built, and it's also (they tell me) still getting drivers developed. It's a fairly regular looking gunmetal Ultrabook with no markings other than the Intel and Ultrabook logos. It's a lot like my Lenovo X1 Carbon Touch except it has a 1080p (vs. 900) screen and it's a Haswell. This review platform is a new i5 vs. last year's i7 in my X1.

Last year I looked at the 3rd gen "Ivy Bridge" ultrabooks and was impressed. So impressed that I eventually bought a Lenovo X1 Carbon Touch:

First: This particular Haswell Reference Platform device

This year's Haswell review unit has been nothing but trouble for me. Such trouble, in fact, that they've sent me THREE separate laptops as the first two both were unacceptable for different reasons. The first laptop had the SSD fail completely within a week. The second laptop had a bad Synaptics touchpad where only the right side worked. While the third one is workable, it turns off randomly, doesn't want to support standby/sleep and has a wonky keyboard with an unreliable "A" key.

Again, they're reference review laptops, but let's just say they aren't production quality Lenovo X1s or MacBook Airs. To be very frank, these not-ready review/prototype laptops and the experience I have had with them actively do the product a disservice. I'm sure Haswell as a platform is lovely and I would like to see how a Haswell-enabled system makes my life as a developer better. However, in order to do that I expect the mouse to work, the Bluetooth to be reliable and for the screen to stop rotating to the left without warning (even though I keep setting auto-rotate off.)

With the Ivy Bridge reference platform I saw constant and consistent improvements in system behavior with regularly updated drivers. With this Haswell reference platform I have seen just one driver drop, been told to not upgrade to Windows 8.1, and only updated the BIOs once. I have no idea if this device will ever become usable in the future because I have no communication or indication when new drivers are coming.

Second: Using Haswell every day...and the power promise

Ok, now that that's over. I've been using this every day running Windows 8 and have presented at two conferences with this device. I've run both VS2012 and VS2013 on it.

Even though Windows 8.1 does away with the WEI (Windows Experience Index) and I think that's a shame as it's a totally useful and built-in way to get a sense of how a computer will perform, I'm running Windows 8 on this Haswell machine and can still run it.

Surprising new device gets almost an identical WEI as my Lenovo X1 differing significantly only in memory ops/sec. I've heard this elsewhere that an i5 Haswell can perform as well as an Ivy Bridge i7 *and* with a much improved power profile. Haswell isn't (to me) about pure speed, it's about speed, power, and lightness.

image

This is very light laptop. As my second laptop around 3lbs it's cemented my conviction that I'll never own a big heavy luggable laptop again. There's just no reason for a 10 pound device anymore.

Performance, however, does seem dramatically different when on batteries. It appears to be extremely aggressive trying to saving power. This is definitely a laptop where changing Power Profiles makes a huge difference.

The greatest difference in how long this device will last has been screen brightness. When I'm on Power saver on the lowest brightness, I could get a full work day out of this device. However, the lowest brightness is just not feasible. I got between 6 and 7 hours with brightness at about one-third.

balanced-power

Switching to the Balanced Profile with the brightness at the level where Windows warns you it might be a problem, I got about 5 to 6 hours of typing.

power-power2

It's getting to around half-battery where you start getting uncomfortable and wondering if you're going to make it. Changing brightness and profile can get you an easy extra hour on Haswell, where it's just been a matter of 15-20 minutes (in my experience) on other devices.

power-balance power-power

Does Haswell deliver the all-day battery laptop?

  • Yes, if you write prose for a living.
  • Yes, if you aren't running at full brightness.
  • Yes, if you work in SSH or VIM and a remote Linode machine is actually doing the work while your Haswell waits.
  • No, if you're writing and compiling a 3D game locally.
  • No, if you're playing Steam and running TorchLight II.

Should you get a Haswell machine? Absolutely. If you're in the market for a machine and there's a Haswell version of your favorite coming soon, wait. You'll get the same speed and better battery life. Maybe not all day, but 50% more than before. I'm looking forward to the refreshed Lenovo T and X series to have Haswell on board.

All day power? My expectations perhaps aren't reasonable. Haswell and aggressive power management is the future, no doubt. I think, however, that it will be a combination of this plus improvements in battery density that will finally give me a 24 hour device (or 8 hours working hard at full brightness).

ASIDE: From a reviewer perspective, while it's always fun to answer the "what laptop is that?" question with "it's an Intel prototype," the folks at Intel should, when possible, loan reviewers machines that are closer to production that don't have all these driver quirks and hardware quality issues. Why? Well, I really value the opportunity to to review new and prototype hardware, the question always comes up...am I reviewing the keyboard and mouse and screen or am I reviewing the chipset and processor. Of course, there's drivers to hold it all together. This review unit has a loud fan, and iffy construction. But, it has great speed and I didn't think about memory once even though I was running only 4 gigs. I was able to run multiple instances of VS, Outlook and many browsers without even a thought. Even two Virtual Machines and it still felt fast.

I want to get my hands on a device like a Lenovo Yoga 2 Pro or a Thinkpad Yoga. These Haswell devices are going to rock. I have extremely high hopes, but rest assured, your next machine is a Haswell.


Disclosure of Material Connection: Intel sent me this Haswell Ultrabook in the hope that I would review it on my blog. Regardless, I only recommend products or services I would use and think you would find useful. This opinions are mine and mine alone as is this entire post. I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255: Guides Concerning the Use of Endorsements and Testimonials in Advertising.

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.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.