Skip to content

Commit 1f42926

Browse files
authored
docs(docker-compose): Explain NAT overhead in docker-compose (#176)
docs(docker-compose): Explain `NAT` overhead in docker-compose overlay vs host networks Signed-off-by: Ryan Russell <[email protected]>
1 parent 1ba767d commit 1f42926

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

contrib/docker/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ OK
5353

5454
## Step 3
5555

56-
Continue being great and build your app with the power of DragonflyDB!
56+
Continue being great and build your app with the power of DragonflyDB!
57+
58+
## Tuning Dragonfly DB
59+
If you are attempting to tune Dragonfly DB for performance, consider `NAT` performance costs associated with containerization.
60+
> ## Performance Tuning
61+
> ---
62+
> 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)).
63+
> &nbsp;
64+
> Fore more information, see the [official docker-compose network_mode Docs](https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode)
65+
> &nbsp;
5766
5867
### More Build Options
5968
- [Docker Quick Start](/docs/quick-start/)

contrib/docker/docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ services:
66
memlock: -1
77
ports:
88
- "6379:6379"
9+
# For better performance, consider `host` mode instead `port` to avoid docker NAT.
10+
# `host` mode is NOT currently supported in Swarm Mode.
11+
# https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode
12+
# network_mode: "host"
913
volumes:
1014
- dragonflydata:/data
1115
volumes:

0 commit comments

Comments
 (0)