Sampling profiler updated

From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Sampling profiler updated
Date: 2009-07-14 09:47:01
Message-ID: 20090714183127.946A.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I updated Sampling profiler patch to be applied to HEAD cleanly.

Basic concept of the patch is same as DTrace probes:
Call pgstat_push_condition(condition) before a operation and call
pgstat_pop_condition() at the end of the operation. Those functions
should be light-weight because they only change a variable on shared
memory without any locks.

Stats collector process checks those shard variables periodically and
sums the status in collector's local memory. We cannot know exact
numbers of each operation, but can expect the sampling numbers reflect
the tendency of times spend in each operation. The sampling result
can be retrived with pg_profiles system view.

Of course the profiler could be implemented on the top of DTrace or
SystemTap, but it is not so easy if we try to avoid any performance
regressions and to provide the information by VIEW-like interface.
Also, this approach is platform-independent.

A new feature compared with previous patch is function
pgstat_register_condition(condition, name).
We can add user-defined conditions in extended modules.

Comments welcome.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Attachment Content-Type Size
profiler-20090714.gz application/octet-stream 19.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message marcin mank 2009-07-14 10:18:56 Re: *_collapse_limit, geqo_threshold
Previous Message Simon Riggs 2009-07-14 09:39:18 Comments on automatic DML routing and explicit partitioning subcommands