#!/bin/bash

# Durability settings performance

# Not supported by Membase as of 12/09/2010 (see http://forums.membase.org/thread/data-loss-membase )

if [ $DATABASE == "rethinkdb" ]; then
    ./dbench                                                                              \
        -d "$BENCH_DIR/bench_output/Strong_durability_(canonical_workload)" -H $SERVER_HOSTS       \
        {server}rethinkdb:"--wait-for-flush y --flush-timer 50 -m 32768 $SSD_DRIVES" \
        {client}stress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION"                       \
        iostat:1 vmstat:1 rdbstat:1
elif [ $DATABASE == "mysql" ]; then
    ./dbench                                                                              \
        -d "$BENCH_DIR/bench_output/Strong_durability_(canonical_workload)" -H $SERVER_HOSTS       \
        {server}mysql:"$MYSQL_COMMON_FLAGS $MYSQL_BUFFER_FLAGS --innodb_flush_log_at_trx_commit=1 --innodb_doublewrite=1 $MYSQL_SSD_FLAGS"   \
        {client}mysqlstress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION"                  \
        iostat:1 vmstat:1
else
    echo "No workload configuration for $DATABASE"
fi
