Datapath Performance Analysis Using perf_analyzer.py - Single-File/Manual Mode - VMware NSX
search cancel

Datapath Performance Analysis Using perf_analyzer.py - Single-File/Manual Mode - VMware NSX

book

Article ID: 461974

calendar_today

Updated On:

Products

VMware NSX VMware vSphere ESXi

Issue/Introduction

  • perf_analyzer.py is a read-only script that ingests a net-stats capture from an ESXi host, and generates a performance report.
  • It can be run in-place on any ESXi host with the script, or copied off the host to any other system/PC with Python 3 installed, and then run it against a net-stats file captured on an ESXi host and copied to that system.
  • The Python script is attached to this article, and it also comes bundled with NSX 4.2.4+ installations, as well as VCF 9.1 at the below absolute path:
    /opt/vmware/nsx-common/python/adf/collector/esx/perf_analyzer.py

Resolution

During the performance issue under investigation, follow the steps below to gather the required data and to run the script.

Assuming an ESXi host with NSX 4.2.4+ or VCF 9.1 installed:

  1. SSH into the affected ESXi host
  2. Run the below command to collect 10 seconds (-i 10) of net-stats data and write it to file:
    net-stats -A -t WwQqlcvVnDhsrpzPxXi -i 10 > /tmp/netstats.json
  3. Change directory to the path where the script is located (its default directory shown below):
    cd /opt/vmware/nsx-common/python/adf/collector/esx/
  4. Run the analyzer script, and redirect the output to a file for later review in your preferred editor:
    python3 perf_analyzer.py /tmp/netstats.json > /tmp/perfreport.txt

Additional Information

Attachments

perf_analyzer.py get_app