Memory allocation for SQL

Swguy 41 Reputation points
2022-04-15T19:49:42.657+00:00

I have a Production server having 2 vcpus and 12 GB of memory on the server in total.
This server will be used as a dedicated SQL server and so I would like to provision the min and max memory.
Is there a general recommendation of how much percentage needs to be allocated to the OS and how much for the SQL Server.?
I know much of this determination depends on the load, but to start with is there a general recommendation of how much can be min and max ?
or is it good to set both min and max at a certain level. ? Iam using SQL 2017 and would need another server with same config but using SQL 2019.
Will there be any difference in the memory allocation with SQL versions?( as to how SQL handles memory ) TIA

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,135 questions
0 comments No comments
{count} votes

Accepted answer
  1. YufeiShao-msft 7,126 Reputation points
    2022-04-18T08:40:45.927+00:00

    Hi @Swguy ,

    As general guidelines, leave a minimum of 1-4GB for the opearting system
    Max Server memory = (Total Server memory – Memory for OS) – (Stack Size * max worker threads)

    The default setting for min server memory is 0

    Min and Max memory configurations in SQL Server Database instances
    Server memory configuration options

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Erland Sommarskog 113.3K Reputation points MVP
    2022-04-15T20:06:30.707+00:00

    I'm tempted to answer that 12 GB is too little memory. But of course that depends on the application and the size of the database. Nevertheless, many laptops for sale today come with 16 GB.

    I would set max server memory to 9500 and leave min server memory at 0. The latter parameter is one I rarely touch.

    0 comments No comments

  2. Tom Phillips 17,741 Reputation points
    2022-04-15T20:21:24.947+00:00

    I agree with Erland.

    That is not much RAM for a SQL Server. But if your app is small it might be fine. Most of the RAM usage in SQL Server is for caching.

    I always recommend at reserving least 4GB for the OS and other processes. So I would start at 8000 and see how it goes. Don't change the min setting. There is no reason to do that.

    No, there really is no difference in RAM configuration recommendations in 2017 vs 2019.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.