From a9f436f2fb0ae15063a776c92abe11b83321d820 Mon Sep 17 00:00:00 2001 From: Aleš Mrázek Date: Fri, 8 Nov 2024 07:07:28 +0100 Subject: doc/user/deployment-docker.rst: added info about cache --- doc/user/deployment-docker.rst | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/user/deployment-docker.rst b/doc/user/deployment-docker.rst index 0ddf0447..42f5503b 100644 --- a/doc/user/deployment-docker.rst +++ b/doc/user/deployment-docker.rst @@ -26,6 +26,18 @@ Now you can try sending a query to the resolver using `kdig `_. @@ -42,9 +54,15 @@ Get ``CONTAINER_ID`` using the ``docker ps`` command or give your container name $ docker exec -it CONTANER_ID kresctl reload -.. warning:: - - Beware of running the container with a software defined network (i.e. in Kubernetes). - This will likely to result in some performance losses. - We haven't done any measurements comparing different types of installations so we don't know the performance differences. - If you have done your own measurements yourself, please contact us and we will share it with everyone else. +----- +Cache +----- + +You can also use persistent volume for the cache, but sharing it between more containers requires special option ``--pid=host``. +This is caused by the LMDB's reliance on unique PID numbers, see `issue #637 `_ for more information. +It is also good to mount the cache on ``tmpfs`` (semi-persistent), otherwise it will not work well under heavy load. + +.. code-block:: bash + + $ docker volume create --opt type=tmpfs --opt device=tmpfs cache + $ docker run --rm -ti --pid=host --network host -v cache:/var/cache/knot-resolver docker.io/cznic/knot-resolver:6 -- cgit v1.2.3