Troubleshooting High Memory Issues on NetScaler

Troubleshooting High Memory Issues on NetScaler

book

Article ID: CTX208106

calendar_today

Updated On:

Description

Examine Free Memory Available

Log on to the NetScaler and run the command "stat system memory" to examine the free memory available. You can get these details from NetScaler GUI by navigating to Memory Usage tool in Troubleshooting Data section on Diagnostic page.

Examine Memory Allocated to Individual Pools

The NetScalers do not allocate entire memory at one shot, the packet engines boots with minimum memory required to operate and then keeps allocating more memory based on the need. Run the following command to figure out how the memory is allocated to individual pools: Login to the shell prompt of the NetScaler and apply the following command:
nsconmsg -K /var/nslog/newnslog -d memstats

Check if there is any pool that is taking up most of the memory. 

You will see the output in following format: 
MEMPOOL             MaxAllowd           CurAlloc                  ErrLmtFailed   ErrAllocFailed  ErrFreeFailed
                                     Bytes (Own%)(Overall%)
----------------------------------------------------------------------------------------------------------------------
MEM_PE               83886080        151552(0.18%  0.00%)          0                0            0
MEM_LB_SERVER      4294967295       2434816(0.06%  0.06%)          0                0            0
MEM_LB_SESSION       58720256         21504(0.04%  0.00%)          0                0            0

Here every pool has a cap on “MaxAllowd”. 
CurAlloc shows the percentage of memory used from the own pool versus overall system.
ErrLmtFailed notifies you the number of times you have gone over the particular pool limit
ErrAllocFailed shows number of times memory allocation failed for this pool.
ErrFreeFailed shows number of times memory free operation failed for this pool.

In the output generated by your NetScaler, verify if any Err counter increments. 

Examine Memory Page Allocation Failure

Examine the CONN_POOL_MEMBERS output of the preceding command. Check if “PgAllocFailed” increments in the output. It shows the count of memory page allocation failure and this directly impacts the current and new transactions. NSB is for the connections to be allocated and SPCB is for the SSL transactions. 

You can examine the memory error counter by running the following command:
nsconmsg -K newnslog  -d current -g mem_err

This command shows us if there are any mem_err counters have incremented in the current newnslog file.

The sample output where mem_err counters have incremented is shown below. Here the logs show there are memory allocation failures for the MEM_CONN pool:

     22       0     4573412093      33627     4803 mem_err_alloc_failed MEM_CONN Fri Feb  5 02:51:11 2016 (Aggr)
     18       0      450926307      10871     1553 mem_err_alloc_failed MEM_CONN Fri Feb  5 02:51:11 2016 (PE-10)
      4       0      363439236        348       49 mem_err_alloc_failed MEM_CONN Fri Feb  5 02:51:11 2016 (PE-4)
      8       0      484157390       6785      969 mem_err_alloc_failed MEM_CONN Fri Feb  5 02:51:11 2016 (PE-6)
     11       0      451309952       3247      463 mem_err_alloc_failed MEM_CONN Fri Feb  5 02:51:11 2016 (PE-7)
     14       0      483958388      12376     1768 mem_err_alloc_failed MEM_CONN Fri Feb  5 02:51:11 2016 (PE-8)

Apart from this counter, you can also examine the following counter in the newnslog to troubleshoot memory issues on NetScaler
mem_cur_feature_allocpercent: This counter tracks the percentage of NetScaler appliance memory used by the feature.
mem_cur_feature_allocsize: This counter tracks the total current NetScaler appliance memory available for use by the feature, in kilobytes.
mem_err_feature_alloc_failed: This counter tracks the memory allocation failure for a particular feature.
mem_tot_allocated_pcnt: This counter tracks the currently allocated memory in percent.

Issue/Introduction

This article lets you understand how to troubleshoot high memory conditions on NetScaler and try identifying the root cause.