Skip to content
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

MaxMemory check succeeds against an instance with Max Memory value greater than (Recommended+379) #836

Closed
4 of 5 tasks
a4ic6n opened this issue Mar 15, 2021 · 1 comment
Closed
4 of 5 tasks

Comments

@a4ic6n
Copy link

a4ic6n commented Mar 15, 2021

Bug Report

General Troubleshooting steps

  • Verified running the latest release of dbachecks?

Does (Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()

image

  • Verified errors are not related to permissions?
  • Can duplicate in new/clean PowerShell session (clean = powershell -NoProfile)?

Version Information

  • Operating System (Name|Version): Windows 10|1803
  • PowerShell Version: 5.1.17134.858
  • dbachecks Version: 2.0.9
  • dbatools Version: 1.0.140
  • PSFramework Version: 1.1.59
  • Pester Version: 4.10.1
  • SQL Server (Edition|Version): Standard Edition (64-bit)|14.0.3294.2

Steps to Reproduce

  • Run Invoke-DbcCheck -Checks MaxMemory against an SQL Server instance with default max memory settings (2147483647).

  • Attach any screenshots (if possible/allowed)

  • Attach output from PowerShell console (if possible/allowed)

PS C:\Users\aic1> Test-DbaMaxMemory -SqlInstance SIRBNM-TEST23\SIRSQL6 -SqlCredential (Get-Credential sa)
WARNING: [17:10:52][Test-DbaMaxMemory] Couldn't get accurate SQL Server instance count on SIRBNM-TEST23\SIRSQL6. Defaulting to 1. | No services found in relevant namespaces on SIRBNM-TEST23.
Please note that this function is available from SQL 2005 up.


ComputerName     : SIRBNM-TEST23
InstanceName     : SIRSQL6
SqlInstance      : SIRBNM-TEST23\SIRSQL6
InstanceCount    : 1
Total            : 16377
MaxValue         : 2147483647
RecommendedValue : 11257
PS C:\Users\aic1> Invoke-DbcCheck -Checks MaxMemory -SqlInstance SIRBNM-TEST23\SIRSQL6 -SqlCredential (Get-Credential sa)
Pester v4.10.1
Executing all tests in 'C:\Program Files\WindowsPowerShell\Modules\dbachecks\2.0.9\checks\Instance.Tests.ps1' with Tags MaxMemory

Executing script C:\Program Files\WindowsPowerShell\Modules\dbachecks\2.0.9\checks\Instance.Tests.ps1

  Describing Max Memory

    Context Testing Max Memory on SIRBNM-TEST23\SIRSQL6
      [+] Max Memory setting should be correct on SIRBNM-TEST23\SIRSQL6 380ms
Tests completed in 1.05s
Tests Passed: 1, Failed: 0, Skipped: 0, Pending: 0, Inconclusive: 0

Description of Bug

MaxMemory check succeeds against an SQL Server instance with Max Memory value greater than (Recommended+379), when it shouldn't.

Workaround

Replace
$psitem.SqlMaxMB | Should -BeLessThan ($psitem.RecommendedMB + 379) -Because 'You do not want to exhaust server memory'
with
$psitem.MaxValue | Should -BeLessThan ($psitem.RecommendedValue + 379) -Because 'You do not want to exhaust server memory'
in <ModulePath>\dbachecks\<Version>\checks\Instance.Tests.ps1

@SQLDBAWithABeard
Copy link
Collaborator

Thank you :-) fixed in next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants