﻿<rss version="2.0">
  <channel>
    <title>My Blog</title>
    <link>http://www.jasongerrish.com/blog.html</link>
    <description>My Blog</description>
    <item>
      <title>Choosing the right Server Performance Options (Application versus Background Services)</title>
      <description>&lt;table cellpadding="0" cellspacing="0" border="0" id="tabcolumn-1" style="width: 100%; margin-bottom: 15px"&gt;&lt;tr&gt;&lt;td&gt;&lt;div id="column-1" usermodifiable="true" style="width: 100%"&gt;&lt;div id="ctrl-1635754"&gt;I've seen much conflicting information about what choice to make regarding the Processor Scheduling option under Advanced System&amp;#160;Properties \ Advanced Performance Options \ Processor Scheduling on a Windows Server.&amp;#160; I wanted to get to the bottom of this for a&amp;#160;dedicated SQL Server.&amp;#160; Having spent 10 + years as a Manager/Senior Production DBA in high OLTP environments (&lt;a href="http://monster.com/" target="_blank" class="userlink"&gt;Monster.com&lt;/a&gt;,&amp;#160;&lt;a href="http://vistaprint.com/" target="_blank" class="userlink"&gt;VistaPrint.com&lt;/a&gt;, etc.), I figured I could wade through the large volume of forums/blogs/articles and decipher the frequently ambiguous&amp;#160;and sometimes incorrect information.&amp;#160; What I typically found was conflicting information based on simplistic approaches and a lack of&amp;#160;understanding of exactly what these memory options actually do.&amp;#160; Choosing this memory option is important and shouldn't be made based on&amp;#160;whether you run &amp;quot;applications&amp;quot; or &amp;quot;services&amp;quot;...of which people disagree about which there program even is.&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635757"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635759"&gt;First, here's some background on the components involved in determining the correct choice for Processor Scheduling.&amp;#160;&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635760"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635762"&gt;1) The Windows Scheduler&amp;#160;The Windows scheduler is a preemptive scheduler that prevents a single thread from monopolizing a processor/server.&amp;#160; Each Windows thread&amp;#160;gets a specified time slice in which to run, after which Windows automatically schedules it off the processor and allows another thread&amp;#160;to run if one is ready to do so.&amp;#160;&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635763"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635765"&gt;Regarding whether one should choose Application versus Background Services, we first need to understand what they mean.&amp;#160;&amp;#160;The Windows Scheduler uses time units called &amp;quot;Quantums&amp;quot; to slice time into pieces that it allows threads to occupy a processor and&amp;#160;perform work.&amp;#160; Once a thread completes its allowed quantums (slice of time) on a processor, Windows switches that thread off the&amp;#160;processor and allows another thread to perform work for the allowed quantums; this thread change is called a &amp;quot;context switch&amp;quot;.&amp;#160; context&amp;#160;switching prevents a CPU-bound process from monopolizing the processor(s).&amp;#160; Currently in Windows, 3 quantums are equal to either 10&amp;#160;milliseconds (single processor) or 15 milliseconds (multiple-processor Pentium).&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635766"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635768"&gt;Time slices are fixed at 36 quantums (approximately 180 ms) on multi-processor servers when &amp;quot;Background Services&amp;quot; is selected (this&amp;#160;applies to both foreground applications and background processes).&amp;#160; The time slice drops to 120 ms on single-processor boxes.&amp;#160; When&amp;#160;&amp;quot;Programs&amp;quot; is selected, quantums are no longer fixed at 36, but vary depending on the thread type.&amp;#160; Background tasks receive 3 quantums&amp;#160;(10-15 ms) and foreground tasks (applications) receive 9 quantums (30-45 ms).&amp;#160; So we see how the &amp;quot;Applications&amp;quot; choice actually takes&amp;#160;effect...forground applications get 3X the time slice each time they are switched into an active state on a processor.&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635769"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635771"&gt;When we choose &amp;quot;Background Services&amp;quot;, 36 quantums of time are given whether the thread is foreground or background.&amp;#160; Windows takes this&amp;#160;approach for &amp;quot;Background Services&amp;quot; because background processes are assumed to have fewer threads than applications and would be more&amp;#160;efficient with more CPU time between context switches.&amp;#160; Interactive programs are assumed to be more efficient (and appear more&amp;#160;responsive) with shorter time slices because they are assumed to use more active threads.&amp;#160; This allows them to respond more quickly to&amp;#160;things (like keyboard input and mouse movement).&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635772"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635774"&gt;So...which one is better for SQL Server?&amp;#160; Well...if you have a dedicated SQL Server box (no user applications running)...it matters only&amp;#160;a little.&amp;#160; Let's talk about a cool little thing called the SQL Server User Mode Scheduler (UMS in SQL 7/2000, SQL OS [SOS] in SQL 2005).&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635775"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635777"&gt;2) User Mode Scheduler(UMS/SOS)&amp;#160;UMS/SOS sits between the SQL Server and the operating system.&amp;#160; Its primary function is to keep as much of the scheduling process as&amp;#160;possible in control by SQL Server.&amp;#160; When SQL Server starts, one UMS scheduler is created for each processor in the machine.&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635778"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635780"&gt;We learned that the windows scheduler is preemptive and context switches occur based on time.&amp;#160; The SQL Scheduler uses &amp;quot;cooperative&amp;quot;&amp;#160;scheduling which means it relies on threads to yield voluntarily.&amp;#160; This prevents context switching by allowing threads to complete work&amp;#160;before getting switched off a processor automatically based on time slices.&amp;#160; Why does this perform better and scale better than using&amp;#160;the Windows Scheduler?&amp;#160; Because SQL Server knows its own scheduling needs better than Windows.&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635781"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635783"&gt;You might be wondering how the SQL UMS/SOS keeps the Windows Scheduler from context switching all the UMS/SOS controlled SQL threads?&amp;#160;&amp;#160;It does this by tricking the windows scheduler into ignoring all but 1 thread at a time from the many threads connected to the processors&amp;#160;from SQL's UMS/SOS.&amp;#160; Each UMS/SOS thread has an associated event object and Windows Scheduler ignores any with the type&amp;#160;&amp;quot;WaitForSingleObject&amp;quot; with a timeout of &amp;quot;INFINITE&amp;quot;.&amp;#160; UMS/SOS keeps all but 1 thread in this state per processor so only 1 thread is&amp;#160;active on a processor at any given time...allowing the thread to complete its work without being context-switched off the processor by&amp;#160;windows scheduler.&amp;#160;&amp;#160;&lt;/div&gt;&lt;div id="ctrl-1635784"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-1635786"&gt;So, while the Windows Scheduler is switching active threads on and off each processor, SQL UMS/SOS is deciding which 1 SQL thread is&amp;#160;getting processed.&amp;#160; This keeps the number of SQL threads available for context switching on a processor to 1.&amp;#160; It is true that Windows&amp;#160;still needs to context switch other non-SQL internal/background threads on and off...so active SQL threads don't get 100% of the CPU&amp;#160;time and are still subject to context switching.&amp;#160; However, there should be relatively few other active background threads on a dedicated&amp;#160;SQL Server compared to an Application server.&amp;#160; Also, choosing background services for the advanced memory parameter will keep those SQL&amp;#160;threads processing in longer (36 quantum) time slices versus getting context switched at 3 quantums.&amp;#160;&amp;#160;&amp;#160;So, with no foreground applications running, and in the &amp;quot;Application&amp;quot; scheduler mode, SQL threads will context switch more frequently&amp;#160;when other background processes are active.&amp;#160; With no foreground applications running, and in the &amp;quot;Background Services&amp;quot; mode, SQL threads&amp;#160;will context switch less when other background services are active.&amp;#160; In either scenario SQL threads receive the same processing time,&amp;#160;but experience different frequencies of context switching.&amp;#160; Context switching utilizes system resources and, therefore, should be&amp;#160;reduced if at all possible.&amp;#160; Choosing &amp;quot;Background Services&amp;quot; on a dedicated SQL Server makes sense even if there are not many other&amp;#160;background processes running; it reduces context switching and, therefore, increases available system resources for SQL Server.&amp;#160;&lt;/div&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

</description>
      <link>http://www.jasongerrish.com/blog/2011/07/13/Choosing-the-right-Server-Performance-Options-Application-versus-Background-Services.aspx</link>
      <creator xmlns="http://purl.org/dc/elements/1.1/">Jason A Gerrish</creator>
      <pubDate>07/13/2011 08:25:00</pubDate>
      <guid>http://www.jasongerrish.com/blog/2011/07/13/Choosing-the-right-Server-Performance-Options-Application-versus-Background-Services.aspx</guid>
    </item>
    <item>
      <title>G Force Data Partners With MozyPro for Offsite Backups</title>
      <description>&lt;table cellpadding="0" cellspacing="0" border="0" id="tabcolumn-1" style="width: 100%; margin-bottom: 15px"&gt;&lt;tr&gt;&lt;td&gt;&lt;div id="column-1" usermodifiable="true" style="width: 100%"&gt;&lt;div id="ctrl-2083215"&gt;G Force Data is proud to announce that it has partnered with MozyPro as an authorized reseller to provide our customers with a secure, encrypted, offsite backup solution. &amp;#160;This offering expands the disaster recovery portfolio of solutions that G Force Data offers. &amp;#160;&lt;/div&gt;&lt;div id="ctrl-2083216"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-2083218"&gt;Customers can now safely and securely maintain an encrypted offsite copy of their data for recovery in the event of disaster.&lt;/div&gt;&lt;div id="ctrl-2083219"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-2083221"&gt;Please contact Jason Gerrish at 978-9885-6423 or support at support@gforcedata.com for details and pricing.&lt;/div&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

</description>
      <link>http://www.jasongerrish.com/blog/2011/06/22/G-Force-Data-Partners-With-MozyPro-for-Offsite-Backups.aspx</link>
      <creator xmlns="http://purl.org/dc/elements/1.1/">Jason A Gerrish</creator>
      <pubDate>06/22/2011 07:16:00</pubDate>
      <guid>http://www.jasongerrish.com/blog/2011/06/22/G-Force-Data-Partners-With-MozyPro-for-Offsite-Backups.aspx</guid>
    </item>
    <item>
      <title>G Force Data Now Supports Monitoring for SQL Express</title>
      <description>&lt;table cellpadding="0" cellspacing="0" border="0" id="tabcolumn-1" style="width: 100%; margin-bottom: 15px"&gt;&lt;tr&gt;&lt;td&gt;&lt;div id="column-1" usermodifiable="true" style="width: 100%"&gt;&lt;div id="ctrl-16160319"&gt;G Force Data, Inc. is proud to introduce the SQL Monitor service for clients using SQL Server Express Edition!&amp;#160;&lt;/div&gt;&lt;div id="ctrl-16160320"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-16160322"&gt;While G Force Data has always supported monitoring and remote DBA services for SQL Server Standard and Enterprise Editions, we have recently upgraded our offerings to include SQL Server Express Edition. &amp;#160;SQL Express is the free version of SQL Server that has limitations that make our SQL Monitor service even more critical for your databases.&lt;/div&gt;&lt;div id="ctrl-16160323"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-16160325"&gt;SQL Express doesn't include the built-in backup procedures that the other versions have. &amp;#160;With the SQL Monitor service from G Force Data, we can remotely initiate a backup of your databases...ensuring you can recover your data from typical disasters.&lt;/div&gt;&lt;div id="ctrl-16160326"&gt;&lt;br&gt;&lt;/div&gt;&lt;div id="ctrl-16160328"&gt;Please consider contacting us to discuss how this service can give you the peace of mind knowing your data is protected.&lt;/div&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

</description>
      <link>http://www.jasongerrish.com/blog/2011/05/25/G-Force-Data-Now-Supports-Monitoring-for-SQL-Express.aspx</link>
      <creator xmlns="http://purl.org/dc/elements/1.1/">Jason A Gerrish</creator>
      <pubDate>05/25/2011 12:03:00</pubDate>
      <guid>http://www.jasongerrish.com/blog/2011/05/25/G-Force-Data-Now-Supports-Monitoring-for-SQL-Express.aspx</guid>
    </item>
  </channel>
</rss>
