Scripts Benchmark PostgreSQL bash scripts linux
#!/bin/bash
DURATION=1800
for clients in 32 64 128 256
do
echo "CREATE DATABASE bench${clients}"
psql postgres -c "CREATE DATABASE bench${clients}"
pgbench -U user_db -i -s ${clients} bench${clients}
done
#--------------------------------
echo "fsync = on" > /postgresql/data/config.d/fsync
postgresql restart
for clients in 32 64 128 256
do
echo "RO ${clients} FSYNC ON"
pgbench -U user_db -j ${clients} -c ${clients} -T ${DURATION} -S bench${clients} -P1 > pgbench_ro_fsync_on_${clients}.log 2> proses_pgbench_ro_fsync_on_${clients}.log
sleep 60;
done
for clients in 32 64 128 256
do
echo "RW ${clients} FSYNC ON"
pgbench -U user_db -j ${clients} -c ${clients} -T ${DURATION} bench${clients} -P1 > pgbench_rw_fsync_on_${clients}.log 2> proses_pgbench_rw_fsync_on_${clients}.log
sleep 60;
done
#---------------------------------
echo "fsync = on" > /postgresql/data/config.d/fsync
postgresql restart
for clients in 32 64 128 256
do
echo "RO ${clients} FSYNC OFF"
pgbench -U user_db -j ${clients} -c ${clients} -T ${DURATION} -S bench${clients} -P1 > pgbench_ro_fsync_off_${clients}.log 2> proses_pgbench_ro_fsync_off_${clients}.log
sleep 60;
done
for clients in 32 64 128 256
do
echo "RW ${clients} FSYNC OFF"
pgbench -U user_db -j ${clients} -c ${clients} -T ${DURATION} bench${clients} -P1 > pgbench_rw_fsync_off_${clients}.log 2> proses_pgbench_rw_fsync_off_${clients}.log
sleep 60;
done
0 komentar
EmoticonEmoticon