Re: how to do profile for pg?

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "jacktby(at)gmail(dot)com" <jacktby(at)gmail(dot)com>
Subject: Re: how to do profile for pg?
Date: 2023-09-21 17:21:16
Message-ID: CAJ7c6TMNk8J4OB-9_nzeepHUKGwRdU2+4FSjdhtiGO0n+f0yTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> but I need a quick demo to see the memory profiling or CPU profiling. I hope a blog or a video which is better for me. Thanks

Well, then I guess you better hurry with reading these books :)

There is no shortcut I'm afraid. One of the first things that Brendan
explains is how to do benchmarks *prorerly*. This is far from being
trivial and often you may be measuring not something you want. E.g.
you may think that you are profiling CPU while in fact there is a lock
contention and CPU is not even a bottleneck. Another thing worth
considering which is often neglected is to make sure your optimization
doesn't cause any digradations under different workloads.

Last but not least you should be mindful of different configuration
parameters of PostgreSQL - shared_buffers, synchronous_commit = off,
to name a few, and also understand the architecture of the system
quite well. In this context I recommend Database System Concepts, 7th
Edition by Avi Silberschatz et al and also CMU Intro to Database
Systems [1] and CMU Advanced Database Systems [2] courses.

[1]: https://www.youtube.com/playlist?list=PLSE8ODhjZXjZaHA6QcxDfJ0SIWBzQFKEG
[2]: https://www.youtube.com/playlist?list=PLSE8ODhjZXjYzlLMbX3cR0sxWnRM7CLFn

--
Best regards,
Aleksander Alekseev

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2023-09-21 17:49:58 Re: how to do profile for pg?
Previous Message Robert Haas 2023-09-21 15:36:41 Re: New WAL record to detect the checkpoint redo location