pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
log_duration
9+ messages / 4 participants
[nested] [flat]

* log_duration
@ 2005-02-04 20:47  Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Simon Riggs @ 2005-02-04 20:47 UTC (permalink / raw)
  To: pgsql-admin


On top of a confusing day, I now have this:

I set log_duration = true in a postgresql.conf file.
I startup and test, local users connected via psql: working, no problem.

Users connecting remotely, same user, same database: no log of query
statement durations.

There is nothing in the code that sets this value independently for sets
of users (is there?)

I'm also having similar problems with log_min_statement_duration not
working at all.

Any ideas? Thanks,

Best Regards, Simon Riggs





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: log_duration
@ 2005-02-04 22:11  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2005-02-04 22:11 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: pgsql-admin

"Simon Riggs" <simon@2ndquadrant.com> writes:
> On top of a confusing day, I now have this:
> I set log_duration = true in a postgresql.conf file.
> I startup and test, local users connected via psql: working, no problem.
> Users connecting remotely, same user, same database: no log of query
> statement durations.
> There is nothing in the code that sets this value independently for sets
> of users (is there?)

No.  How sure are you that the remote users are really connecting to the
same postmaster?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: log_duration
@ 2005-02-05 00:12  Simon Riggs <simon@2ndquadrant.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Simon Riggs @ 2005-02-05 00:12 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

> From: Tom Lane
> "Simon Riggs" <simon@2ndquadrant.com> writes:
> > On top of a confusing day, I now have this:
> > I set log_duration = true in a postgresql.conf file.
> > I startup and test, local users connected via psql:
> working, no problem.
> > Users connecting remotely, same user, same database: no log of query
> > statement durations.
> > There is nothing in the code that sets this value
> independently for sets
> > of users (is there?)
>
> No.  How sure are you that the remote users are really
> connecting to the
> same postmaster?

Yes, very definitely.

I'm sitting here watching the Statement: lines scroll up the screen for
the remotely connected users.
Local sessions show both Statement: and Duration:

Can't see anything in the code that gives any kind of conditional on
that.

The code is straight 8.0.1, no code editing, but compiled on SUSE.

I wouldn't care, but I'm trying to tune the database, so the missing
data matters,

Best Regards, Simon Riggs




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: log_duration
@ 2005-02-05 23:10  Simon Riggs <simon@2ndquadrant.com>
  parent: Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Simon Riggs @ 2005-02-05 23:10 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; +Cc: pgsql-admin

>Simon Riggs
> > From: Tom Lane
> > "Simon Riggs" <simon@2ndquadrant.com> writes:
> > > On top of a confusing day, I now have this:
> > > I set log_duration = true in a postgresql.conf file.
> > > I startup and test, local users connected via psql:
> > working, no problem.
> > > Users connecting remotely, same user, same database: no
> log of query
> > > statement durations.
> > > There is nothing in the code that sets this value
> > independently for sets
> > > of users (is there?)
> >
> > No.  How sure are you that the remote users are really
> > connecting to the
> > same postmaster?
>
> Yes, very definitely.
>
> I'm sitting here watching the Statement: lines scroll up the
> screen for
> the remotely connected users.
> Local sessions show both Statement: and Duration:
>
> Can't see anything in the code that gives any kind of conditional on
> that.
>
> The code is straight 8.0.1, no code editing, but compiled on SUSE.
>
> I wouldn't care, but I'm trying to tune the database, so the missing
> data matters,

Further update on this:

We've isolated this issue to JDBC client access.
When connecting using the latest JDBC driver, we do not get "Duration:"
LOG messages when using log_duration = true.
[driver 8.0-310.jdbc2.jar]

We've tested both localhost connections and remotely connected users
with libpq clients and these do produce the log records for the
"Duration:" as we would expect.

Is this a V2/V3 protocol issue? Or a bug? (If so, where)

Thanks for any help.

Best Regards, Simon Riggs







^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: log_duration
@ 2005-02-06 17:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2005-02-06 17:32 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: pgsql-admin

"Simon Riggs" <simon@2ndquadrant.com> writes:
> Further update on this:

> We've isolated this issue to JDBC client access.

Ah-hah, now it makes sense.  I believe the JDBC driver always uses
extended query protocol (parse/bind/execute messages).  We know that
that code path is a bit shy of a load with respect to statement logging,
mainly because no one has worked out exactly what it ought to log and
when.  When you consider the possibilities for re-use of parsed
statements and partial execution of portals, it's not clear what a
"statement" is, let alone what its "duration" is.  Maybe the real
problem is that the GUC variables are defined in terms of a too
simplistic view of the world.

