Re: Synchronous replication - patch status inquiry

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Dimitri Fontaine <dfontaine@hi-media.com>, Fujii Masao <masao.fujii@gmail.com>, Robert Haas <robertmhaas@gmail.com>, David Fetter <david@fetter.org>, Bruce Momjian <bruce@momjian.us>, fazool mein <fazoolmein@gmail.com>, pgsql-hackers@postgresql.org
Date: 2010-09-07T10:11:38Z
Lists: pgsql-hackers
On 07/09/10 12:47, Simon Riggs wrote:
> The WAL is sent from master to standby in 8192 byte chunks, frequently
> including multiple commits. From standby, one reply per chunk. If we
> need to wait for apply while nothing else is received, we do.

Ok, thank you. The obvious performance problem is that even if you 
define a transaction to use synchronization level 'recv', and there's no 
other concurrent transactions running, you actually need to wait until 
it's applied. If you have only one client, there is no difference 
between the levels, you always get the same performance hit you get with 
'apply'. With more clients, you get some benefit, but there's still 
plenty of delays compared to the optimum.

Also remember that there can be a very big gap between when a record is 
fsync'd and when it's applied, if the recovery needs to wait for a hot 
standby transaction to finish.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com