Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

SQL Server world: Learning and Sharing my experience & knowledge ....
Browse by Tags · View All
sql server 51
best practices 39
#SQL Server 28
dba 25
BRH 19
beginners 17
download 15
#TSQL 15
dba practices 9
#DBA 9

Archive · View All
September 2010 13
August 2011 5
October 2010 5
November 2011 4
October 2011 4
May 2011 4
February 2011 4
November 2010 4
January 2012 3
July 2011 3

SQL Server Performance series: Trace Flag 845 and Lock Pages in Memory - what to do and how to?

Nov 24 2011 10:36PM by Satya Jayanty (@sqlmaster)   

Recently I have been involved on a performance tuning consulting project that resulted in heavy paging and incorrect memory settings on the environment, also a  discussion about trace flags 845 lead to explain the information about the requirement and necessity in case of 32 bit and 64 bit environments. 

The Lock Pages in Memory has gained importance since version 2005 due to the fact that 32-bit and 64-bit environments are managed. As you may be aware it was only available in Enterprise and Developer editions, since CU4 for SQL Server 2005 SP3 and CU2 for SQL Server 2008 SP1 it is enabled as a trace flag 845 for Standard Edition environment too.

Lock Pages in Memory policy is required to enable AWE for SQL Server engine, which is applies to only 32-bit  and Analysis Services cannot take advantage of AWE and also if the available physical memory is less than user mode VASthen AWE cannot be enabled. Although this is not required in 64-bit systems it is ideal to enable on these kind of enviornments too  to optimize system memory use for SQL Server. The Lock Pages in Memory policy determs which account can use the process to keep the data in memory (physical) preventing the system from paging the data to virtual memory on the disk, by default this is OFF. In general the policy can set using Windows Group Policy tool (GPEDIT.MSC) to assign the permission to the account that is used to start SQL Server services. As per BOL to enable the Lock Pages in Memory option, see  How to enable "Lock pages in Memory" at the Windows level:

  • On the Start menu, click Run. In the Open box, type gpedit.msc. The Group Policy dialog box opens.
  • On the Group Policy console, expand Computer Configuration, and then expand Windows Settings.
  • Expand Security Settings, and then expand Local Policies.
  • Select the User Rights Assignment folder. The policies will be displayed in the details pane.
  • In the pane, double-click Lock pages in memory.
  • In the Local Security Policy Setting dialog box, click Add.
  • In the Select Users or Groups dialog box, add the account that runs the SQL Server Service.
  • Restart the machine for these changes to take effect.

As referred above this is available for Enterprise edition (production) and Developer editions, for Standard Edition systems you need to use Trace Flag 845 as a startup trace flag. Here are the steps to follow in such cases:

  • Obtain the current build number of SQL Server using SELECT @@VERSION command and ensure that it is 10.00.2714.00 (SQL Server 2008) and/or 9.00.4226 (SQL Server 2005).
  • Then set the trace flag 845 as startup trace flag using SQL Server Configuration Manager, obviously you must restart SQL Server services to affect this change.
  • If in case the existing SQL Server build number is lower than that are specified above you will not be able to set this trace flag, that may result failure of starting specific SQL Server services.
  • For this reason the Cumulative Update packages have provided this feature, however if the SQL Server 2005 is patched upto Service Pack 4 (SP4) or SQL Server 2008 SP2 then you can follow the above steps.
  • To ensure whether the change is affected you will need to observe Using locked pages for buffer pool entry in SQL Server error log once it is restarted.

Further for SQL Server 2008 R2 Standard Edition (64-bit) also requires trace flag 845 to be added as a startup parameter so that SQL Server can use locked pages for the Buffer Pool when the SQL Server service account is granted the Lock Pages in Memory security privilege. 

Nevertheless, it is essential to test these settings on Development environment thorougly before you proceed on Production instance as these changes on Standard Edition may produce negative performance affect due to the changes to the system settings for the services. Also it is best to go through the information such as: How to configure SQL Server to use more than 2 GB of physical memory  and Enabling Memory Support for Over 4 GB of Physical Memory links. In some occassions you may get negative performance in 64-bit environment too so better to read on about How to reduce paging of buffer pool memory in the 64-bit version of SQL Server  and options on SQL Server Working Set Trim Problems? - Consider.... Finally the information about support on this trace flag and policy setting go through Support for Locked Pages on SQL Server 2005 Standard Edition 64-bit systems and on SQL Server 2008 Standard Edition 64-bit systems link.

Tags: best practices, dba, sql server, performance monitoring, security, beginners, lock pages in memory,


Satya Jayanty (@sqlmaster)
34 · 5% · 1720
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]