Lists: | pgsql-general |
---|
From: | "Abraham, Danny" <danny_abraham(at)bmc(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | HD is flooded by Error Log info |
Date: | 2007-11-29 15:53:09 |
Message-ID: | E9DE7963E5EA6546B42A979EC28B4D01368DB3F1@hou-ex-02.adprod.bmc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Hello
Recently an application endless loop crashed the PG server.
I am looking for the safest way to limit the growth of the all the
files in the "pg_log" directory,
While still maintain reasonable period of log.
Any suggestions?
Our current setup is:
#-----------------------------------------------------------------------
----
# ERROR REPORTING AND LOGGING
#-----------------------------------------------------------------------
----
redirect_stderr = on
log_line_prefix = '%m'
client_min_messages = error
log_min_messages = error
log_filename = 'CTMD-%d.log
log_truncate_on_rotation = on
log_rotation_age = 1d
log_rotation_size = 10MB
Thanks
Danny Abraham
BMC Software
CTM&D Business Unit
972-52-4286-513
danny_abraham(at)bmc(dot)com
From: | "Usama Dar" <munir(dot)usama(at)gmail(dot)com> |
---|---|
To: | "Abraham, Danny" <danny_abraham(at)bmc(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 16:03:14 |
Message-ID: | ff0e67090711290803o2efbff0bl1b36fac8e75ebd9@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
what i do is setup a cron job which runs daily or every second day, creates
a tar.gz and copies them to a seperate location, and then another cron job
which clears up archives more than one month old. That seems to be the way
to go, i don't think you will find a postgresql.conf parameter which does
that
On Nov 29, 2007 8:53 PM, Abraham, Danny <danny_abraham(at)bmc(dot)com> wrote:
> Hello
>
>
>
> Recently an application endless loop crashed the PG server.
>
> I am looking for the safest way to limit the growth of the all the files
> in the "pg_log" directory,
>
> While still maintain reasonable period of log.
>
>
>
> Any suggestions?
>
>
>
> Our current setup is:
>
>
>
>
> #---------------------------------------------------------------------------
>
> # ERROR REPORTING AND LOGGING
>
>
> #---------------------------------------------------------------------------
>
> redirect_stderr = on
>
> log_line_prefix = '%m'
>
> client_min_messages = error
>
> log_min_messages = error
>
>
>
> log_filename = 'CTMD-%d.log
>
> log_truncate_on_rotation = on
>
> log_rotation_age = 1d
>
> log_rotation_size = 10MB
>
>
>
>
>
> Thanks
>
>
>
>
>
> Danny Abraham
>
> BMC Software
>
> CTM&D Business Unit
>
> 972-52-4286-513
>
> danny_abraham(at)bmc(dot)com
>
>
>
>
>
--
Usama Munir Dar http://linkedin.com/in/usamadar
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar
From: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
---|---|
To: | "Abraham, Danny" <danny_abraham(at)bmc(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 16:20:30 |
Message-ID: | 1196353230.4246.1308.camel@ebony.site |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Thu, 2007-11-29 at 09:53 -0600, Abraham, Danny wrote:
> Recently an application endless loop crashed the PG server.
>
> I am looking for the safest way to limit the growth of the all the
> files in the “pg_log” directory,
>
> While still maintain reasonable period of log.
Sounds like we should have these features
- pg_log file archiving when we reach a certain volume/number of logs
- ability to set limits on the number of messages a single backend can
emit within a certain time period.
--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com
From: | Andrew Sullivan <ajs(at)crankycanuck(dot)ca> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 16:30:54 |
Message-ID: | 20071129163054.GL6226@crankycanuck.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Thu, Nov 29, 2007 at 04:20:30PM +0000, Simon Riggs wrote:
>
> - pg_log file archiving when we reach a certain volume/number of logs
IMO, by the time we get that complicated, admins need to start doing some
work. That is, I think, work that should be nowhere near the main
PostgreSQL code. If someone wants to set up a foundry project for nice
crontab suggestions and Windows scheduler suggestions (however that works),
that'd be rather another matter.
> - ability to set limits on the number of messages a single backend can
> emit within a certain time period.
Please, no. That sounds like a way to suppress useful error messages when
something Really Bad is happening. As it happens, that's when the flood of
messages is most important.
The general tone in this thread sounds like, "I don't have time to
administer this; help me." Providing such help is a bad idea.
A
--
Andrew Sullivan
Old sigs will return after re-constitution of blue smoke
From: | "Usama Dar" <munir(dot)usama(at)gmail(dot)com> |
---|---|
To: | "Simon Riggs" <simon(at)2ndquadrant(dot)com> |
Cc: | "Abraham, Danny" <danny_abraham(at)bmc(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 16:33:34 |
Message-ID: | ff0e67090711290833sdc9f350u2c1c71d4afc1439c@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
As far as automatic archiving is concerned the easiest would be to provide
something similar to "archive_command" , however i can't imagine how the
second suggestion could be useful, that sounds like pretty dangerous to me.
On Nov 29, 2007 9:20 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Thu, 2007-11-29 at 09:53 -0600, Abraham, Danny wrote:
>
> > Recently an application endless loop crashed the PG server.
> >
> > I am looking for the safest way to limit the growth of the all the
> > files in the "pg_log" directory,
> >
> > While still maintain reasonable period of log.
>
> Sounds like we should have these features
>
> - pg_log file archiving when we reach a certain volume/number of logs
>
> - ability to set limits on the number of messages a single backend can
> emit within a certain time period.
>
> --
> Simon Riggs
> 2ndQuadrant http://www.2ndQuadrant.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
--
Usama Munir Dar http://linkedin.com/in/usamadar
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar
From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Andrew Sullivan <ajs(at)crankycanuck(dot)ca>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 16:50:45 |
Message-ID: | 474EEDE5.3040304@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg토토 핫SQL : |
Andrew Sullivan wrote:
> On Thu, Nov 29, 2007 at 04:20:30PM +0000, Simon Riggs wrote:
>> - pg_log file archiving when we reach a certain volume/number of logs
>
> IMO, by the time we get that complicated, admins need to start doing some
> work. That is, I think, work that should be nowhere near the main
> PostgreSQL code. If someone wants to set up a foundry project for nice
> crontab suggestions and Windows scheduler suggestions (however that works),
> that'd be rather another matter.
Surely this is what logrotate and syslog-ng etc are for. This is a
sysadmin problem not a DBA problem - any service can generate a lot of logs.
--
Richard Huxton
Archonet Ltd
From: | Andrew Sullivan <ajs(at)crankycanuck(dot)ca> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 16:58:36 |
Message-ID: | 20071129165836.GO6226@crankycanuck.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Thu, Nov 29, 2007 at 04:50:45PM +0000, Richard Huxton wrote:
> Surely this is what logrotate and syslog-ng etc are for. This is a
> sysadmin problem not a DBA problem - any service can generate a lot of logs.
Yes. But some have complained those things aren't Postgres-centric enough.
I don't see how, but some have argued strongly. So I say, if there's a
demand, I've no objection to an add-on product (which could be especially
relevant if we get something like CPgAN); but not anything like additional
extensions to the existing logging infrastructure (what is there is nice,
because it provides things that the poastmaster alone may know; but
additions would be gilding the lily, except with pyrites).
A
--
Andrew Sullivan
Old sigs will return after re-constitution of blue smoke
From: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com> |
---|---|
To: | Andrew Sullivan <ajs(at)crankycanuck(dot)ca> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 17:04:30 |
Message-ID: | 20071129090430.016fe3a7@commandprompt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 29 Nov 2007 11:58:36 -0500
Andrew Sullivan <ajs(at)crankycanuck(dot)ca> wrote:
> On Thu, Nov 29, 2007 at 04:50:45PM +0000, Richard Huxton wrote:
> > Surely this is what logrotate and syslog-ng etc are for. This is a
> > sysadmin problem not a DBA problem - any service can generate a lot
> > of logs.
>
> Yes. But some have complained those things aren't Postgres-centric
> enough. I don't see how, but some have argued strongly. So I say, if
> there's a demand, I've no objection to an add-on product (which could
> be especially relevant if we get something like CPgAN); but not
> anything like additional extensions to the existing logging
> infrastructure (what is there is nice, because it provides things
> that the poastmaster alone may know; but additions would be gilding
> the lily, except with pyrites).
The only argument I have ever heard that seemed like a realistic issue
with using logrotate or syslog was tgl's. You can loose data in the log
when rotating if you aren't using the PostgreSQL logging facility.
Other than that I think our current logging situation is a bit
ridiculous. [1]
Joshua D. Drake
[1]
http://www.commandprompt.com/blogs/joshua_drake/2007/11/postgresql_logging_time_for_a_change/
>
> A
>
- --
=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997 http://www.commandprompt.com/
UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHTvEeATb/zqfZUUQRAn5gAKCEVbnJ3AND8uoxOyH10wMamgg76wCfUO9m
wKMFNGEyH25TFgAQe2xTuu8=
=DAHh
-----END PGP SIGNATURE-----
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andrew Sullivan <ajs(at)crankycanuck(dot)ca> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 17:48:35 |
Message-ID: | 16197.1196358515@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Andrew Sullivan <ajs(at)crankycanuck(dot)ca> writes:
> The general tone in this thread sounds like, "I don't have time to
> administer this; help me." Providing such help is a bad idea.
Actually, can't it be solved easily enough with suitable configuration
of the existing logging parameters? Just set things up so that log
files are recycled fairly quickly.
regards, tom lane
From: | Andrew Sullivan <ajs(at)crankycanuck(dot)ca> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: HD is flooded by Error Log info |
Date: | 2007-11-29 19:02:56 |
Message-ID: | 20071129190256.GW6226@crankycanuck.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Thu, Nov 29, 2007 at 12:48:35PM -0500, Tom Lane wrote:
> Andrew Sullivan <ajs(at)crankycanuck(dot)ca> writes:
> > The general tone in this thread sounds like, "I don't have time to
> > administer this; help me." Providing such help is a bad idea.
>
> Actually, can't it be solved easily enough with suitable configuration
> of the existing logging parameters? Just set things up so that log
> files are recycled fairly quickly.
If recycling is allowed, yes. I had the impression that some weren't
willing to do the recycle bits, though.
A
--
Andrew Sullivan
Old sigs will return after re-constitution of blue smoke