Identifying disk I/O bottlenecks

In this recipe, we are going to use the iostat command to identify disk-related bottlenecks.

How to do it...

There are various options, that is, switches, available with the iostat command. The following are the most important switches used with iostat:

  1. -d: This switch reports the number of kilobytes transferred per second for specific disks, the number of transfers per second, and the average service time in milliseconds. The following is the usage of the iostat -d command:
            bash-3.2$iostat -d 5 5         sd0 sd2 sd3 sd4         Kps tps serv Kps tps serv Kps tps serv Kps tps serv         1 0 53 57 5 145 19 1 89 0 0 14         140 14 16 0 0 0 785 31 21 0 0 0         8 1 15 0 0 0 814 36 18 0 0 0         11 1 ...

Get PostgreSQL High Performance Cookbook 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.