Skip to content

Redis performance is poor in Docker network compared to unix sockets #33

@nickchomey

Description

@nickchomey

I just ran a simple benchmark (redis-benchmark -q -n 1000000 -s /var/run/redis/redis.sock -t set,get,mset -P 16 -c 100) with 3 networking configurations

  1. redis on host system over tcp
  2. redis on host system with unix socket
  3. redis in ddev container (presumably over tcp)
    image

You can see that unix sockets are considerably faster than tcp. And there seems to be a signficant tax with the Docker Container.

I don't know much about docker networking, so I dont know what to look at or change.

Here's some links that I've found that might be helpful

https://medium.com/@jonbaldie/how-to-connect-to-redis-with-unix-sockets-in-docker-9e94e01b7acd
https://www.reddit.com/r/selfhosted/comments/vf6jeg/i_used_unix_sockets_to_improve_the_performance_of/
https://help.nextcloud.com/t/solved-cant-get-redis-to-work-in-socket-mode/122830/13
https://serverfault.com/questions/1156554/bind-a-host-unix-socket-to-a-container-port

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions