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 <git@ryanrussell.org>
This commit is contained in:
Ryan Russell 2022-06-25 13:47:31 -05:00 committed by GitHub
parent 1ba767dc97
commit 1f42926b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -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)).
> &nbsp;
> Fore more information, see the [official docker-compose network_mode Docs](https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode)
> &nbsp;
### More Build Options
- [Docker Quick Start](/docs/quick-start/)

View File

@ -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: