{"id":963,"date":"2012-06-07T10:11:00","date_gmt":"2012-06-07T10:11:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/windowsserver\/2012\/06\/07\/bing-com-runs-on-windows-server-2012\/"},"modified":"2024-03-08T10:18:50","modified_gmt":"2024-03-08T18:18:50","slug":"bing-com-runs-on-windows-server-2012","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/windows-server\/blog\/2012\/06\/07\/bing-com-runs-on-windows-server-2012\/","title":{"rendered":"Bing.com runs on Windows Server 2012!"},"content":{"rendered":"
Updated 7\/25\/2012:<\/strong><\/em> Microsoft has been running services on the Internet for quite some time now, but things fundamentally changed a few years ago leading up to Steve Ballmer\u2019s famous quote, “This is the bet for the company. For the cloud, we’re all in.” We have all the oars in the boat pulling in the same direction and learning from each other to deliver the best cloud products. We are taking the lessons from running cloud services and feeding them into our products to make them better. During our planning for Windows Server 2012, we spent a lot of time with our cloud services to understand what worked well and where their pain points were. When you run services at the scale we are running things, every little problem gets amplified and every improvement helps enormously. These learnings are translated into dozens and dozens of features in the areas of performance, automating everything, supporting datacenter topologies, continuous availability, and minimizing mean-time-to-detection (MTTD)\/mean-time-to-recovery (MTTR). In today\u2019s blog, Mukul Sabharwal, a software development engineer on the Bing team, describes a few of the features of Windows Server 2012, their effect on the Bing Service, and why Bing is adopting and deploying Windows Server 2012 as fast as they can. As you\u2019ll see, Windows Server 2012 is truly a cloud-optimized operating system.<\/em><\/p>\n With the recent announcement of the Windows Server 2012 Release Candidate (RC), we at Bing.com considered how we might benefit from some of the operating system\u2019s new features. Bing.com is a cloud service that runs on thousands of computers spanning many datacenters across the globe. Performance is a key component in running a successful cloud service such as Bing. Bing serves thousands of user queries every second, and users demand both relevancy and speed in those results.<\/p>\n Our deployment of Windows Server 2012 leveraged four key new features, in particular:<\/p>\n Pre-installed .NET Framework 4.5<\/strong><\/span> Server background GC<\/strong><\/span> This graph of InternalRequestLatency shows the time our application spends doing non-I\/O work. (Just so you know, we set goals around making our 99th percentile faster.)<\/p>\n In the following graph, note that the majority of these gains come from spending less time dealing with the managed memory we create (garbage collecting) as part of servicing a request. (Note that the dates are coordinated with all the graphs in this post.)<\/p>\n Another measure of optimal performance\u2014and an indicator of server health for ASP.NET applications\u2014is the number of requests that are queued in the ASP.NET pipeline. This is shown in the following graph. Note the sharp decline on 5\/25!<\/p>\n Upgrading to Windows Server 2012 can have this same positive impact for your managed applications. Less time spent garbage collecting is more time spent serving user requests. The end result is less latency and better throughput for your services.<\/p>\n Multicore JIT<\/strong><\/span> This feature is already enabled for ASP.NET applications, which makes it trivial to upgrade\u2014do nothing, and let your ASP.NET applications get multicore JIT automatically.<\/p>\n You may be wondering: Why do startup times matter for server-side applications? The hope is that you restart your services only when needed, and at a time of your choosing so that it can be done during off-peak hours. But what if your application crashes?<\/p>\n The case for startup time is critical for service availability. When a service goes down and can recover quickly, it can be the difference between a total system outage vs. a degraded (but functional) experience. This 50 percent reduction in startup time gives our operational staff relief that in case a service goes down, it\u2019ll start back up twice as fast!<\/p>\n Taking call stacks on your production servers<\/strong><\/span><\/p>\n Sample-based profiling in production<\/strong><\/span> We use performance counters as our primary monitoring mechanism, and as the first line of notification to our operational staff. They range from the ones we\u2019ve discussed here (time in GC, and ASP.NET requests queued) to other important ones such as %CPU time and number of exceptions thrown.<\/p>\n Performance counters are extremely valuable for detecting performance degradation because they give insight into operational health. However, they are usually not sufficient to diagnose the \u201croot cause\u201d of a performance problem. So let\u2019s say a performance counter spiked. For example, our %CPU time doubled, which in turn impacted latency. What\u2019s our next step? With Windows Server 2012, our next step is now to enable low-overhead sample-based profiling.<\/p>\n Windows Server 2012 introduces the ability to perform sample-based profiling on 64-bit, JIT-compiled .NET applications via the Event Tracing for Windows (ETW) system. If you\u2019re familiar with ETW, you\u2019ll know that it\u2019s a system-wide service that does not require process restarts; it\u2019s non-invasive (in other words, no attaching to a process), and depending on the events you subscribe to, it also has low overhead: approximately 10 percent CPU cost when profiling is active.<\/p>\n
\nThe .NET team posted a deep dive into the runtime improvements in the .NET Framework 4.5<\/a>, specifically in the CLR Garbage Collector. These are the same improvements that we posted on earlier, which the Bing team saw on Windows Server 2012. It is great to see the .NET team making optimizations that enable server apps to run at cloud scale, using Windows Server 2012.<\/p>\n\n
\nOur rendering tier runs entirely on managed code, relying on the power of the .NET Framework and the accompanying web frameworks, ASP.NET and ASP.NET MVC. One of the primary reasons for writing managed code is the improved developer productivity and run-time safety afforded by the CLR. These also have performance costs; for example, Garbage Collection (GC).<\/p>\n
\n.NET 4.5 introduces Background GC for Server applications<\/a>. Background GC was released in .NET 4 for client-side applications, and it was a hit, which is why we were really excited when Windows Server 2012 brought it to the server. And of course, we were gleeful when we saw the results!<\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
\nAnother great feature that is available in Windows Server 2012 via .NET 4.5 is JIT-compiling by using multiple cores. The feature is a profile-guided optimization; a background thread compiles methods that are likely to be required by the executing thread, and in an ideal case, the application methods are already JIT compiled when they are needed to run.<\/p>\n
\nAnd the startup time improvements, you ask?<\/p>\n
<\/a><\/p>\n
\nAlso new to Windows Server 2012 is the ability to collect call stacks for 64-bit .NET applications that are JIT compiled.<\/p>\n