O'Reilly logo

PostgreSQL High Performance Cookbook by Dinesh Kumar, Chitij Chauhan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required