views:

1277

answers:

2

We are running SQL Server 2005 on 64 bit. The PF Usage reaches close to 25 GB every week. Queries that normally take less than a second to run become very slow during this time. What could be causing this?

After running PerfMon, the two counters, Total Server Memory and Target Server Memory show 20 GB and 29 GB respectively. Processor Queue Length and Disk Queue Length are zero.

+1  A: 

Sounds like you don't have enough memory, how much is on the Server? More than your page file?

Also could mean Sql Server has "paged out" meaning Windows decided to swap all the info it stored in memory onto the disk.

Open Perfmon ( Goto a command prompt, and type perfmon ) and add these counters:

  • SQLServer:Buffer Manager - Buffer cache hit ratio
  • SQLServer:Buffer Manager - Page life expectancy
  • SQLServer:Memory Manager - Memory Grants Pending

If Buffer Cache Hit Ratio is < 95% it means Sql is using the disk instead of memory a lot you need more memory.

If your page life expectancy is < 500 it mean SqlServer is not keeping results cached in memory, you need more memory.

If you have a lot of Memory Grants Pending, you need more memory.

There are also two stats which let you know how much memory SqlServer wants and how much its actually using. They are called something like "Total Memory Used" and "Total Memory Requested". If Requested > Used, guess what, you need more memory.

There are also some dmv's you can use to determine if your queries are being held up while waiting for memory to free up. I think its sys_dmv.os_wait_stats, something like that.

I community wikied this so a real dba can come in here and clean this up. Don't know the stats off the top of my head.

jfar
+1  A: 

This is a great read on how to use DMV's to determine memory consumption on sql: http://technet.microsoft.com/en-us/library/cc966540.aspx - look for the 'memory bottlenecks' section.

One big thing is to determine if the memory pressure is internal to SQL (usually the case) or external (rare, but possible). For example, perhaps nothing is wrong with your server, but a driver installed by your antivirus program is leaking memory.

JohnW