diff --git a/contrib/docker/README.md b/contrib/docker/README.md index d6e26b646..10ae87c3c 100644 --- a/contrib/docker/README.md +++ b/contrib/docker/README.md @@ -53,7 +53,16 @@ OK ## Step 3 -Continue being great and build your app with the power of DragonflyDB! +Continue being great and build your app with the power of DragonflyDB! + +## Tuning Dragonfly DB +If you are attempting to tune Dragonfly DB for performance, consider `NAT` performance costs associated with containerization. +> ## Performance Tuning +> --- +> In `docker-compose`, there is a meaningful difference between an `overlay` network(which relies on docker `NAT` traversal on every request) and using the `host` network(see [`docker-compose.yml`](https://github.com/dragonflydb/dragonfly/blob/main/contrib/docker/docker-compose.yml)). +>   +> Fore more information, see the [official docker-compose network_mode Docs](https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode) +>   ### More Build Options - [Docker Quick Start](/docs/quick-start/) diff --git a/contrib/docker/docker-compose.yml b/contrib/docker/docker-compose.yml index 0eba3ec9e..457ff94df 100644 --- a/contrib/docker/docker-compose.yml +++ b/contrib/docker/docker-compose.yml @@ -6,6 +6,10 @@ services: memlock: -1 ports: - "6379:6379" + # For better performance, consider `host` mode instead `port` to avoid docker NAT. + # `host` mode is NOT currently supported in Swarm Mode. + # https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode + # network_mode: "host" volumes: - dragonflydata:/data volumes: