thebengeu / simple-supabase-benchmarks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Supabase Benchmarks

Prerequisites

Setup

export PGDATABASE=postgresql://postgres:<password>@db.<project-id>.supabase.co:5432/postgres
pgbench --initialize --init-steps dtGvp --scale 200
psql $PGDATABASE <init.sql

Benchmarking PostgreSQL using pgbench

pgbench --builtin simple-update --client $(expr $(psql $PGDATABASE -c 'show max_connections' -t -A) / 4) --jobs $(getconf _NPROCESSORS_ONLN) --progress 10 --protocol prepared --time 180

Benchmarking Supabase REST API using k6

export SUPABASE_URL=https://<project-id>.supabase.co
export SUPABASE_KEY=<anon-key>
psql $PGDATABASE -c 'set statement_timeout = 0' -c 'truncate pgbench_history' -c 'vacuum analyze' && k6 run simple-update.js

There are also:

  • select-only.js, based on pgbench --builtin select-only.
  • tpcb-like.js, based on pgbench --builtin tpcb-like.

Cleanup

pgbench --initialize --init-steps d

About


Languages

Language:JavaScript 69.2%Language:PLpgSQL 30.8%