March 18, 2013 at 9:55 am
What can I do to prevent SQL from paging out its memory?
Situation:
I receive calls about SQL App being slow.
event viewer shows
A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 57040, committed (KB): 1608152, memory utilization: 3%%
Memory monitor shows just over 4 gb still free.
graph shows memory available.
March 18, 2013 at 10:40 am
What is current settings of your SQL Server (max server memory)?
March 18, 2013 at 10:47 am
SQL doesn't page out it's own memory. The OS may page SQL out if its under memory pressure. Older versions of the OS (Server 2003) were more agressive about this, later versions are a lot less prone to page SQL out.
You can enable locked pages, but then make very sure you're leaving enough memory for the OS.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 18, 2013 at 12:16 pm
Our max server memory was unlimited. Consultant said he limited max server memory for another client with a similar issue.
After this discussion, I set max server memory to 1.5 gb. But the problem reoccurred today.
I may need to keep tweaking this setting. it confuses me why windows would page out the memory when 4gb is free. 6 gb total memory in the server.
i'll look into if we can set lock pages for this server. I'll need to confirm capatibility with the software vendor.
We may consider upgrading the server. We were trying to hold off until we upgraded the vendor software too.
March 18, 2013 at 12:54 pm
32 or 64 bit SQL Server?
Server 2003 will do this to SQL 2005 quite a bit on some systems, and on others it's not an issue. It depends on what else is running and is difficult to predict which systems might be affected. The issue has mostly disappeared with Server 2008 running SQL 2008, and newer setups.
For your case, enabling 'locked pages in memory' (LPIM) is the way to go and is transparent to existing SQL Server operations. Before enabling LPIM set 'max server memory' very conservatively at first and then monitor the 'available megabytes' perfmon counter closely to ensure Windows always has enough free memory thoughout the normal working cycles (day, week, month, etc.). If Windows suddenly requires more memory, with LPIM enabled SQL Server will not return it on request because its pages are locked. In this scenario you can start seeing overall system stability issues which is far worse than Windows simply trimming SQL Server's working set.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 18, 2013 at 4:40 pm
foscsamuels (3/18/2013)
Our max server memory was unlimited. Consultant said he limited max server memory for another client with a similar issue.After this discussion, I set max server memory to 1.5 gb. But the problem reoccurred today.
You absolutely should set max server memory. What you should set it to is another matter, there's a good discussion in chapter 4 of http://www.simple-talk.com/books/sql-books/troubleshooting-sql-server-a-guide-for-the-accidental-dba/
i'll look into if we can set lock pages for this server. I'll need to confirm capatibility with the software vendor.
There's no compatibility to confirm, it's completely transparent to any app that uses SQL
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 19, 2013 at 9:51 am
edit - special thx to GilaMonster for the free ebook
i double checked the vendor database reccommendation sheet and it doesnt mention locked pages. just as ya'll said 'it should not be a concern'.
SQL is 32 bit. OS is 32 bit 2003 Ent
I'm wondering if sql is enforcing the memory setting. I wanted to try to limit SQL to 1.5 gb of memory. I muliplied 1.5 * 1024. But task manager shows the following. Should I trouble shoot this or are the amounts seem mismatched due to number conversions.
March 19, 2013 at 10:15 am
Never use task manager to monitor SQL Server's memory, it displays incorrect values in some cases. Also be aware that, prior to SQL 2012, the max memory setting limited the size of the buffer pool and there's always some additional non-buffer memory.
Now, if you have 32 bit SQL with 32 bit OS, 1.7 GB is the most SQL can use unless you have locked pages enabled, /PAE in the boot.ini and AWE enabled in SQL. Check chapter 4 of the same book. 🙂
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 25, 2013 at 6:43 am
You should keep track on SQL Server storage and performance to avoid this type of problem
If the capacity management of sql server is up to the mark then sql server always perform well and you will never face this type of problem
you can try some third party software for capacity management of SQL server which will give you accurate information.
March 25, 2013 at 7:13 am
peterdru401 (3/25/2013)
You should keep track on SQL Server storage and performance to avoid this type of problemIf the capacity management of sql server is up to the mark then sql server always perform well and you will never face this type of problem
you can try some third party software for capacity management of SQL server which will give you accurate information.
1. this has nothing to do with storage and 2. the issue can occur whether SQL Server has enough memory or not. It's mostly related to a misalignment between Windows memory management approach (i.e. how Windows is coded) and SQL Server behavior and cannot always be cured by adding more memory or lowering 'max server memory'.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply