[pgpool-hackers: 3230] Re: pgbench: Flamegraph

Jesper Pedersen jesper.pedersen at redhat.com
Thu Feb 7 03:07:13 JST 2019


On 2/5/19 6:10 PM, Tatsuo Ishii wrote:
> Thanks for the flamegraph. I am new to the tool but it looks pretty
> interesting. Is it possible for you to take another flamegraph with
> non extended query case (the pgbench default or "-M simple") so that
> I could get a hint to find bottle comparing -M extended case and -M
> simple case. Yes, we already noticed the performance degradation with
> Pgpool-II but still are struggling how to mitigate it.

Attached are runs against current master using PostgreSQL 11.x as the 

  pgbench -h host -p 9999 -U pgbench -c 8 -j 8 -M <mode> -T 60 pgbench

The first question would be: Why is per_node_error_log -> 
pool_extract_error_message showing up in the profiles when there are no 
log messages from this; > 6% in each. A quick look shows that 
pool_extract_error_message shouldn't create strings if they aren't 
needed. But, that is unlikely the real issue.

Use Search (top right corner) and write ^pool_extract_error*
Click on the highlighted boxes.

> Also it would be nice if you kindly show us how to generate flamegraph
> of Pgpool-II.


Flamegraph [1] can use Linux perf or bcc [2] as input; here I'll use perf.

1) Compile pgpool

export CFLAGS="-O0 -fno-omit-frame-pointer" && ./configure
make install

2) Setup pgpool and prepare work load


3) Record

Start the work load, and as root

# perf record -F 497 -a -g -- sleep 30

e.g. record for 30 seconds at 497Hz of all processes incl their stack traces

4) Get output

# perf script > out.perf

5) Fold it

# /path/to/Flamegraph/stackcollapse-perf.pl out.perf > folded.perf

6) Extract pgpool content

# grep pgpool folded.perf > pgpool.perf

7) Create flamegraph

# /path/to/Flamegraph/flamegraph.pl --title='prepared-master' 
pgpool.perf > prepared-master.svg

There is an intro video here [3].

[1] https://github.com/brendangregg/FlameGraph
[2] https://github.com/iovisor/bcc
[3] https://www.youtube.com/watch?v=D53T1Ejig1Q

Best regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extended-master.svg
Type: image/svg+xml
Size: 1338812 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20190206/a9604383/attachment-0003.svg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prepared-master.svg
Type: image/svg+xml
Size: 1217492 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20190206/a9604383/attachment-0004.svg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple-master.svg
Type: image/svg+xml
Size: 830943 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20190206/a9604383/attachment-0005.svg>

More information about the pgpool-hackers mailing list