Postgresql – Is WAL Database log on separate disk good idea on RAID10

postgresql

I have a RAID10-Server and have Postgres writing the log(pg_xlog a.k.a WAL) onto the same RAID10-Array.

I use the WAL in sync-mode with a big buffer and do a lot of bulk inserts and updates, so that buffer is hopefully used.

Is it an good idea to split the log onto a extra disk, not in the raid10? I could stuff in a RAID with 2 disks, but would that really improve anything?

I looking forward if someone could name a few pros and cons.

Best Answer

You asked for pros and cons, the con that few people mention when giving the standard advice to separate out the logs is that it will slow your reads because you now have fewer spindles to dedicate to reads. Which way you go depends on the ratio of reads to writes in your database. If it is 99% read (say a web server scenario) then you may end up not gaining anything by separating out your logs.

The other possible gotcha that is rarely mentioned is that putting your logs on a separate spindle only gives you sequential writes if you only put a single databases logs on that spindle. If you have a server with 10 active databases then putting all of their logs on the same disk does not give you sequential writes, they will be spread about on the different log files. Then again putting them on 10 separate mirrored drives means you need to dedicate 20 drives to logs which also may not be possible. A good solution in this case is to use SSD storage for your log files which performs MUCH better on random writes when you find your environment just does not have sequential writes.