Sign inSign up

ryanf/redis-thp-init

By ryanf

Updated almost 7 years ago

A workaround fix for running Redis on a THP-enabled host like a 2019 Mac Mini.

Image
0

1.0K

ryanf/redis-thp-init repository overview

redis-thp-init

Docker container build and supporting files, if any, for fixing the WARNING issue with Redis when executing on a host with THP support enabled.

WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

Usage

In your docker-compose.yml file, use this image and ensure it is run before any redis image.

version: "3"
services:
  # container needed to fix Redis Docker issues for hosts that
  #   have Transparent Huge Pages (THP) support enabled.
  redis-init:
    image: ryanf/redis-thp-init
    restart: 'no'
    privileged: true
    volumes:
      - /proc/sys/vm:/mnt/vm
  redis:
    image: redis
    depends_on:
      - redis-init
    # set sysctls: net.core.somaxconn to a value >= 512 to avoid warning:
    # WARNING: The TCP backlog setting of 511 cannot be enforced because
    #   /proc/sys/net/core/somaxconn is set to the lower value of 128.
    #   To fix this warning you have to set a new config to /etc/rc.local
    #   so that the setting will persist upon reboot
    sysctls:
      net.core.somaxconn: 1024
    ports:
      - "6379:6379"
    restart: unless-stopped

Tag summary

Content type

Image

Digest

Size

2.7 MB

Last updated

almost 7 years ago

docker pull ryanf/redis-thp-init