pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedlog_statement vs Statistics Collector (pg_stat_database,, etc)
5+ messages / 4 participants
[nested] [flat]
* log_statement vs Statistics Collector (pg_stat_database,, etc)
@ 2015-12-24 21:32 Nik Tek <niktek2005@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Nik Tek @ 2015-12-24 21:32 UTC (permalink / raw)
To: pgsql-admin; +Cc: Nik Tek <niktek2005@gmail.com>
Hi pg gurus,
I wanted to capture all the DML statements executed in the database
information (execution time, ).
Question:
Can anyone point me pros and cons on either of the approaches.
In my testing, I haven't found any performance degrade on application
operations when enabled the additional logging (below logging).
log_error_verbosity = verbose
log_min_duration_statement = 0
log_statement = 'mod'
log_checkpoints = on
--
Thank you
NikTeki
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: log_statement vs Statistics Collector (pg_stat_database,, etc)
@ 2015-12-27 13:35 Matheus de Oliveira <matioli.matheus@gmail.com>
parent: Nik Tek <niktek2005@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Matheus de Oliveira @ 2015-12-27 13:35 UTC (permalink / raw)
To: Nik Tek <niktek2005@gmail.com>; +Cc: pgsql-admin
On Thu, Dec 24, 2015 at 7:32 PM, Nik Tek <niktek2005@gmail.com> wrote:
> I wanted to capture all the DML statements executed in the database
> information (execution time, ).
>
> Question:
> Can anyone point me pros and cons on either of the approaches.
>
> In my testing, I haven't found any performance degrade on application
> operations when enabled the additional logging (below logging).
>
Besides log_min_duration_statement, you can use tools like
pg_stat_statements [1] and POWA [2]. POWA authors even did a comparison of
performance impact of having log_min_duration_statement (to latter process
with pgBadger), using POWA extension and nothing, see [3].
[1] http://www.postgresql.org/docs/current/static/pgstatstatements.html
[2] http://dalibo.github.io/powa/
[3] https://github.com/dalibo/powa/wiki/POWA-vs-pgBadger
--
Matheus de Oliveira
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: log_statement vs Statistics Collector (pg_stat_database,, etc)
@ 2015-12-29 00:03 Nik Tek <niktek2005@gmail.com>
parent: Matheus de Oliveira <matioli.matheus@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: Nik Tek @ 2015-12-29 00:03 UTC (permalink / raw)
To: Matheus de Oliveira <matioli.matheus@gmail.com>; +Cc: pgsql-admin
Thank you Matheus!
Based on the study, there's very little performance impact when
enabling log_min_duration_statement,
right?
Thank you
Nik
On Sun, Dec 27, 2015 at 5:35 AM, Matheus de Oliveira <
matioli.matheus@gmail.com> wrote:
>
> On Thu, Dec 24, 2015 at 7:32 PM, Nik Tek <niktek2005@gmail.com> wrote:
>
>> I wanted to capture all the DML statements executed in the database
>> information (execution time, ).
>>
>> Question:
>> Can anyone point me pros and cons on either of the approaches.
>>
>> In my testing, I haven't found any performance degrade on application
>> operations when enabled the additional logging (below logging).
>>
>
> Besides log_min_duration_statement, you can use tools like
> pg_stat_statements [1] and POWA [2]. POWA authors even did a comparison of
> performance impact of having log_min_duration_statement (to latter process
> with pgBadger), using POWA extension and nothing, see [3].
>
> [1] http://www.postgresql.org/docs/current/static/pgstatstatements.html
> [2] http://dalibo.github.io/powa/
> [3] https://github.com/dalibo/powa/wiki/POWA-vs-pgBadger
>
>
> --
> Matheus de Oliveira
>
>
>
--
Thank you
NikTeki
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: log_statement vs Statistics Collector (pg_stat_database,, etc)
@ 2015-12-29 04:01 Scott Whitney <scott@journyx.com>
parent: Nik Tek <niktek2005@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Scott Whitney @ 2015-12-29 04:01 UTC (permalink / raw)
To: Nik Tek <niktek2005@gmail.com>; Matheus de Oliveira <matioli.matheus@gmail.com>; +Cc: pgsql-admin
I am sorry. I am late to this thread. Please do not think there is zero impact.
-------- Original message --------
From: Nik Tek <niktek2005@gmail.com>
Date: 12/28/2015 6:05 PM (GMT-06:00)
To: Matheus de Oliveira <matioli.matheus@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] log_statement vs Statistics Collector (pg_stat_database,, etc)
Thank you Matheus!
Based on the study, there's very little performance impact when enabling log_min_duration_statement, right?
Thank you
Nik
On Sun, Dec 27, 2015 at 5:35 AM, Matheus de Oliveira <matioli.matheus@gmail.com<mailto:matioli.matheus@gmail.com>> wrote:
On Thu, Dec 24, 2015 at 7:32 PM, Nik Tek <niktek2005@gmail.com<mailto:niktek2005@gmail.com>> wrote:
I wanted to capture all the DML statements executed in the database information (execution time, ).
Question:
Can anyone point me pros and cons on either of the approaches.
In my testing, I haven't found any performance degrade on application operations when enabled the additional logging (below logging).
Besides log_min_duration_statement, you can use tools like pg_stat_statements [1] and POWA [2]. POWA authors even did a comparison of performance impact of having log_min_duration_statement (to latter process with pgBadger), using POWA extension and nothing, see [3].
[1] http://www.postgresql.org/docs/current/static/pgstatstatements.html
[2] http://dalibo.github.io/powa/
[3] https://github.com/dalibo/powa/wiki/POWA-vs-pgBadger
--
Matheus de Oliveira
--
Thank you
NikTeki
Journyx, Inc.
7600 Burnet Road #300
Austin, TX 78757
www.journyx.com
p 512.834.8888
f 512-834-8858
Do you receive our promotional emails? You can subscribe or unsubscribe to those emails at http://go.journyx.com/emailPreference/e/4932/714/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: log_statement vs Statistics Collector (pg_stat_database,, etc)
@ 2015-12-29 13:52 Scott Mead <scottm@openscg.com>
parent: Nik Tek <niktek2005@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Scott Mead @ 2015-12-29 13:52 UTC (permalink / raw)
To: Nik Tek <niktek2005@gmail.com>; +Cc: Matheus de Oliveira <matioli.matheus@gmail.com>; pgsql-admin
On Mon, Dec 28, 2015 at 7:03 PM, Nik Tek <niktek2005@gmail.com> wrote:
> Thank you Matheus!
>
> Based on the study, there's very little performance impact when enabling log_min_duration_statement,
> right?
>
>
Whoa... :) Careful there!
This all depends on your traffic. Keep in mind, if
log_min_duration_statement is set to something low (say, 0, which means to
log all statements and their data), you are essentially more than doubling
the amount of I/O that your database does. Remember, you would be writing
the data to the database itself as WELL as to the logs. In some cases, on
low-volume systems, this may be a non-issue, but, on even moderately
queried systems, you're going to spend a lot of your IOPS on logging.
For sure, you can mitigate the issue by setting up a separate mount for
logging, even more by running this all through [r]syslog and forwarding
(over a dedicated network) the traffic to a dedicated logging host. Just
keep in mind, this is a fire hydrant you're ready to crank open, be ready
to deal with the water.
--
Scott Mead
Sr. Architect
*OpenSCG*
PostgreSQL, Java & Linux Experts
http://www.openscg.com
> Thank you
> Nik
>
> On Sun, Dec 27, 2015 at 5:35 AM, Matheus de Oliveira <
> matioli.matheus@gmail.com> wrote:
>
>>
>> On Thu, Dec 24, 2015 at 7:32 PM, Nik Tek <niktek2005@gmail.com> wrote:
>>
>>> I wanted to capture all the DML statements executed in the database
>>> information (execution time, ).
>>>
>>> Question:
>>> Can anyone point me pros and cons on either of the approaches.
>>>
>>> In my testing, I haven't found any performance degrade on application
>>> operations when enabled the additional logging (below logging).
>>>
>>
>> Besides log_min_duration_statement, you can use tools like
>> pg_stat_statements [1] and POWA [2]. POWA authors even did a comparison of
>> performance impact of having log_min_duration_statement (to latter process
>> with pgBadger), using POWA extension and nothing, see [3].
>>
>> [1] http://www.postgresql.org/docs/current/static/pgstatstatements.html
>> [2] http://dalibo.github.io/powa/
>> [3] https://github.com/dalibo/powa/wiki/POWA-vs-pgBadger
>>
>>
>> --
>> Matheus de Oliveira
>>
>>
>>
>
>
> --
> Thank you
> NikTeki
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2015-12-29 13:52 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-24 21:32 log_statement vs Statistics Collector (pg_stat_database,, etc) Nik Tek <niktek2005@gmail.com>
2015-12-27 13:35 ` Matheus de Oliveira <matioli.matheus@gmail.com>
2015-12-29 00:03 ` Nik Tek <niktek2005@gmail.com>
2015-12-29 04:01 ` Scott Whitney <scott@journyx.com>
2015-12-29 13:52 ` Scott Mead <scottm@openscg.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox