Marcin migor
Sat Jan 29 20:34:33 PST 2005
Hi,
I'm looking for the best replication solution for my PostgreSQL server. 
So far I'm using the dbmirror, and with a help from Steven Singer at the 
  beginning I managed to get it running smoothly, and it saved my data a 
few times. Unfortunately the biggest issue with dbmirrir is the 
replication performance impact.

The main PostgreSQL server is Dual Xeon 3.0GHz with 4GB of RAM, and RAID 
1 array (which is going to be upgraded to RAID 10 soon). The PostgreSQL 
database cluster consists of about 150 databases with nearly identical 
schemes. Each database has about 500-600 tables, and the total size of 
cluster is about 14GBs. There is about 300000-500000 queries a day 
(mostly during business hours) and about 80% of them are SELECTs.
The main backup server is Dual Xeon 2.8GHz, 2GBs RAM, SCSI RAID1 array. 
It's running 300s copies of DBMirror.pl (two for each replicated 
database). For each DB, one DBMirror.pl sends queries to local 
PostgreSQL engine, and another writes transactions into separate files 
for sending them to remote PostgreSQL server and for auditing.

The load on backup server rarely exceeds 0.2, however the main server 
during business hours has constant load well over 2. A small 
investigation showed, that there's quite big slowdown with queries 
modifying tables with large number of records. The dbmirror replication 
translates the query 'UPDATE table set col=2 where col>2' matching 2000 
records into 2000 single operations in it's internal tables, and it 
really extends the query execution time.

Getting to the point, I'm looking for new, faster, real-time replication 
solution for mission critical server. At present I consider two option.
The first one is PostgreSQL 8.0 PITR feature.
Pro:
*)no negative impact on performance,
*)very simple setup for large number of databases with large number of 
tables,
*)replicates schema changes in existing tables,
Con:
*) the initial (and later) synchronization takes lots of time in WAN 
environment (even with rsync help).
*) I'm not sure if it can be called 'real time' - especially when 
checkpoints occurs rarely, and there's some numbers of transactions 
written to pg_xlog/* not archived yet. I know I can get pg_xlog contents 
every minute, and apply it only in case of failure, but I don't know if 
it's safe.

The second option is Slony-I. I gave it a try, and it seems to work 
nicely. However, before I go into deep tests, I'd like to know if I 
could get a better performance with it than with dbmirror (as it's also 
trigger based)? Does anyone use Slony-I in similar environment? Perhaps 
in my setup it's better to go with PITR?

Thanks for help,
-- 
Marcin


More information about the Slony1-general mailing list