Re: PG Logging is Slow - Mailing list pgsql-performance

From Grega Bremec
Subject Re: PG Logging is Slow
Date
Msg-id 20041220044835.GA24979@lunik.p0f.net
Whole thread Raw
In response to PG Logging is Slow  (Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>)
List pgsql-performance
...and on Mon, Dec 20, 2004 at 03:17:11PM +1100, Theo Galanakis used the keyboard:
> Under postgres 7.3 logging is incredibly slow!
>
> I have applied the following settings:
>
> syslog = 2
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'
>
>  log_connections =  true
> log_duration =  true
> log_pid =  true
> log_statement =  true
> log_timestamp =  true
>
> This severely impacted the performance of our production system, a search
> page which took 1-3 seconds now takes over 30, is this normal?
>
> I need to get some performance indicators from our production db, however I
> cant turn on logging with such performance degradation.
>

Hi Theo,

One thing you should be sure about is that whichever logfile you have
configured for the local0 facility is being written to asynchronously.
Synchronous logging is REALLY expensive.

If you're using the standard syslogd, you can achieve that by prefixing
the filename in syslogd.conf with a dash. For example,

    local0.*        /var/log/postgresql.log

would become

    local0.*        -/var/log/postgresql.log

One other option would be to turn off syslog logging completely and let
postmaster take care of the log on its own, which may or may not be
possible for you, depending on the policy in effect (remote logging, etc.).

Hope this helped,
--
    Grega Bremec
    gregab at p0f dot net

Attachment

pgsql-performance by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PG Logging is Slow
Next
From: Michael Adler
Date:
Subject: Re: PG Logging is Slow