Re: how to do profile for pg?

From: "jacktby(at)gmail(dot)com" <jacktby(at)gmail(dot)com>
To: aleksander <aleksander(at)timescale(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: how to do profile for pg?
Date: 2023-09-21 14:22:48
Message-ID: 1695306168433.givp3hqcvsnqevptfpzk1apf@android.mail.163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

but I need a quick demo to see the memory profiling or CPU profiling. &nbsp;I hope a blog or a video which is better for me. Thanks.<br/><br/><br/><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="ntes-mailmaster-quote" style="padding-top: 1px; padding-bottom: 1px" >
<div style=" margin-top: 20px; margin-bottom: 12px; font-size: 14px; line-height: 1.25; color: #89898c; " >---- Replied Message ----</div>
<div style=" margin-bottom: 12px; font-size: 13px; line-height: 1.25; color: #2c2c2e; padding: 2px; border-radius: 8px; background-color: #f0f0f0; " >
<table width="100%" cellpadding="0" cellspacing="10" border="0">
<tr>
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; white-space: nowrap; " >From</td>
<td valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " ><a class="mail-from" style="color: #1c83eb; text-decoration: none" href="mailto:aleksander(at)timescale(dot)com" >Aleksander Alekseev&lt;aleksander(at)timescale(dot)com&gt;</a></td>
</tr>
<tr>
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; white-space: nowrap; " >Date</td>
<td class="mail-date" valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " >09/21/2023 22:02</td>
</tr>
<tr style="">
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; " >To</td>
<td valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " ><a class="mail-to" style="color: #1c83eb; text-decoration: none" href="mailto:pgsql-hackers(at)lists(dot)postgresql(dot)org" >pgsql-hackers&lt;pgsql-hackers(at)lists(dot)postgresql(dot)org&gt;</a></td>
</tr>
<tr style="">
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; " >Cc</td>
<td valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " ><a class="mail-cc" style="color: #1c83eb; text-decoration: none" href="mailto:jacktby(at)gmail(dot)com" >jacktby(at)gmail(dot)com</a></td>
</tr>
<tr>
<td valign="top" style=" width: 4em; font-size: 13px; line-height: 1.25; color: #89898c; " >Subject</td>
<td class="mail-subject" valign="top" style=" font-size: 13px; line-height: 1.25; color: #2c2c2e; word-break: break-all; " >Re: how to do profile for pg?</td>
</tr>
</table>
</div>
<div>Hi jacktby,
<br/>
<br/>PostgreSQL is literally a large and complicated program in C. Thus it
<br/>can be profiled as such. E.g. you can use `perf` and build flamegraphs
<br/>using `perf record`. Often pgbench is an adequate tool to compare
<br/>before and after results.There are many other tools available
<br/>depending on what exactly you want to profile - CPU, lock contention,
<br/>disk I/O, etc. People write books (plural) on the subject. Personally
<br/>I would recommend &quot;System Performance, Enterprise and the Cloud, 2nd
<br/>Edition&quot; and &quot;BPF Performance Tools&quot; by Brendan Gregg.
<br/>
<br/>--
<br/>Best regards,
<br/>Aleksander Alekseev
<br/></div>
</div>
</body>
</html>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-09-21 15:36:41 Re: New WAL record to detect the checkpoint redo location
Previous Message Aleksander Alekseev 2023-09-21 14:02:59 Re: how to do profile for pg?