Sql Server : Optimal Maximum and Minimum Server Memory Settings for VLDB Sql Instances
- Posted by Sqltimes
- On December 12, 2015
- 0 Comments
A few months ago, there was an interesting conversation that uncovered this recommendation for maximum & minimum server memory setting for VLDB instances. Memory is a crucial to any database servers; And it becomes more important for VLDBs. So it is important that we achieve optimal memory settings. As with anything else, the correct setting depends on several factors and it varies from instance to instance. Here we’ll cover general recommendation that could be used as baseline.
Usually database servers are dedicated machines. So, the only major application running on the OS is the Sql Server instance. So, we need to carve out memory for OS and Sql in a way that both run efficiently. For database server instances on VM or shared machines, memory configuration gets a bit more complicated; but this could used as a general guideline to start with and apply more relevant factors on top of it.
First, query your current settings:
1
2
3
4
5
6
7
|
-- -- Query the current memory allocation setting -- SELECT * FROM sys.configurations WHERE name LIKE '%memory (MB)%' GO |
For VLDB’s, generally the size of memory is larger than other database servers. As the server memory increases, the configuration changes. The general point is that we need to allocate as much memory to the Sql instance as possible. But this should not be at the cost of OS itself. So, we need to strike a right balance so the OS could run efficiently (without paging) while allocating as much memory to Sql instance as possible. To achieve this, we use the two settings available for each instance.
- min server memory (MB)
- max server memory (MB)
Total Server Memory | For OS | Minimum Memory for SQL | Maximum Memory for SQL |
---|---|---|---|
1 – 4 GB | 2 GB | 2 GB | 2 GB |
4 – 8 GB | 3 GB | 3 GB | 5 GB |
8 – 12 GB | 4 GB | 3 GB | 8 GB |
12 – 16 GB | 5 GB | 3 GB | 11 GB |
16 – 24 GB | 6 GB | 7 GB | 18 GB |
24 – 32 GB | 7 GB | 7 GB | 25 GB |
32 – 40 GB | 8 GB | 7 GB | 32 GB |
40 – 48 GB | 9 GB | 7 GB | 39 GB |
48 – 56 GB | 10 GB | 7 GB | 46 GB |
56 – 64 GB | 11 GB | 7 GB | 53 GB |
For VLDBs with more than 64 GB, we need to consider more factors on top of the guidelines above. We’ll dive into it in a future post.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-- -- Configure Memory Settings -- EXEC sp_configure 'show advanced options' , 1 RECONFIGURE GO EXEC sp_configure 'max server memory (MB)' , 5120 RECONFIGURE GO EXEC sp_configure 'show advanced options' , 0 RECONFIGURE GO |
Hope this helps,
_Sqltimes
0 Comments