Does max SQL memory include SQL AG memory requirements?
I have sql server 2019 enterprise on windows server 2019, with 30 databases totalling 500GB size. RAM is 100GB.
Of this 94GB is allocated as Max sql server memeory.
So 6GB remains for OS.
There is windows cluster and AG setup for 15 databases. I believe that memory for the cluster and AG are separate from the 94GB max sql memory setting. Is there any guide to estimate how much memory cluster and AG require?
I believe that memory for the cluster and AG are separate from the 94GB max sql memory setting.
For AG memory would come from max server memory. https://docs.microsoft.com/en-us/sql/relational-databases/memory-management-architecture-guide?view=sql-server-ver15#dynamic-memory-management controls
The SQL Server memory allocation, compile memory, all caches (including the buffer pool), query execution memory grants, lock manager memory, and CLR1 memory (essentially any memory clerk found in sys.dm_os_memory_clerks). CLR memory is managed under max_server_memory allocations starting with SQL Server 2012 (11.x). Memory for thread stacks, heaps, linked server providers other than SQL Server, or any memory allocated by a “non SQL Server” DLL is not controlled by max server memory.
So for some Windows cluster DLL's the memory may come from OS but that would be very less and you should hardly bother about that.
In your case if this is dedicated SQL Server instance leave 7-8 GB for OS and assign rest to SQL Server. Monitor memory usage by following counters.
Total Server memory
Target Server memory
Page Life expectancy of NUMA nodes( if you have)
Buffer Manager: Free Pages
Memory Manager: Memory grants pending.
PS: You are asking lot of questions answer to which can easily be found by little searching. I strongly suggest you to read books online.