Re: Could synchronous streaming replication really degrade the performance of the primary?

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Could synchronous streaming replication really degrade the performance of the primary?
Date: 2012-05-09 22:46:51
Message-ID: CAGTBQpYtod6ee6km0=C+U5yL9Wy5_9Bo7Nm719ymA42-SggLSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, May 9, 2012 at 7:34 PM, MauMau <maumau307(at)gmail(dot)com> wrote:
>> I can't speak for other databases, but it's only natural to assume
>> that tps must drop.  At minimum, you have to add the latency of
>> communication and remote sync operation to your transaction time.  For
>> very short transactions this adds up to a lot of extra work relative
>> to the transaction itself.
>
>
> Yes, I understand it is natural for the response time of each transaction to
> double or more. But I think the throughput drop would be amortized among
> multiple simultaneous transactions. So, 50% throughput decrease seems
> unreasonable.

I'm pretty sure it depends a lot on the workload. Knowing the
methodology used that arrived to those figures is critical. Was the
thoughput decrease measured against no replication, or asynchronous
replication? How many clients were used? What was the workload like?
Was it CPU bound? I/O bound? Read-mostly?

We have asynchronous replication in production and thoughput has not
changed relative to no replication. I cannot see how making it
synchronous would change thoughput, as it only induces waiting time on
the clients, but no extra work. I can only assume the test didn't use
enough clients to saturate the hardware under high-latency situations,
or clients were somehow experiencing application-specific contention.

I don't know the code, but knowing how synchronous replication works,
I would say any such drop under high concurrency would be a bug,
contention among waiting processes or something like that, that needs
to be fixed.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Noah Misch 2012-05-10 08:20:39 Re: Any disadvantages of using =ANY(ARRAY()) instead of IN?
Previous Message MauMau 2012-05-09 22:34:04 Re: Could synchronous streaming replication really degrade the performance of the primary?