There is a total of 10GB of RAM. I want to set MAX server memory and MIN server memory for SQL Server. How do I set this? Would 20% of the total RAM for the MIN value and 80% of the total RAM for the MAX value be a correct calculation? Or would 60% of the total RAM for the MIN value and 80% of the total RAM for the MAX value be an accurate calculation? The question I want to ask is is there any method to calculate these values?
1 Answer
- Below powershell dbatools commands gets and sets automatically the instance max memory to the recommended, it uses calculations from Jonathan Kehayias's post about SQL Server Max memory
# Calculates SQL Max memory based on server configuration
Test-DbaMaxMemory -SqlInstance SqlInstanceName
# Gets current configured SQL Max memory
Get-DbaMaxMemory -SqlInstance SqlInstanceName
# Sets recommended SQL Max memory
Set-DbaMaxMemory -SqlInstance SqlInstanceName
Ref:
- For Min SQL memory, unless the host is a multi tenant instance it is recommended to leave it default value 0. If there are multiple instances of SQL Server running on a single host, it might be beneficial to set a minimum memory amount to ensure a base level of performance.