Forum OpenACS Q&A: Response to PostgreSQL and Journaling FS

Collapse
Posted by Roberto Mello on
From the PostgreSQL documentation (http://www.postgresql.org/idocs/index.php?wal.html):

"Briefly, WAL's central concept is that changes to data files (where tables
and indices reside) must be written only after those changes have been logged - that is, when log records have been
flushed to permanent storage. When we follow this procedure, we do not need to flush data pages to disk on every
transaction commit, because we know that in the event of a crash we will be able to recover the database using the log"

"The first obvious benefit of using WAL is a significantly reduced number of disk writes, since only the log file needs to be
flushed to disk at the time of transaction commit; in multi-user environments, commits of many transactions may be
accomplished with a single fsync() of the log file. Furthermore, the log file is written sequentially, and so the cost of
syncing the log is much less than the cost of flushing the data pages."

What I've read on other threads is that if you are going to use a Journaled File System (and it is a good idea to do so), then you should put the PostgreSQL WAL file in a different, non-journaled partition to avoid double-logging.

Aynone would like to expand?