How to do it...

The output from dstat is very colorful. Obtain a few samples with these steps:

  1. Display default information with this command:
        dstat
  1. Display only system load and network activity with this command:
        dstat -n -l
  1. Display CPU usage, I/O, and disk utilization averaged over 5 second intervals with this command:
        dstat -c -r --disk-util 5
  1. For the next 10 seconds, display the time, memory usage, interrupts and context switches, disk activity from only the sda device, and the process using the most I/O. In addition, capture the results to a csv file, all with this command:
        dstat -tmyd -D sda --top-io --output /tmp/stats.csv 1 10

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.