testing HS/SR - performance difference primary vs. standby

From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: pgsql-testers(at)postgresql(dot)org
Subject: testing HS/SR - performance difference primary vs. standby
Date: 2010-04-08 21:19:38
Message-ID: 29917878e0efe02a50bbc400e6e4034e.squirrel@webmail.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-testers

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

Browse pgsql-testers by date

  From Date Subject
Next Message Erik Rijkers 2010-04-08 21:37:18 Re: testing HS/SR - performance difference primary vs. standby
Previous Message Josh Berkus 2010-04-05 01:03:53 Test-fest report