#/usr/pkg/bin/bash if [ $# -ne 1 ] then echo "Usage: ./pgbench.sh number_of_tests" exit 1 fi sysctl kern.usched_bsd4.upri_affinity=16 sysctl kern.usched_bsd4.queue_checks=5 sysctl kern.usched_bsd4.stick_to_level=0 for j in $(seq 5 5 120) do echo "############ Test with $j threads #############################" echo echo "############ enable cache_coherent, stick to core #############" sysctl kern.usched_bsd4.cache_coherent=1 for i in $(seq 1 $1) do pgbench -U pgsql -j $j -c $j -T 30 -S bench100 -h 127.0.0.1 2> /dev/null | grep "including connections establishing" done echo echo "############ disable cache_coherent ##########" sysctl kern.usched_bsd4.cache_coherent=0 for i in $(seq 1 $1) do pgbench -U pgsql -j $j -c $j -T 30 -S bench100 -h 127.0.0.1 2> /dev/null | grep "including connections establishing" done echo echo done