Tuesday, 10 July 2012

SQL Server 2012 Standard Lock pages in memory behaviour change from SQL 2008

If you have ever seen this message in the SQL log you know you are in big trouble…
A significant part of sql server process memory has been paged out. This may result in a performance degradation.
This is well documented and can be overcome in more recent builds of SQL Server Standard using trace flag 845.
http://support.microsoft.com/kb/970070
I (and many others) had complained about the lack of this feature
http://www.sqlservercentral.com/articles/SQL+Server+2008/64421/
and MS listened. If you set the service account to lock pages in memory and set the trace flag you will be up and running. Make sure you configure Max Memory appropriately! However, having an ‘extra’ switch was something I had become used to and looking on my laptop using SQL Server 2012 RTM which does not have traceflag 845 but does have locked pages in memory configured I saw this message.image

The behaviour in SQL 2012 had changed and always locks pages in memory once the account is configured.
I looked around and indeed this is now documented in a KB article, although I don’t remember reading the behaviour change in any what’s new articles.
http://support.microsoft.com/kb/2659143/en-us?sd=rss&spid=16139

Here is an extract from the KB article with highlighting of the change:
Starting with SQL Server 2012, the memory manager simplifies the usage of "locked pages" across supported editions and processor architectures. In SQL Server 2012, you can enable "locked pages" by granting the "lock pages in memory" user right for the startup account for the instance of SQL Server in Windows. This is applicable for Standard, Business Intelligence, and Enterprise editions of SQL Server 2012 running on both 32-bit and 64-bit processor architectures.

I think this is a step forward, but I also think there should be a configuration option on the memory page to select/deselect the option, and SQL Server should carry out a check that the service account has the correct privileges and maximum memory could be checked for a ‘sensible’ value (a whole story in itself) so the memory configuration screen would be modified and would look something like this…
image
This would remove any ambiguity and make it easier for new users to use this feature.You could argue misuse of this feature could do more damage but I think users should be made more aware of this feature and know how and when to set it.

No comments:

Post a Comment