Re: BUG #18724: High data disk utilization during log writing - Mailing list pgsql-bugs

From Иван Ситников
Subject Re: BUG #18724: High data disk utilization during log writing
Date
Msg-id CALGD1RmxQVYtvsBQWdG0V9Wn8WjSpt2ucaJSVsZEgGrwgfCSag@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18724: High data disk utilization during log writing  (Christophe Pettus <xof@thebuild.com>)
List pgsql-bugs
Thank you for your reply. I think I'm close to solving the mystery.
As a result of the research, I found that in addition to recording logs, there is also a record in the pgss_query_texts.stat file, which is located in the data directory. 
And at the moment, this is what I consider to be the reason for the high utilization of the data disk.
But this file is not used at all if I unload pg_stat_statements module from shared_preload_libraries

пн, 25 нояб. 2024 г. в 19:47, Christophe Pettus <xof@thebuild.com>:


> On Nov 25, 2024, at 04:26, PG Bug reporting form <noreply@postgresql.org> wrote:
> The lsof utility did not help in investigating this problem, as did
> restarting the server
> Setting log_min_duration_statement = -1 shows a significant decrease in the
> load on the data disk
> So I can't assume why data disk (/dev/vdb1 /data) utilized up to 60-80%
> while statements are logged to separate block device (/dev/vdc1
> /var/log/postgresql) and need some help to get off the ground

The question seems to answer itself here: You are logging every statement to the text logs, and it is very likely that the lines in the text log are larger than the actual data for that statement being written to the data disk.  It can be very expensive to log every statement, especially when you have a significant query load (which you do here).

pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Build failure with GCC 15 (defaults to -std=gnu23)
Next
From: Thomas Munro
Date:
Subject: Re: pg_rewind fails on Windows where tablespaces are used