|
1460 | 1460 | </ul> |
1461 | 1461 | </nav> |
1462 | 1462 |
|
| 1463 | +</li> |
| 1464 | + |
| 1465 | + <li class="md-nav__item"> |
| 1466 | + <a href="#ssh-proxy" class="md-nav__link"> |
| 1467 | + <span class="md-ellipsis"> |
| 1468 | + |
| 1469 | + <span class="md-typeset"> |
| 1470 | + SSH proxy |
| 1471 | + </span> |
| 1472 | + |
| 1473 | + </span> |
| 1474 | + </a> |
| 1475 | + |
1463 | 1476 | </li> |
1464 | 1477 |
|
1465 | 1478 | <li class="md-nav__item"> |
|
4577 | 4590 | </ul> |
4578 | 4591 | </nav> |
4579 | 4592 |
|
| 4593 | +</li> |
| 4594 | + |
| 4595 | + <li class="md-nav__item"> |
| 4596 | + <a href="#ssh-proxy" class="md-nav__link"> |
| 4597 | + <span class="md-ellipsis"> |
| 4598 | + |
| 4599 | + <span class="md-typeset"> |
| 4600 | + SSH proxy |
| 4601 | + </span> |
| 4602 | + |
| 4603 | + </span> |
| 4604 | + </a> |
| 4605 | + |
4580 | 4606 | </li> |
4581 | 4607 |
|
4582 | 4608 | <li class="md-nav__item"> |
@@ -4899,6 +4925,10 @@ <h3 id="postgresql">PostgreSQL<a class="headerlink" href="#postgresql" title="Pe |
4899 | 4925 | <p>To store the server state in Postgres, set the <code>DSTACK_DATABASE_URL</code> environment variable:</p> |
4900 | 4926 | <div class="highlight"><pre><span></span><code>$<span class="w"> </span><span class="nv">DSTACK_DATABASE_URL</span><span class="o">=</span>postgresql+asyncpg://user:password@db-host:5432/dstack<span class="w"> </span>dstack<span class="w"> </span>server |
4901 | 4927 | </code></pre></div> |
| 4928 | +<p>The minimum requirements for the DB instance are 2 CPU, 2GB of RAM, and at least 50 <code>max_connections</code> per server replica |
| 4929 | +or a configured connection pooler to handle that many connections. |
| 4930 | +If you're using a smaller DB instance, you may need to set lower <code>DSTACK_DB_POOL_SIZE</code> and <code>DSTACK_DB_MAX_OVERFLOW</code>, e.g. |
| 4931 | +<code>DSTACK_DB_POOL_SIZE=10</code> and <code>DSTACK_DB_MAX_OVERFLOW=0</code>.</p> |
4902 | 4932 | <details class="info"> |
4903 | 4933 | <summary>Migrate from SQLite to PostgreSQL</summary> |
4904 | 4934 | <p>You can migrate the existing state from SQLite to PostgreSQL using <code>pgloader</code>:</p> |
@@ -5088,6 +5118,16 @@ <h3 id="gcs">GCS<a class="headerlink" href="#gcs" title="Permanent link">¶< |
5088 | 5118 | storage.objects.update |
5089 | 5119 | </code></pre></div> |
5090 | 5120 | </details> |
| 5121 | +<h2 id="ssh-proxy">SSH proxy<a class="headerlink" href="#ssh-proxy" title="Permanent link">¶</a></h2> |
| 5122 | +<p><a href="https://github.com/dstackai/sshproxy"><code>dstack-sshproxy</code></a> is an optional component that provides direct SSH access to workloads.</p> |
| 5123 | +<p>Without SSH proxy, in order to connect to a job via SSH or use an IDE URL, the <code>dstack attach</code> CLI command must be used, which configures user's SSH client in a backend-specific way for each job.</p> |
| 5124 | +<p>When SSH proxy is deployed, there is one well-known entry point – a proxy address – for all <code>dstack</code> jobs, which can be used for SSH access without any additional steps on the user's side (such as installing <code>dstack</code> and executing <code>dstack attach</code> each time). All the user has to do is to upload their public key to the <code>dstack</code> server once – there is a dedicated “SSH keys” tab on the user's page of the control plane UI.</p> |
| 5125 | +<p>To deploy SSH proxy, see <code>dstack-sshproxy</code> <a href="https://github.com/dstackai/sshproxy/blob/main/DEPLOYMENT.md">Deployment guide</a>.</p> |
| 5126 | +<p>To enable SSH proxy integration on the <code>dstack</code> server side, set the following environment variables:</p> |
| 5127 | +<ul> |
| 5128 | +<li><code>DSTACK_SSHPROXY_API_TOKEN</code> – a token used to authenticate SSH proxy API requests, must be the same value as when deploying <code>dstack-sshproxy</code>.</li> |
| 5129 | +<li><code>DSTACK_SERVER_SSHPROXY_ADDRESS</code> – an address where SSH proxy is available to <code>dstack</code> users, in the <code>HOSTNAME[:PORT]</code> form, where <code>HOSTNAME</code> is a domain name or an IP address, and <code>PORT</code>, if not specified, defaults to 22.</li> |
| 5130 | +</ul> |
5091 | 5131 | <h2 id="encryption">Encryption<a class="headerlink" href="#encryption" title="Permanent link">¶</a></h2> |
5092 | 5132 | <p>By default, <code>dstack</code> stores data in plaintext. To enforce encryption, you |
5093 | 5133 | specify one or more encryption keys.</p> |
@@ -5175,23 +5215,14 @@ <h2 id="backward-compatibility">Backward compatibility<a class="headerlink" href |
5175 | 5215 | <li>The client backward compatibility is maintained across patch releases. A new minor release indicates that the release breaks client backward compatibility. This means you don't need to update the server when you update the client to a new patch release. Still, upgrading a client to a new minor version requires upgrading the server too.</li> |
5176 | 5216 | </ul> |
5177 | 5217 | <h2 id="server-limits">Server limits<a class="headerlink" href="#server-limits" title="Permanent link">¶</a></h2> |
5178 | | -<p>A single <code>dstack</code> server replica can support:</p> |
| 5218 | +<p>A single <code>dstack</code> server replica can support at least</p> |
5179 | 5219 | <ul> |
5180 | | -<li>Up to 150 active runs.</li> |
5181 | | -<li>Up to 150 active jobs.</li> |
5182 | | -<li>Up to 150 active instances.</li> |
| 5220 | +<li>1000 active instances</li> |
| 5221 | +<li>1000 active runs</li> |
| 5222 | +<li>1000 active jobs.</li> |
5183 | 5223 | </ul> |
5184 | | -<p>Having more active resources will work but can affect server performance. |
5185 | | -If you hit these limits, consider using Postgres with multiple server replicas. |
5186 | | -You can also increase processing rates of a replica by setting the <code>DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR</code> environment variable. |
5187 | | -You should also increase <code>DSTACK_DB_POOL_SIZE</code> and <code>DSTACK_DB_MAX_OVERFLOW</code> proportionally. |
5188 | | -For example, to increase processing rates 4 times, set:</p> |
5189 | | -<div class="highlight"><pre><span></span><code>export DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR=4 |
5190 | | -export DSTACK_DB_POOL_SIZE=80 |
5191 | | -export DSTACK_DB_MAX_OVERFLOW=80 |
5192 | | -</code></pre></div> |
5193 | | -<p>You have to ensure your Postgres installation supports that many connections by |
5194 | | -configuring <a href="https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS"><code>max_connections</code></a> and/or using connection pooler.</p> |
| 5224 | +<p>If you hit server performance limits, try scale up server instances and/or configure Postgres with multiple server replicas. |
| 5225 | +Also, please <a href="https://github.com/dstackai/dstack/issues">submit a GitHub issue</a> describing your setup – we strive to improve <code>dstack</code> scalability and efficiency.</p> |
5195 | 5226 | <h2 id="server-upgrades">Server upgrades<a class="headerlink" href="#server-upgrades" title="Permanent link">¶</a></h2> |
5196 | 5227 | <p>When upgrading the <code>dstack</code> server, follow these guidelines to ensure a smooth transition and minimize downtime.</p> |
5197 | 5228 | <h3 id="before-upgrading">Before upgrading<a class="headerlink" href="#before-upgrading" title="Permanent link">¶</a></h3> |
|
0 commit comments