Skip to content

Instantly share code, notes, and snippets.

@ZhouXing19
Created February 4, 2022 22:38
Show Gist options
  • Save ZhouXing19/dd2670f18e0844b463e22b6ed2a841c3 to your computer and use it in GitHub Desktop.
Save ZhouXing19/dd2670f18e0844b463e22b6ed2a841c3 to your computer and use it in GitHub Desktop.
diff --git a/scripts/gen/tpcc.sh b/scripts/gen/tpcc.sh
index c99761f..69ca4db 100644
--- a/scripts/gen/tpcc.sh
+++ b/scripts/gen/tpcc.sh
@@ -92,17 +92,22 @@ then
echo "done loading"
fi
+num_vcpu_per_node=$(cat /proc/cpuinfo | grep processor | wc -l)
+
if (( f_active == 0 ))
then
# Scale active warehouse count by f_active_per_core * number of CPUs.
- f_active=$(( f_active_per_core * $(cat /proc/cpuinfo | grep processor | wc -l) ))
+ f_active=$(( f_active_per_core * num_vcpu_per_node ))
if (( f_active > f_warehouses ))
then
f_active=0
fi
fi
+num_nodes=${#pgurls[@]}
+echo "num_nodes:$num_nodes, num_vcpu_per_node:$num_vcpu_per_node, conns=$((num_vcpu_per_node * num_nodes * 4))"
+
report="${logdir}/tpcc-results-$f_active.txt"
./cockroach workload run tpcc \
- --warehouses="$f_warehouses" --active-warehouses="$f_active" --ramp=5m --duration="$f_duration" --tolerate-errors --wait=0 \
+ --warehouses="$f_warehouses" --active-warehouses="$f_active" --conns=$((num_vcpu_per_node * num_nodes * 4)) --ramp=5m --duration="$f_duration" --tolerate-errors --wait=0 \
"${pgurls[@]}" > "$report"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment