Thank-you Grega,
I ended up using the pg_ctl -l parameter to write the output to a
specified file. Much quicker to do so.
I tried the -/var/log/postgresql.log option however I noticed no
performance improvement. May be the fact that we use redhad linux and
syslog, I'm no sys-admin, so I'm not sure if there is a difference between
syslogd and syslog.
Theo
-----Original Message-----
Sent: Monday, 20 December 2004 3:49 PM
To: Theo Galanakis
Cc: pgsql-performance@no-spam
...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
______________________________________________________________________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=
=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version=
5.5.2654.45">
<TITLE>RE: [PERFORM] PG Logging is Slow</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Thank-you Grega,</FONT>
</P>
<P> <FONT SIZE=3D2>I ended up=
using the pg_ctl -l parameter to write the output to a specified file.=
Much quicker to do so.</FONT>
</P>
<P> <FONT SIZE=3D2>I tried the=
-/var/log/postgresql.log option however I noticed no performance=
improvement. May be the fact that we use redhad linux and syslog, I'm no=
sys-admin, so I'm not sure if there is a difference between syslogd and=
syslog.</FONT></P>
<P><FONT SIZE=3D2>Theo</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Grega Bremec [<A HREF=
=3D"mailto:gregab@no-spam">mailto:gregab@no-spam</A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Monday, 20 December 2004 3:49 PM</FONT>
<BR><FONT SIZE=3D2>To: Theo Galanakis</FONT>
<BR><FONT SIZE=3D2>Cc: pgsql-performance@no-spam</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [PERFORM] PG Logging is Slow</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>...and on Mon, Dec 20, 2004 at 03:17:11PM +1100, Theo=
Galanakis used the keyboard:</FONT>
<BR><FONT SIZE=3D2>> Under postgres 7.3 logging is incredibly=
slow!</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> I have applied the following settings:</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> syslog =3D 2</FONT>
<BR><FONT SIZE=3D2>> syslog_facility =3D 'LOCAL0'</FONT>
<BR><FONT SIZE=3D2>> syslog_ident =3D 'postgres'</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> log_connections =3D true</FONT>
<BR><FONT SIZE=3D2>> log_duration =3D true </FONT>
<BR><FONT SIZE=3D2>> log_pid =3D true </FONT>
<BR><FONT SIZE=3D2>> log_statement =3D true </FONT>
<BR><FONT SIZE=3D2>> log_timestamp =3D true </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> This severely impacted the performance of our=
production system, a </FONT>
<BR><FONT SIZE=3D2>> search page which took 1-3 seconds now takes over=
30, is this normal?</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> I need to get some performance indicators from our=
production db, </FONT>
<BR><FONT SIZE=3D2>> however I cant turn on logging with such=
performance degradation.</FONT>
<BR><FONT SIZE=3D2>> </FONT>
</P>
<P><FONT SIZE=3D2>Hi Theo,</FONT>
</P>
<P><FONT SIZE=3D2>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.</FONT></P>
<P><FONT SIZE=3D2>If you're using the standard syslogd, you can achieve=
that by prefixing the filename in syslogd.conf with a dash. For=
example,</FONT></P>
<P><FONT SIZE=3D2> local0.* =
/var/log/postgresql.log</FONT>
</P>
<P><FONT SIZE=3D2>would become</FONT>
</P>
<P><FONT SIZE=3D2> local0.* =
-/var/log/postgresql.log</FONT>
</P>
<P><FONT SIZE=3D2>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.).</FONT></P>
<P><FONT SIZE=3D2>Hope this helped,</FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2> Grega Bremec</FONT>
<BR><FONT SIZE=3D2> gregab at p0f dot net</FONT>
</P>
</BODY>
</HTML>
<table><tr><td bgcolor=3D#ffffff><font color=
=3D#000000>________________________________________________________________=
______<br>
This email, including attachments, is intended only for the addressee<br>
and may be confidential, privileged and subject to copyright. If you<br>
have received this email in error, please advise the sender and delete<br>
it. If you are not the intended recipient of this email, you must not<br>
use, copy or disclose its content to anyone. You must not copy or <br>
communicate to others content that is confidential or subject to <br>
copyright, unless you have the consent of the content owner.<br>
</font></td></tr></table>
Theo,
> I tried the -/var/log/postgresql.log option however I noticed no
> performance improvement. May be the fact that we use redhad linux and
> syslog, I'm no sys-admin, so I'm not sure if there is a difference
between
> syslogd and syslog.
Did you restart syslogd (that's the server process implementing the
syslog (= system log) service) after you changed its configuration?
In order to do so, try running
/etc/init.d/syslog restart
as root from a commandline.
HTH
Alex
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster