Re: Log file to sql database

From: Doug McNaught <doug(at)wireboard(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Log file to sql database
Date: 2001-04-03 03:51:15
Message-ID: m3pueuiqto.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

KuroiNeko <evpopkov(at)carrier(dot)kiev(dot)ua> writes:

> > I am not sure I understand the implications of the piping it to the
> > insert
> > routine.
>
> It's a double-edged sword. Invoking it is as simple as adding a line to a
> conf file, while developing it may turn out to be tricky. At least make
> sure you examine output of ps ax to see how much CPU time it uses.
> And if you pipe it to a script, you'll have an interpreter loaded and
> sitting there wasting your RAM.

Also, if your pipe reader slows down too much, syslogd will start
blocking on the pipe, which will slow down the whole system (syslogd
generally isn't multi-threaded). So I think it'd be much safer to
have a flat text logfile and have your program read from that (using
similar code to 'tail -f', as was suggested earlier). That way if you
fall behind during a busy period you can catch up once things ease up,
and syslogd doesn't kill your whole system.

As for the interpreter issue, well, I'd rather spend the memory and
use a language that is designed for string-slinging. Using Perl or
Python to parse things is *so* much easier than C (even with a good
regex library available).

As always, just MHO...

-Doug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message KuroiNeko 2001-04-03 04:11:07 Re: Log file to sql database
Previous Message KuroiNeko 2001-04-03 03:26:45 RE: Log file to sql database