views:

108

answers:

2

Hi,

I have recently had to install slony (version 2.0.2) at work. Everything works fine, however, my boss would like to lower the cpu usage on slave nodes during replication. Searching on the net does not reveal any blatantly obvious answers to this. Any suggestions that would help reduce CPU usage (or spread the update out over a longer period) would be very much appreciated!

A: 

The best way to reduce the CPU usage would be to put less data into the database :-)

Other than that, you can experiment with *sync_interval*. It may be what you're looking for.

Magnus Hagander
If you increase sync_interval, you might want to increase sync_group_maxsize as well; that combination should result in the server waking up less, but doing more each time, to lower overhead.Alternately, if the idea really is to "spread the update out over a longer period", you might increase sync_interval and decrease sync_group_maxsize instead, which may result in Slony slowly trickling updates in.
Greg Smith
A: 

Have you looked into general PostgreSQL tuning here? The server can waste a lot of CPU cycles doing redundant work if it's not given enough resources to work with, and the default config is extremely small. Tuning Your PostgreSQL Server is a useful guide here, shared_buffers and checkpoint_segments are the two parameters you might get some significant improvement from on a slave (many of the rest only really help for improving query time).

Greg Smith