Skip to content

Commit 99984d3

Browse files
taimoorzaeemsteve-chavez
authored andcommitted
docs: add section on docker resource constraints
Closes #4623. Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
1 parent aaaf7e9 commit 99984d3

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

docs/explanations/install.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,23 @@ If you want to have a visual overview of your API in your browser you can add sw
181181
182182
With this you can see the swagger-ui in your browser on port 8080.
183183

184+
.. _docker_cpu_contraint:
185+
186+
Docker Resource Constraints
187+
---------------------------
188+
189+
PostgREST does not support ``--cpus`` `constraint option <https://docs.docker.com/engine/containers/resource_constraints/#configure-the-default-cfs-scheduler>`_.
190+
191+
As a workaround, you may use the `GHC RTS <https://ghc.gitlab.haskell.org/ghc/doc/users_guide/runtime_control.html#runtime-system-rts-options>`_ ``-N`` option. For instance, to limit it to 2 CPU cores, do:
192+
193+
.. code::
194+
195+
# Set environment variable GHCRTS set to "-N2"
196+
docker run --rm -p 3000:3000 \
197+
-e PGRST_DB_URI="postgres://app_user:password@10.0.0.10/postgres" \
198+
-e GHCRTS="-N2"
199+
postgrest/postgrest
200+
184201
.. _build_source:
185202

186203
Building from Source

0 commit comments

Comments
 (0)