Digging deeper with perf

In most cases, working through this tiny checklist will help you to track down the majority of problems in a pretty fast and efficient way. However, even the information extracted from the database engine is sometimes not enough.

The perf tool is an analysis tool for Linux that allows you to directly see which C functions cause problems on your system. Usually perf is not installed by default, so it is recommended to install it. To use perf on your server, just log in to a root and run:

perf top

The screen will refresh itself every couple of seconds and you will have a chance to see what is going on live. The next listing shows what a standard read-only benchmark might look like:

Samples: 164K of event 'cycles:ppp', ...

Get Mastering PostgreSQL 10 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.