From 062ed81e14c9a5bf04c25b9344d36efc108df4f7 Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Thu, 10 Oct 2024 11:23:55 -0400 Subject: [PATCH] Make memcached configuration section more generic --- memcached/content.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/memcached/content.md b/memcached/content.md index 6f13f6942d9d..ddabc4fc8e0e 100644 --- a/memcached/content.md +++ b/memcached/content.md @@ -12,12 +12,30 @@ Memcached's APIs provide a very large hash table distributed across multiple mac $ docker run --name my-memcache -d %%IMAGE%% ``` -## Setting Memory Usage +### Configuration + +To customize the configuration of the memcached server, first obtain the upstream configuration options from the container: ```console -$ docker run --name my-memcache -d %%IMAGE%% memcached -m 64 +$ docker run --rm %%IMAGE%% -h ``` -This would set the Memcached server to use 64 megabytes for storage. +Using `docker run`: + +```console +$ docker run --name my-memcache -d %%IMAGE%% memcached --memory-limit=64 +``` + +or using Docker Compose: + +```yaml +services: + memcached: + image: %%IMAGE%% + command: + - --conn-limit=1024 + - --memory-limit=64 + - --threads=4 +``` For infomation on configuring your memcached server, see the extensive [wiki](https://github.com/memcached/memcached/wiki).