pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: achill@matrix <achill@matrix.gatewaynet.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: syslog performance when logging big statements
Date: Wed, 9 Jul 2008 15:31:05 +0300
Message-ID: <200807091531.05372.achill@matrix.gatewaynet.com> (raw)
In-Reply-To: <12596.1215542041@sss.pgh.pa.us>
References: <200807081524.47366.achill@matrix.gatewaynet.com>
	<200807081821.57935.achill@matrix.gatewaynet.com>
	<12596.1215542041@sss.pgh.pa.us>

Στις Tuesday 08 July 2008 21:34:01 ο/η Tom Lane έγραψε:
> Achilleas Mantzios <achill@matrix.gatewaynet.com> writes:
> > Στις Tuesday 08 July 2008 17:35:16 ο/η Tom Lane έγραψε:
> >> Hmm.  There's a function in elog.c that breaks log messages into chunks
> >> for syslog.  I don't think anyone's ever looked hard at its performance
> >> --- maybe there's an O(N^2) behavior?
> >
> > Thanx,
> > i changed PG_SYSLOG_LIMIT in elog.c:1269 from 128 to 1048576
> > and i got super fast stderr performance. :)
>
> Doesn't seem like a very good solution given its impact on the stack
> depth right there.
>
> Looking at the code, the only bit that looks like repeated work are the
> repeated calls to strchr(), which would not be an issue in the "typical"
> case where the very long message contains reasonably frequent newlines.
> Am I right in guessing that your problematic statement contained
> megabytes worth of text with nary a newline?

Yes it was the input source of a bytea field containing tiff or pdf data,
of size of some 1-3 megabytes, and it did not contain (many) newlines.

>
> If so, we can certainly fix it by arranging to remember the last
> strchr() result across loop iterations, but I'd like to confirm the
> theory before doing that work.
>
> 			regards, tom lane





view thread (12+ messages)  latest in thread

Message-ID: <200807091531.05372.achill@matrix.gatewaynet.com>
Permalink:  ../200807091531.05372.achill@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/200807091531.05372.achill@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: achill@matrix.gatewaynet.com, tgl@sss.pgh.pa.us
  Subject: Re: syslog performance when logging big statements
  In-Reply-To: <200807091531.05372.achill@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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