Quantcast
Viewing all articles
Browse latest Browse all 15889

Memory Management for Multiple Instances on a Cluster


I am looking  for recommendations for configuring memory settings for  Three  instances of SQL running on a Two server Failover Cluster. ( SQL 2012)

 

Scenario

Hardware: 32 Logical, 16 Physical Cores, 64GB RAM

Server: 1, 2

SQL Instance: A, B, C

  

I want to ensure enough memory is available to the OS, even when all SQL Server instances are running on 1 node. (This not the normal behavior, but will get us by while the other node is offline).

I could configure Max Memory on each SQL Instance so that when in this scenario the OS has at least 4GB*

For example: SQL Instance A gets 32GB RAM,  B gets 16GB, C gets 12GB, leaving 4GB available to OS.
(assume that the memory allocations are balanced for each instance's workload)

 

However, when instances are running on different servers, I want the instances on that server to use as much of

the available RAM  as needed (still leaving at least 4GB for the OS). 

For Example:  A is running on server 1, B & C are running on server 2

The memory allocation could be:  Server 1) A gets 60GB ,  Server 2) B gets 32GB, C gets 28GB

(leaving 4GB available to OS on each server)

Looking at the documentation:

"When you are running multiple instances of the Database Engine, there are three approaches you can use to manage memory:

  • Use max server memory to control memory usage. Establish maximum settings for each instance, being careful that the total allowance is not more than the total physical memory on your machine. You might want to give each instance memory proportional to its expected workload or database size. This approach has the advantage that when new processes or instances start up, free memory will be available to them immediately. The drawback is that if you are not running all of the instances, none of the running instances will be able to utilize the remaining free memory.

 

  • Use min server memory to control memory usage. Establish minimum settings for each instance, so that the sum of these minimums is 1-2 GB less than the total physical memory on your machine. Again, you may establish these minimums proportionately to the expected load of that instance. This approach has the advantage that if not all instances are running at the same time, the ones that are running can use the remaining free memory. This approach is also useful when there is another memory-intensive process on the computer, since it would insure that SQL Server would at least get a reasonable amount of memory. The drawback is that when a new instance (or any other process) starts, it may take some time for the running instances to release memory, especially if they must write modified pages back to their databases to do so."

It appears this is recommending just setting the Min server memory and not setting a Max limit.

However the article also states that

"SQL Server is not guaranteed to allocate the amount of memory specified in min server memory. If the load on the server never requires allocating the amount of memory specified in min server memory, SQL Server will run with less memory."

 

Which means that even though a min memory is set, it is not going to force it to grab that much memory on start up.
Also, from my experience with SQL 2008R2 it tends to be greedy with memory. Left unbounded it with leave very little available for the OS.

 

A Potential Solution:

Create a SQL Job that runs on startup of each of the SQL Server  instances.

This job would start jobs on each of the SQL Server instances including itself,  that determines the server  the instance is currently running on and which other instances are also running on that server, then set its max memory setting for that scenario.

 

I am not sure the best way to do each of those steps yet, but before I pursue that solution, I wanted to see if there are better options out there.

 

Thanks,

 

I am basing my 4GB memory available to the OS on this article

(I tried to link to the documentation I was referencing but it will not allow be to post links).


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>