Odd memory stats

  • I'm troubleshooting a 2016 SQL instance that is reportedly getting slower. An odd stat I don't understand is Target and Total Server Memory. They are both at 2.37GB right now. I checked, and max memory for the instance is at 12287MB. PLE is at 218, but I've read that this isn't always indicative of memory pressure. I don't see any Memory Grants Pending. Perhaps this all means that memory is fine. But it just looked odd. Since I'm new to the admin side of things I thought I would check to see if anyone had any thoughts.  

    Here is some info from DBCC MEMORYSTATUS
    Process/System Counts                        Value
    Available Physical Memory                   1135857664
    Available Virtual Memory                       140709368369152
    Available Paging File                             1094410240
    Working Set                                           2761015296
    Percent of Committed Memory in WS    100
    Page Faults                                            119928219
    System physical memory high                0
    System physical memory low                  0
    Process physical memory low                0
    Process virtual memory low                    0

    Memory Manager                   KB
    VM Reserved                         26562648
    VM Committed                       2683784
    Locked Pages Allocated         0
    Large Pages Allocated           0
    Emergency Memory               1024
    Emergency Memory In Use    16
    Target Committed                   2683544
    Current Committed                 2683784
    Pages Allocated                     2312056
    Pages Reserved                     0
    Pages Free                             23360
    Pages In Use                         1466768
    Page Alloc Potential              2035896
    NUMA Growth Phase            2
    Last OOM Factor                  0
    Last OS Error                        0

  • Target and Total Server Memory are frequently identical after the server has been running for a bit. SQL Server will consume the memory available and then hold on to it. So these measures don't tell you anything about performance. Instead of looking at these counters, I'd suggest starting with wait statistics. That is going to more quickly tell you exactly what and why things are running slowly on the server. Some waits are not useful, so filtering them in advance is a good idea. I'd recommend using Paul Randal's scripts.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thanks very much, Grant. I'm so new to the admin side that its hard to know where to start. But one name I always recognize is Paul's. I was actually up at 2AM reading his stuff on rebuilds vs reorgs. Off to read again...

  • You literally can not go wrong using Paul Randal, and his team, as a guide.

    Best of luck on figuring things out. Come back here as you need help. Everyone tries hard to be useful.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • From the numbers, I'm going to guess you have external memory pressure. Something outside of SQL is consuming memory, and so SQL cannot increase its memory usage. That would be why target server memory is rather low.
    Check what else is using memory on that server,

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks, Gail. We found Windows Updates choking a bunch of RAM on that box. It looks like it was hung. This has been cleared, and we rebooted the box. Things are slowly starting to look better.

  • Things are looking much better. Obviously SQL didn't have enough memory to function very well. I guess the thing that bewilders me is that Memory Grants Pending and those sort of stats were not high. The highest wait types were CXPACKET and PAGEIOLATCH_SH. I think the latter can be indicative of memory issues, but I didn't see anything else that indicated SQL wanted more memory. Does anyone have any advice or direction on how to tell if SQL actually is under memory pressure? Thanks again for all the help so far and especially the links.

  • Users are still reporting slowness. I reset the wait stats yesterday so I could get a better picture of what is going on after the changes. Below is the current picture. I've been reading a bunch about CXPACKET waits, and noticed this server was setup with a Cost Threshold for Parallelism set to 5. Additionally, I noticed Max Degree of Parallelism is set to 4. I checked the server and it has 3 processors. (This is a VM environment.)

    WaitTypeWait_SResource_SSignal_SWaitCountPercentageAvgWait_SAvgRes_S
    CXPACKET18013.1816237.991775.2462817661.720.00390.0035
    PAGEIOLATCH_SH4449.74397.1552.5571228515.250.00620.0062
    SOS_SCHEDULER_YIELD1870.994.371866.6247411696.410.00040
    ASYNC_IO_COMPLETION788.22788.20.02292.727.179927.1794
    WRITELOG708.22619.4488.783963662.430.00180.0016
    BACKUPBUFFER687.2628.8858.32800002.350.00860.0079
    BACKUPIO665.35616.8148.54849042.280.00780.0073
    ASYNC_NETWORK_IO564.95515.349.651685251.940.00340.0031

    Brent Ozar recommends starting Cost Threshold for Parallelism at 50 and adjusting from there. Are there other factors I should check first though? And would the MAXOP setting potentially cause issues?

    Thanks again for any help or direction.

  • I've got several blog posts on the cost threshold for parallelism. First, we need to make sure you're on the service packs and CUs from the fall (at least, probably best to get on the latest). They changed the behavior of CXPACKET waits. Prior to that update, CXPACKETS didn't mean much. Now, it does. So, what version are you on?

    Then, you can set it to a number. 50 is OK as a ballpark for an OLTP system. A couple of my blog posts show how to get a more accurate number for your system. You might want to try those out.

    In addition to looking at waits (IO may also play a factor), you may want to capture query metrics and identify poor performers. In 2016, Query Store is the quick and easy way to do that.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Hi Grant - thanks a bunch for the links. I've already started working through them. It does look like this instance is behind on service packs. I will make that the priority.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply