PDA

View Full Version : PostgreSQL Log Files



jschell
11-25-2008, 04:47 PM
After noticing that my hard drive space has been continually disappearing, I've figured out that PostgreSQL has been writing out an absurd amount of logging info to disk. My C:\Program Files\PostgreSQL\8.2\data\pg_log directory now holds 63GB worth of text files, mostly in 10MB chunks. It wrote out 390MB just yesterday.

Does anyone else experience this? Can I just delete these files? How do I fix this problem (I'd rather not loose 400MB worth of space every day, tyvm)?

jschell
11-25-2008, 04:56 PM
FYI for HM folks, here is the first few lines that seems to appear at the begining of each log file:


2008-11-24 23:55:51 ERROR: prepared statement "hhexecute" already exists
2008-11-24 23:55:51 STATEMENT:

PREPARE HHExecute (integer,text,text,character varying(50)) as INSERT INTO HandHistories Values ($1,$2,$3,$4);



PREPARE PHCashMiscExecute

(integer, integer,integer,smallint,smallint,

smallint,boolean,smallint,

integer,integer,integer,smallint,smallint,

smallint,smallint,boolean,boolean,boolean,

boolean,boolean,boolean,boolean,real,

real) AS INSERT INTO

PlayerHandsCashMisc

(playerhand_id, stacksize, effectivestacksize, seatnumber, offthebutton,

finalhandtype_id, ishero, sawflopastype_id,

betamountpreflop, callamountpreflop,postamountpreflop,totalbetsprefl op,totalcallspreflop,

zion
11-26-2008, 02:58 AM
I just deleted the pg_log files. See here http://208.109.95.123/forum/showthread.php?t=3252&highlight=postgresql .
However, to be cautious I compressed them via winrar first und kept the rar.

fabio
11-26-2008, 10:52 AM
You can delete the content of the pg_log folder

jschell
11-26-2008, 05:30 PM
You can delete the content of the pg_log folder
OK, thanks. Are the developers working on a fix for this problem? I'm getting these 10MB log files output about every 20 minutes.

HeinBloed
12-20-2008, 06:24 PM
I want to push this thread since the problem is still there.

Thankfully, I found out about it by accident. My log folder has grown to more than 2 GB after 2 weeks of usage of HoldemManager, compared to ~3 MB after many months of PT2 before...

Just disableing the logging with the proposed solution in the other thread (log_min_error_statement = log) only cures the visible symptoms. As you can see in the log, HM apparently tries to create lots of identical prepared statements over and over again, up to several times in a single minute


2008-12-16 20:12:40 ERROR: prepared statement "hhexecute" already exists
2008-12-16 20:12:40 STATEMENT:
PREPARE HHExecute (integer,text,text,character varying(50)) as INSERT INTO HandHistories Values ($1,$2,$3,$4);
PREPARE PHCashMiscExecute (...)
PREPARE PHCashMiscHeroExecute (...)
(...)

2008-12-16 20:12:46 ERROR: prepared statement "hhexecute" already exists
2008-12-16 20:12:46 STATEMENT:
PREPARE HHExecute (integer,text,text,character varying(50)) as INSERT INTO HandHistories Values ($1,$2,$3,$4);
PREPARE PHCashMiscExecute (...)
(...)

etc.


When I had auto import running on datamined hands, about 10 MB of log files were created for every 30 minutes. I bet that this also creates an unnecessary overhead in the DBMS and causes a slowdown.

Anyway, it's clearly not a feature but a bug which needs fixing.

jschell
12-20-2008, 06:37 PM
I found that you can edit your data\postgresql.conf file and set 'redirect_stderr = off' and it will stop creating the log files.