As a quick workaround until someone thinks of a better idea, it might be
sufficient to attach logging code to the execute phase, and ignore the
partial-execution issue.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: log_duration
@ 2005-02-08 00:40  Simon Riggs <simon@2ndquadrant.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 9+ messages in thread

From: Simon Riggs @ 2005-02-08 00:40 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

>Tom Lane
> "Simon Riggs" <simon@2ndquadrant.com> writes:
> > Further update on this:
>
> > We've isolated this issue to JDBC client access.
>
> Ah-hah, now it makes sense.  I believe the JDBC driver always uses
> extended query protocol (parse/bind/execute messages).

Thanks for the *solution.

I had a D'Oh moment about 2 hours after I posted...

> As a quick workaround until someone thinks of a better idea,
> it might be
> sufficient to attach logging code to the execute phase, and ignore the
> partial-execution issue.

Done... we're getting results out now.

I'm logging both duration of execution and the statement text, as would
be displayed in pg_stat_activity.

Thanks,

Best Regards, Simon Riggs




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* log_duration?
@ 2007-02-19 16:19  Ray Stell <stellr@cns.vt.edu>
  0 siblings, 2 replies; 9+ messages in thread

From: Ray Stell @ 2007-02-19 16:19 UTC (permalink / raw)
  To: pgsql-admin


I toggle log_duration:

wiki=# \!date
Mon Feb 19 11:14:35 EST 2007
wiki=#  set log_duration=off;
SET
wiki=# SELECT current_setting('log_duration');
 current_setting
-----------------
 off
(1 row)

yet duration continues to be logged:

wiki,13190,wiki,2007-02-19 11:16:00.926 EST,45d94f9e.3386,36108,2007-02-19 02:19:58 EST,270828,BIND LOG:  duration: 0.034 ms
wiki,13190,wiki,2007-02-19 11:16:00.929 EST,45d94f9e.3386,36109,2007-02-19 02:19:58 EST,0,COMMIT LOG:  duration: 2.840 ms

do I have to bounce to get it set?  Thx.



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: log_duration?
@ 2007-02-19 16:39  Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
  parent: Ray Stell <stellr@cns.vt.edu>
  1 sibling, 0 replies; 9+ messages in thread

From: Andy Shellam (Mailing Lists) @ 2007-02-19 16:39 UTC (permalink / raw)
  To: Ray Stell <stellr@cns.vt.edu>; +Cc: pgsql-admin

Ray Stell wrote:
> I toggle log_duration:
>
> wiki=# \!date
> Mon Feb 19 11:14:35 EST 2007
> wiki=#  set log_duration=off;
> SET
> wiki=# SELECT current_setting('log_duration');
>  current_setting
> -----------------
>  off
> (1 row)
>
> yet duration continues to be logged:
>
> wiki,13190,wiki,2007-02-19 11:16:00.926 EST,45d94f9e.3386,36108,2007-02-19 02:19:58 EST,270828,BIND LOG:  duration: 0.034 ms
> wiki,13190,wiki,2007-02-19 11:16:00.929 EST,45d94f9e.3386,36109,2007-02-19 02:19:58 EST,0,COMMIT LOG:  duration: 2.840 ms
>
> do I have to bounce to get it set?  Thx.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
> !DSPAM:37,45d9d01c18514452914812!
>
>
>   
Probably best to restart Postgres, yes.  I've observed logging functions 
to not take effect without a restart.

Andy.

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: log_duration?
@ 2007-02-20 02:40  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Ray Stell <stellr@cns.vt.edu>
  1 sibling, 0 replies; 9+ messages in thread

From: Tom Lane @ 2007-02-20 02:40 UTC (permalink / raw)
  To: Ray Stell <stellr@cns.vt.edu>; +Cc: pgsql-admin

Ray Stell <stellr@cns.vt.edu> writes:
> I toggle log_duration:

> wiki=# \!date
> Mon Feb 19 11:14:35 EST 2007
> wiki=#  set log_duration=off;
> SET

SET only affects your own session, not anyone else's ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2007-02-20 02:40 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-04 20:47 log_duration Simon Riggs <simon@2ndquadrant.com>
2005-02-04 22:11 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-05 00:12   ` Simon Riggs <simon@2ndquadrant.com>
2005-02-05 23:10     ` Simon Riggs <simon@2ndquadrant.com>
2005-02-06 17:32       ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-08 00:40         ` Simon Riggs <simon@2ndquadrant.com>
2007-02-19 16:19 log_duration? Ray Stell <stellr@cns.vt.edu>
2007-02-19 16:39 ` Re: log_duration? Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
2007-02-20 02:40 ` Re: log_duration? Tom Lane <tgl@sss.pgh.pa.us>

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