[DRBD-user] DRBD and Postgres: how to improve the perfomance

Maila mfatticcioni at mbigroup.it
Mon Aug 27 10:20:30 CEST 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

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 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;       
   meta-disk  internal; 

 on db-node2 {
   device    /dev/drbd0;       
   disk      /dev/sda2;        
   meta-disk internal;         
 syncer {
   rate 700000K;


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 with a tuning of DRBD
in order to have a 3/4 rate instead of the 1/2 one.

We would really appreciate it if you could give us some feedback.
Thank you in advance,

Maila Fatticcioni
View this message in context: http://www.nabble.com/DRBD-and-Postgres%3A-how-to-improve-the-perfomance-tf4323527.html#a12312236
Sent from the DRBD - User mailing list archive at Nabble.com.

More information about the drbd-user mailing list