Does your SQL Server machine have enough RAM?

Microsoft's SQL Server tends to lock up as much RAM on a server as possible. If you have 2GB of RAM, you'll notice it uses most of it. If you increase the RAM to 4GB, you'll notice it immediately starts to use most of the new RAM too. This is by design and due to SQL Server's goal of caching as much data (and SQL statements) as possible to minimize disk load and performance bottlenecks.

How do you know if your SQL Server machine has enough RAM? Or if it would benefit from adding more RAM?

Open Performance Monitor on the server and add the counter: SQLServer:Buffer Manager:Buffer Cache Hit Ratio.

SQL Server Performance Counters for Memory (Cache)

You really want the average to be as close to 100% as possible. If your numbers are tracking less than 95% you should consider adding more RAM to the server.

A 100% cache hit ratio means that SQL Server is currently pulling 100% of the data requests from RAM rather than disk. Reading from RAM is always faster than reading from disk - even the new super-fast solid-state disk drives - so this is of course the preferred scenario. If you are getting 99%+ on your cache hit ratio counter, the server would likely not benefit from additional RAM right now. If performance gains are desired, you'd be better off looking at other areas (perhaps CPU or general query optimization).

 

blog comments powered by Disqus
Tagged as: