pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: mfatticcioni@mbigroup.it
Cc: pgsql-performance@postgresql.org
Subject: Re: DRBD and Postgres: how to improve the perfomance?
Date: Fri, 07 Sep 2007 11:12:06 +0100
Message-ID: <46E123F6.1000608@enterprisedb.com> (raw)
In-Reply-To: <46E11BE4.6060500@mbigroup.it>
References: <46E11BE4.6060500@mbigroup.it>

Maila Fatticcioni wrote:
> Hello.
> We have made some performance tests with DRBD and Postgresql 8.2.3. We
> have two identical servers in a cluster (Dell 2950) with a partition of
> 100 GB managed by DRBD: once we checked Postgres keeping his data folder
> in a local partition, the second time we moved the data folder in the
> shared partition. The two servers are connected point to point using a
> cross cable to reduce their latency.
> The partition is mounted with the option noatime in order to not update
> the inode access time in case of read access.
> We used pgbench for the testings, creating a dabase of about 3GB with a
> scale of 200. After we perfomed 10 tests for each configuration,
> simulating the usage of 100 clients with 500 transactions each.
> 
> DRBD configuration:
> --------------------------------------------------------------------------------------------
> resource drbd0 {
> 
>  protocol C;
>  incon-degr-cmd "halt -f";
> 
>  on db-node1 {
>    device     /dev/drbd0;
>    disk       /dev/sda2;
>    address    10.0.0.201:7788;
>    meta-disk  internal;
>   }
> 
>  on db-node2 {
>    device    /dev/drbd0;
>    disk      /dev/sda2;
>    address    10.0.0.202:7788;
>    meta-disk internal;
>   }
>  syncer {
>    rate 700000K;
>  }
> }
> --------------------------------------------------------------------------------------------
> 
> Pgbench
> 
> --------------------------------------------------------------------------------------------
> pgbench -i pgbench -s 200
> pgbench -c 100 -t 500 pgbench
> --------------------------------------------------------------------------------------------
> 
> The results were that the TPS (transaction per second) with Postgres
> running in the local partition is almost double than the one with the DRDB:
> 
> Postgres in shared DRBD partition: 60.863324 TPS
> Postgres in local partition: 122.016138 TPS
> 
> Obviously, working with the database in DRBD, we had two writes instead
> of only one but we are a bit disappointed about the low results. We
> would like to know if there is any way to improve the performance in
> order to have a 3/4 rate instead of the 1/2 one.

You seem to be limited by the speed you can fsync the WAL to the DRBD
device. Using a RAID controller with a battery-backed up cache in both
servers should help, with and without DRBD. You might find that the
difference between local and shared partition just gets bigger, but you
should get better numbers.

In 8.3, you could turn synchronous_commit=off, if you can accept the
loss of recently committed transactions in case of a crash.

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



view thread (28+ messages)  latest in thread

Message-ID: <46E123F6.1000608@enterprisedb.com>
Permalink:  ../46E123F6.1000608@enterprisedb.com/
Also on:    postgresql.org/message-id/46E123F6.1000608@enterprisedb.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: heikki@enterprisedb.com, mfatticcioni@mbigroup.it
  Subject: Re: DRBD and Postgres: how to improve the perfomance?
  In-Reply-To: <46E123F6.1000608@enterprisedb.com>

* 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