Monitoring system load
Many a times there are situations when the application users start complaining about the database performance being slow and as a DBA you need to determine whether there are system resource bottlenecks on the PostgreSQL server. Running the vmstat
command can help us to quickly locate and identify the bottlenecks on the server.
How to do it...
The vmstat command is used to report real-time performance statistics about processes, memory, paging, disk I/O, and CPU consumption. The following is the usage of the vmstat
command:
$ vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
14 0 52340 25272 3068 1662704 0 0 63 76 9 31 15 1 84 0
In the preceding output, the first line divides the columns on the second line into six different categories, which are discussed in the following list:
The first category is the process (procs) and it contains the following columns...