Skip to content

Commit affb2cd

Browse files
authored
Update Server Deployment guide for pipelines (#3745)
1 parent 2d1f647 commit affb2cd

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

docs/docs/guides/server-deployment.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ To store the server state in Postgres, set the `DSTACK_DATABASE_URL` environment
135135
$ DSTACK_DATABASE_URL=postgresql+asyncpg://user:password@db-host:5432/dstack dstack server
136136
```
137137

138+
The minimum requirements for the DB instance are 2 CPU, 2GB of RAM, and at least 50 `max_connections` per server replica
139+
or a configured connection pooler to handle that many connections.
140+
If you're using a smaller DB instance, you may need to set lower `DSTACK_DB_POOL_SIZE` and `DSTACK_DB_MAX_OVERFLOW`, e.g.
141+
`DSTACK_DB_POOL_SIZE=10` and `DSTACK_DB_MAX_OVERFLOW=0`.
142+
138143
??? info "Migrate from SQLite to PostgreSQL"
139144
You can migrate the existing state from SQLite to PostgreSQL using `pgloader`:
140145

@@ -456,26 +461,14 @@ Backward compatibility is maintained based on these principles:
456461

457462
## Server limits
458463

459-
A single `dstack` server replica can support:
460-
461-
* Up to 150 active runs.
462-
* Up to 150 active jobs.
463-
* Up to 150 active instances.
464-
465-
Having more active resources will work but can affect server performance.
466-
If you hit these limits, consider using Postgres with multiple server replicas.
467-
You can also increase processing rates of a replica by setting the `DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR` environment variable.
468-
You should also increase `DSTACK_DB_POOL_SIZE` and `DSTACK_DB_MAX_OVERFLOW` proportionally.
469-
For example, to increase processing rates 4 times, set:
464+
A single `dstack` server replica can support at least
470465

471-
```
472-
export DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR=4
473-
export DSTACK_DB_POOL_SIZE=80
474-
export DSTACK_DB_MAX_OVERFLOW=80
475-
```
466+
* 1000 active instances
467+
* 1000 active runs
468+
* 1000 active jobs.
476469

477-
You have to ensure your Postgres installation supports that many connections by
478-
configuring [`max_connections`](https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS) and/or using connection pooler.
470+
If you hit server performance limits, try scale up server instances and/or configure Postgres with multiple server replicas.
471+
Also, please [submit a GitHub issue](https://github.com/dstackai/dstack/issues) describing your setup – we strive to improve `dstack` scalability and efficiency.
479472

480473
## Server upgrades
481474

0 commit comments

Comments
 (0)