
ghenry at suretecsystems
Jul 30, 2005, 3:38 PM
Post #6 of 6
(1100 views)
Permalink
|
|
Re: Conceptual Setup - Apache and Postgresql
[In reply to]
|
|
On Saturday 30 Jul 2005 06:36, Alan Robertson wrote: > David Lang wrote: > > On Fri, 29 Jul 2005, Alan Robertson wrote: > >> I'm afraid I have to disagree here - because of information I have > >> which might not be correct. If my next sentence is incorrect, then by > >> all means correct me. > >> > >> It is my understanding that slony does not provide synchronous > >> replication (that is, it replicates asynchronously). > > > > slony does not cause the primary database to stall while the secondary > > is updateing, no. > > > > I wasn't aware that DRDB did this. > > > > there are several replication options available for postgres, some of > > which do offer syncronous updateing of all databases (however they > > useually have to talk to a gatekeeper box, which you have to make HA > > itself, and then that gatekeeper talks to the multiple database servers) > > > > you make good points, my general rule is don't use a filesystem level > > replication if there is an application level replication available > > > > in general the application level replication will be significantly more > > efficiant then a filesystem one, and (depending on how you have things > > setup) may also end up being more reliable. > > > > note that postgres does a _lot_ of syncs, forceing the machine to pause > > while the other system gets the data over the network and does a sync as > > well (and acknowledges that it has completed the sync over the network) > > is going to result in a significant performance hit. While you can turn > > off the use of fsync doing so seriously weakens your data reliability, > > you would be FAR better off with fsync on and async replication. > > > > David Lang > > > >> General rule: > >> Don't use asynchronous replication for a database over short distances > >> if synchronous replication is available. > >> > >> Otherwise you may lose transactions - at the very least risk working > >> from (and updating) an out of data database. DRBD is quite reliable > >> and has been around a good bit longer than slony. > >> > >> Asynchronous replication is great for longer distances, and smart > >> replication like databases perform is also great for longer distances. > >> > >> Since DRBD can by synchronous and (to my knowledge) slony can't, then > >> I'd go for synchronous when I can. > > DRBD with protocol C (I think that's the one) is synchronous. > > The worst case I've ever heard of for DRBD (when writes outnumbered > reads 10 to 1) was a 10% reduction in database throughput when doing > local replication. Actual measured write speed was reduced by 30% - but > even in this horrible case, the total throughput wasn't affected by that > much. [.Older versions of DRBD were faster, but then the current one > never does a full sync once set up]. > > On more normal workloads, there are at least 2 reads to every write. If > you take that more typical case you can see why DRBD overhead may not > even be measurable... > > Let's say you do 2 reads to every write, and you're performing 10 writes > per second. That means your local disk is seeing 30 I/Os per second > with the expected effect on head movement, etc. Now, the other side is > only seeing 10 I/Os per second over a network that's MUCH faster than > the disk (if you use gigabit which is cheap enough to do). > > So, it is _more_ than possible that the remote writes are completing on > average at least as fast as the local writes. If you have a high ratio > of reads to writes, they may be even completing faster than local writes > - because of shorter I/O queues, and less head movement. > > Your comments about it consuming less bandwidth (i.e., being more > efficient) are correct. But, if you have a dedicated gigabit link > between the machines, it may not be important. > > If filesystem level replication is less reliable than app-level > replication, then there's probably a bug somewhere - and it's probably > in the app (which probably can't recover properly from a crash). Thanks for all this. We'll take all your points on board. So it looks like DRDB is a good option. We will prove all this in the testing phase and let you know how it goes. Thanks. -- Kind Regards, Gavin Henry. Managing Director. T +44 (0) 1224 279484 M +44 (0) 7930 323266 F +44 (0) 1224 742001 E ghenry [at] suretecsystems Open Source. Open Solutions(tm). http://www.suretecsystems.com/ _______________________________________________ Linux-HA mailing list Linux-HA [at] lists http://lists.linux-ha.org/mailman/listinfo/linux-ha
|