You can use the NSX CLI to do some load balancer troubleshooting.

Problem

Load balancing is not working as expected.

Procedure

  1. Show configuration and statistics information.
    nsxedge> show configuration loadbalancer 
    nsxedge> show configuration loadbalancer virtual [virtual-server-name] 
    nsxedge> show configuration loadbalancer pool [pool-name] 
    nsxedge> show configuration loadbalancer monitor [monitor-name] 
    nsxedge> show configuration loadbalancer profile [profile-name] 
    nsxedge> show configuration loadbalancer rule [rule-name]
    
  2. Check the load balancer engine status (L4/L7).
    nsxedge> show service loadbalancer
    haIndex:              0
    -----------------------------------------------------------------------
    Loadbalancer Services Status:
    
    L7 Loadbalancer     : running
    -----------------------------------------------------------------------
    L7 Loadbalancer Statistics:
    STATUS     PID        MAX_MEM_MB MAX_SOCK   MAX_CONN   MAX_PIPE   CUR_CONN   CONN_RATE  CONN_RATE_LIMIT MAX_CONN_RATE
    running    1580       0          2081       1024       0          0          0          0               0
    -----------------------------------------------------------------------
    L4 Loadbalancer Statistics:
    MAX_CONN   ACT_CONN   INACT_CONN TOTAL_CONN
    0          0          0          0
    
    Prot LocalAddress:Port Scheduler Flags
      -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
    
  3. Check the load balancer pool status (L4/L7).
    nsxedge> show service loadbalancer pool
    -----------------------------------------------------------------------
    Loadbalancer Pool Statistics:
    
    POOL Web-Tier-Pool-01
    |  LB METHOD round-robin
    |  LB PROTOCOL L7
    |  Transparent disabled
    |  SESSION (cur, max, total) = (0, 0, 0)
    |  BYTES in = (0), out = (0)
       +->POOL MEMBER: Web-Tier-Pool-01/web-01a, STATUS: UP
       |  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
       |  |  |  LAST STATE CHANGE: 2016-05-16 07:02:00
       |  |  SESSION (cur, max, total) = (0, 0, 0)
       |  |  BYTES in = (0), out = (0)
       +->POOL MEMBER: Web-Tier-Pool-01/web-02a, STATUS: UP
       |  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
       |  |  |  LAST STATE CHANGE: 2016-05-16 07:02:01
       |  |  SESSION (cur, max, total) = (0, 0, 0)
       |  |  BYTES in = (0), out = (0)
    
    
  4. Check the load balancer object statistics (VIPs, pools, members).

    Specify the name of the virtual server.

    nsxedge> show service loadbalancer virtual Web-Tier-VIP-01
    
    -----------------------------------------------------------------------
    Loadbalancer VirtualServer Statistics:
    
    VIRTUAL Web-Tier-VIP-01
    |  ADDRESS [172.16.10.10]:443
    |  SESSION (cur, max, total) = (0, 0, 0)
    |  RATE (cur, max, limit) = (0, 0, 0)
    |  BYTES in = (0), out = (0)
       +->POOL Web-Tier-Pool-01
       |  LB METHOD round-robin
       |  LB PROTOCOL L7
       |  Transparent disabled
       |  SESSION (cur, max, total) = (0, 0, 0)
       |  BYTES in = (0), out = (0)
          +->POOL MEMBER: Web-Tier-Pool-01/web-01a, STATUS: UP
          |  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
          |  |  |  LAST STATE CHANGE: 2016-05-16 07:02:00
          |  |  SESSION (cur, max, total) = (0, 0, 0)
          |  |  BYTES in = (0), out = (0)
          +->POOL MEMBER: Web-Tier-Pool-01/web-02a, STATUS: UP
          |  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
          |  |  |  LAST STATE CHANGE: 2016-05-16 07:02:01
          |  |  SESSION (cur, max, total) = (0, 0, 0)
          |  |  BYTES in = (0), out = (0)
    
    

    nsxedge> show service loadbalancer pool Web-Tier-VIP-01
    TIMESTAMP            	SESSIONS   	BYTESIN    	BYTESOUT   	SESSIONRATE	HTTPREQS
    2016-04-27 19:56:40  	00         	00         	00         	00         	00
    2016-04-27 19:55:00  	00         	32         	100        	00         	00
    

  5. Check the service monitor status (OK, WARNING, CRITICAL)
    nsxedge> show service loadbalancer monitor
    -----------------------------------------------------------------------
    Loadbalancer Health Check Statistics:
    
    MONITOR PROVIDER   POOL               MEMBER     HEALTH STATUS
    built-in           Web-Tier-Pool-01   web-01a    default_https_monitor:L7OK
    built-in           Web-Tier-Pool-01   web-02a    default_https_monitor:L7OK
    
  6. Check the log.
    nsxedge> show log
    2016-04-20T20:15:36+00:00 vShieldEdge kernel: Initializing cgroup subsys cpuset
    2016-04-20T20:15:36+00:00 vShieldEdge kernel: Initializing cgroup subsys cpu
    2016-04-20T20:15:36+00:00 vShieldEdge kernel: Initializing cgroup subsys cpuacct
    ...
    
  7. Check the load balancer session table.
    nsxedge> show service loadbalancer session
    -----------------------------------------------------------------------
    L7 Loadbalancer Statistics:
    STATUS     PID        MAX_MEM_MB MAX_SOCK   MAX_CONN   MAX_PIPE   CUR_CONN   CONN_RATE  CONN_RATE_LIMIT MAX_CONN_RATE
    running    1580       0          2081       1024       0          0          0          0               0
    
    -----------------------------------------------------------------------L7 Loadbalancer Current Sessions:
    
    0x2192df1f300: proto=unix_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=09 age=0s calls=2 rq[f=c08200h,i=0,an=00h,rx=20s,wx=,ax=] rp[f=008000h,i=0,an=00h,rx=,wx=,ax=] s0=[7,8h,fd=1,ex=] s1=[7,0h,fd=-1,ex=] exp=19s
    
    
    -----------------------------------------------------------------------
    L4 Loadbalancer Statistics:
    MAX_CONN   ACT_CONN   INACT_CONN TOTAL_CONN
    0          0          0          0
    
    L4 Loadbalancer Current Sessions:
    
    pro expire state       source       virtual    destination
    
  8. Check the load balancer Layer 7 sticky-table status.
    nsxedge> show service loadbalancer table
    -----------------------------------------------------------------------
    L7 Loadbalancer Sticky Table Status:
    
    TABLE    TYPE    SIZE(BYTE)   USED(BYTE)