Skip to content

Instantly share code, notes, and snippets.

@gokhangulbiz
Created April 26, 2023 13:42
Show Gist options
  • Save gokhangulbiz/7a2308470597dc06734ff7c08f87c656 to your computer and use it in GitHub Desktop.
Save gokhangulbiz/7a2308470597dc06734ff7c08f87c656 to your computer and use it in GitHub Desktop.
Tenant stats performance benchmarking
#!/bin/bash
set -eux
citus_dev make test --destroy --size=0 --port=9900
echo 'max_connections = 1000' >> test/coordinator/postgresql.conf
psql -p 9900 -c "ALTER SYSTEM SET citus.stat_tenants_track = 'all';"
pg_ctl -D test/coordinator -o "-p 9900" -l coordinator_logfile restart
pgbench -i -p 9900
psql -p 9900 -c "SELECT citus_set_node_property('localhost', 9900, 'shouldhaveshards', true);"
psql -p 9900 -c "SELECT create_distributed_table('pgbench_accounts', 'aid');"
pgbench -p 9900 -c 32 -j 32 -b select-only -T 20
pgbench -p 9900 -c 300 -j 300 -b select-only -T 20
psql -p 9900 -c "ALTER SYSTEM SET citus.stat_tenants_track = 'none';"
pg_ctl -D test/coordinator -o "-p 9900" -l coordinator_logfile restart
pgbench -p 9900 -c 32 -j 32 -b select-only -T 20
pgbench -p 9900 -c 300 -j 300 -b select-only -T 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment