Skip to content

Commit f137b3e

Browse files
Lev Kokotovgitbook-bot
authored andcommitted
GITBOOK-58: change request with no subject merged in GitBook
1 parent f27b3a5 commit f137b3e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pgml-docs/docs/guides/deployment/self-hosting/replication.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,17 @@ PostgresML uses regular Postgres tables to store the data required for its opera
220220
PostgresML integrates with HuggingFace which stores its cache in `/var/lib/postgresql/.cache` folder. That folder is not replicated because it lives outside the Postgres WAL system. When you try to use `pgml.embed()` or `pgml.transform()` on the replica for the first time, it will need to download the models from the HuggingFace repository. Once downloaded, it will continue to operate just like the primary.
221221

222222
The cache can be preemptively transferred to the replica in order to minimize cold start time. Any file transfer tool can be used, e.g. `rsync` or `scp`. The HuggingFace cache is identical on all machines in a PostgresML cluster.
223+
224+
### Pooler
225+
226+
If you're using a pooler to load balance your traffic and have followed our Pooler installation guide, you can add your newly created replica to the pooler configuration. With PgCat, it's as easy as:
227+
228+
```toml
229+
[pools.postgresml.shards.0]
230+
servers = [
231+
["<primary host or IP address>", 5432, "primary"],
232+
["<replica host or IP address>", 5432, "replica"],
233+
]
234+
```
235+
236+
Reload the config by running `kill -SIGHUP $(pgrep pgcat)` and you can now connect to the pooler and automatically load balance your queries against both the primary and the replica.

0 commit comments

Comments
 (0)