pg.ddx.io  pgsql-testers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Rijkers <er@xs4all.nl>
To: pgsql-testers@postgresql.org
Subject: testing HS/SR - performance difference primary vs. standby
Date: Thu, 8 Apr 2010 23:19:38 +0200
Message-ID: <29917878e0efe02a50bbc400e6e4034e.squirrel@webmail.xs4all.nl> (raw)

What is the expected difference in (select-)
performance between a primary and standby? (v9.0)

I expected no difference, but I find large differences.

Here is one test:

On port 6566 is primary, on port 6566 slave.
They are both on an otherwise idle machine.

Initialize:
  pgbench -h /tmp -p 6565 -i -s 10000 replicas

Then, after waiting for the standby to catch up:

3x pgbench on primary:

pgbench -h /tmp -p 6565 -n -S -c 20 -T 900 replicas
  tps = 518.854079 (including connections establishing)
  tps = 563.715825 (including connections establishing)
  tps = 614.428721 (including connections establishing)

3x pgbench on standby:

pgbench -h /tmp -p 6566 -n -S -c 20 -T 900 replicas
  tps = 272.378369 (including connections establishing)
  tps = 287.080326 (including connections establishing)
  tps = 304.373053 (including connections establishing)


The postgresql.conf's are almost the same:

grep -Ev '^([[:space:]]*#)|(^$)' ...

pgsql.sr_primary/data/postgresql.conf:data_directory =
'/var/data1/pg_stuff/pg_installations/pgsql.sr_primary/data'
pgsql.sr_primary/data/postgresql.conf:port = 6565
pgsql.sr_primary/data/postgresql.conf:max_connections = 100
pgsql.sr_primary/data/postgresql.conf:shared_buffers = 32MB
pgsql.sr_primary/data/postgresql.conf:checkpoint_segments = 50
pgsql.sr_primary/data/postgresql.conf:archive_mode = 'on'
pgsql.sr_primary/data/postgresql.conf:archive_command= 'cp %p
/var/data1/pg_stuff/dump/replication_archive/%f'
pgsql.sr_primary/data/postgresql.conf:max_wal_senders = 5
pgsql.sr_primary/data/postgresql.conf:datestyle = 'iso, mdy'
pgsql.sr_primary/data/postgresql.conf:lc_messages = 'en_US.UTF-8'
pgsql.sr_primary/data/postgresql.conf:lc_monetary = 'en_US.UTF-8'
pgsql.sr_primary/data/postgresql.conf:lc_numeric = 'en_US.UTF-8'
pgsql.sr_primary/data/postgresql.conf:lc_time = 'en_US.UTF-8'
pgsql.sr_primary/data/postgresql.conf:default_text_search_config = 'pg_catalog.english'


pgsql.sr_slavery/data/postgresql.conf:data_directory =
'/var/data1/pg_stuff/pg_installations/pgsql.sr_slavery/data'
pgsql.sr_slavery/data/postgresql.conf:port = 6566
pgsql.sr_slavery/data/postgresql.conf:max_connections = 100
pgsql.sr_slavery/data/postgresql.conf:shared_buffers = 32MB
pgsql.sr_slavery/data/postgresql.conf:checkpoint_segments = 50
pgsql.sr_slavery/data/postgresql.conf:archive_mode = 'on'
pgsql.sr_slavery/data/postgresql.conf:archive_command= 'cp %p
/var/data1/pg_stuff/dump/replication_archive/%f'
pgsql.sr_slavery/data/postgresql.conf:max_wal_senders = 5
pgsql.sr_slavery/data/postgresql.conf:datestyle = 'iso, mdy'
pgsql.sr_slavery/data/postgresql.conf:lc_messages = 'en_US.UTF-8'
pgsql.sr_slavery/data/postgresql.conf:lc_monetary = 'en_US.UTF-8'
pgsql.sr_slavery/data/postgresql.conf:lc_numeric = 'en_US.UTF-8'
pgsql.sr_slavery/data/postgresql.conf:lc_time = 'en_US.UTF-8'
pgsql.sr_slavery/data/postgresql.conf:default_text_search_config = 'pg_catalog.english'


Is that large difference expected?  (what causes it?)


Thanks,

Erik Rijkers








view thread (2+ messages)  latest in thread

Message-ID: <29917878e0efe02a50bbc400e6e4034e.squirrel@webmail.xs4all.nl>
Permalink:  ../29917878e0efe02a50bbc400e6e4034e.squirrel@webmail.xs4all.nl/
Also on:    postgresql.org/message-id/29917878e0efe02a50bbc400e6e4034e.squirrel@webmail.xs4all.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-testers@postgresql.org
  Cc: er@xs4all.nl
  Subject: Re: testing HS/SR - performance difference primary vs. standby
  In-Reply-To: <29917878e0efe02a50bbc400e6e4034e.squirrel@webmail.xs4all.nl>
  References: <29917878e0efe02a50bbc400e6e4034e.squirrel@webmail.xs4all.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox