-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SqlServerMemory: Auto memory on Azure VMs is off by an order of magnitude on large VMs #914
Comments
I have tested this on a physical and it looks okay to me. PS > [Math]::Round((Get-Ciminstance Win32_OperatingSystem).TotalVisibleMemorySize / 1MB)
192 And on a VM with less memory. PS > [Math]::Round((Get-Ciminstance Win32_OperatingSystem).TotalVisibleMemorySize / 1MB)
8 |
I label this one as 'good first issue'. If someone new to contributing wants to take something on, this is a good one. |
Looks like this class might be best here: This looks to be reliable in Azure. (gcim win32_computersystem).TotalPhysicalMemory |
Seen a similar type of issue on aws m5 EC2 machine type, where Win32_PhysicalMemory is returning 0 for capacity. aws' feedback was to use the following: ((Get-CimInstance -ClassName win32_ComputerSystem).TotalPhysicalMemory | Measure-Object -Sum).Sum |
This is about to be resolved in PR #1285. But since there have been reports that the change is better for VM's I thought I would verify that it works for physical servers as well. Since I don't have access to physical servers with a lot of memory I asked a friend. He tested on Windows Server 2012 R2 (HP Gen8 128GB) and Windows Server 2016 (HP Gen10 384GB). |
Details of the scenario you tried and the problem that is occurring:
Provision an Azure VM of type: Standard_E32_v3 VM (Windows) (with 256GB RAM) and have xSQLServerMemory automatically set max memory.
Expected would be that it sets SQL Server max memory to about 200+ GB RAM, actual result: it sets to about 27GB RAM.
The reason for that is that the script uses
((Get-CimInstance -ClassName Win32_PhysicalMemory).Capacity | Measure-Object -Sum).Sum
to get the total amount of RAM. On Azure, on that VM size that is around 30~ GB RAM.
A more correct way of getting the total amount of memory available would be:
(Get-Ciminstance Win32_OperatingSystem).TotalVisibleMemorySize
(to note - the result here is in KB, vs Bytes as with Win32_PhysicalMemory.Capacity)
The DSC configuration that is using the resource (as detailed as possible):
Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2016, PS 5.0
What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
SQL Server 2016 SP1
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
xSqlServer 7.1 - but this reproes on all version after that as well
The text was updated successfully, but these errors were encountered: