Running Redis with Docker (performance issue)

Has anyone else seen performance issues when running Redis in a Docker container environment?

Here's what I noticed ... Setting A: Local Machine, Traditional Redis Install Setting B: Local Machine using the canonical Redis image https://registry.hub.docker.com/_/redis/

I have an identical HTTP server on my local machine that fires as fast as the request / response loop allows.

Notes: - A can support approximately 2X the bandwidth of B. - B does the same as A when you compare (from within a container)

So, this leads me to think that B is slower than A due to a network problem: i.e. network relays implemented when running software in a virtualized environment pose significant performance issues ...

Just wondering if anyone else has noticed something similar?

+3


source to share


1 answer


Docker's standard networking option --net=bridge

introduces an overhead of rewriting NAT packets, which is noticeable at high packet rates.

Network performance can be improved by --net=host

telling Docker not to create a separate networking stack for the container, allowing full access to the host's network interfaces.



This parameter should be used with caution as it allows container processes to open low numbered ports like any other root process and access local network services such as D-bus, which can cause processes in the container to do unexpected things ...

In short: if you know what you are using inside the container, it is safe. If you suspect unwanted or aggressive behavior, don't do it.

+7


source







All Articles