Skip to content

Commit 3f16123

Browse files
authored
Config docs (#37)
* config docs * space * space * shards
1 parent f6f5471 commit 3f16123

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,32 @@ Meow. PgBouncer rewritten in Rust, with sharding, load balancing and failover su
2727
See `Dockerfile` for example deployment using Docker. The pooler is configured to spawn 4 workers so 4 CPUs are recommended for optimal performance.
2828
That setting can be adjusted to spawn as many (or as little) workers as needed.
2929

30+
### Config
31+
32+
| **Name** | **Description** | **Examples** |
33+
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|
34+
| **`general`** | | |
35+
| `host` | The pooler will run on this host, 0.0.0.0 means accessible from everywhere. | `0.0.0.0` |
36+
| `port` | The pooler will run on this port. | `6432` |
37+
| `pool_size` | Maximum allowed server connections per pool. Pools are separated for each user/shard/server role. The connections are allocated as needed. | `15` |
38+
| `pool_mode` | The pool mode to use, i.e. `session` or `transaction`. | `transaction` |
39+
| `connect_timeout` | Maximum time to establish a connection to a server (milliseconds). If reached, the server is banned and the next target is attempted. | `5000` |
40+
| `healthcheck_timeout` | Maximum time to pass a health check (`SELECT 1`, milliseconds). If reached, the server is banned and the next target is attempted. | `1000` |
41+
| `ban_time` | Ban time for a server (seconds). It won't be allowed to serve transactions until the ban expires; failover targets will be used instead. | `60` |
42+
| `statsd_address` | StatsD host and port. Statistics will be sent there every 15 seconds. | `127.0.0.1:8125` |
43+
| | | |
44+
| **`user`** | | |
45+
| `name` | The user name. | `sharding_user` |
46+
| `password` | The user password in plaintext. | `hunter2` |
47+
| | | |
48+
| **`shards`** | Shards are numerically numbered starting from 0; the order in the config is preserved by the pooler to route queries accordingly. | `[shards.0]` |
49+
| `servers` | List of servers to connect to and their roles. A server is: `[host, port, role]`, where `role` is either `primary` or `replica`. | `["127.0.0.1", 5432, "primary"]` |
50+
| `database` | The name of the database to connect to. This is the same on all servers that are part of one shard. | |
51+
| **`query_router`** | | |
52+
| `default_role` | Traffic is routed to this role by default (round-robin), unless the client specifies otherwise. Default is `any`, for any role available. | `any`, `primary`, `replica` |
53+
| `query_parser_enabled` | Enable the query parser which will inspect incoming queries and route them to a primary or replicas. | `false` |
54+
| `primary_reads_enabled` | Enable this to allow read queries on the primary; otherwise read queries are routed to the replicas. | `true` |
55+
3056
## Local development
3157

3258
1. Install Rust (latest stable will work great).

0 commit comments

Comments
 (0)