Codync
A free, open-source 1:1 alternative to Grok Bot and Muse. Message Claude Code, Codex, Cursor and 40+ coding agents as persistent bots from your iPhone, Mac or Linux desktop. Group chats, threads, appr
Find the number of clients that gives PostgreSQL the maximum TPS with minimal latency
Developer toolsGitHub @pgvillage-toolsOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Repository information has not been collected yet.
No updates detected yet. GitHub releases will appear here.
find optimal value for number of threads for a typical PG deployment
Translation pending
Taken from the repository README
Loading the full README.
Read the full README ↗pg_tps_optimizer finds the number of clients that gives PostgreSQL the most transactions per second (TPS), at the lowest latency.
It runs a workload with an increasing number of clients (1, 2, 3, 5, 8, 13, ...), waits until TPS and latency are stable for each step, and reports them, so you can see how your setup responds to more clients:
| Date time | Clients | TPS | Latency | TPS/Latency |
| | | | (usec) | |
|---------------------|---------|---------------|-----------|-------------|
| 2023-05-18 06:40:20 | 1 | 9041.345 | 221.0 | 40.911 |
| 2023-05-18 06:40:27 | 5 | 19727.549 | 516.0 | 38.232 |
| 2023-05-18 06:40:32 | 13 | 23098.930 | 1125.0 | 20.532 |
| 2023-05-18 06:40:42 | 55 | 19289.153 | 6025.0 | 3.202 |
Download the binary for your platform from the releases, and run:
pg_tps_optimizer --dsn 'host=db1.example.com user=postgres dbname=postgres' --range 200
or use the container image:
docker run --rm -e PGHOST=db1.example.com -e PGUSER=postgres -e PGPASSWORD=secret \
ghcr.io/pgvillage-tools/pg_tps_optimizer --range 200
Note: by default, pg_tps_optimizer creates a small table (pg_tps_optimizer) in the database it
connects to (dropped after the run), and generates as much load as the server can handle. With
--query, it runs your own query instead.
The documentation is at https://pgvillage-tools.github.io/pg_tps_optimizer/
(sources in docs/):
pg_tps_optimizer is open source, under the GNU General Public License v3.0.
We are always open to contributions: