How to collect esxtop batch data for ESXi performance troubleshooting
On an SSH session to the ESXi host, run:
esxtop -b -a -d <interval> -n <number of samples> > /vmfs/volumes/<datastore>/esxtopOut.csv
where:
-b : batch mode
-a : collect all metrics
-d : sampling frequency in seconds
-n : total number of samples
<datastore> is a vmfs datastore
To include host name and timestamp of collection within the output file name, run:
esxtop -b -a -d <interval> -n <number of samples> > /vmfs/volumes/<datastore>/esxtop-$(hostname)-$(date +"%FT%H:%M").csv
e.g. to collect 300 esxtop data samples at 2 second intervals (= 600 second /10 minutes coverage), run:
esxtop -b -a -d 2 -n 300 > /vmfs/volumes/<datastore>/esxtop-$(hostname)-$(date +"%FT%H:%M").csv
where <datastore> is a vmfs datastore
Notes:
An interval of 2 seconds (-d 2) is generally a good choice to observe fine-grain performance patterns
An interval of 5 seconds (-d 5) is generally preferable where data needs to be collected for a longer period of time
For additional information on esxtop batch mode, see: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-monitoring-performance/GUID-6C794926-3C90-45CE-AB42-3399D019DD3C.html