Skip to content

Redis Optimization Cheatsheet

TCP Backlog

sysctl -w net.core.somaxconn=1024

cat /proc/sys/net/core/somaxconn
echo 511 > /proc/sys/net/core/somaxconn

vm.overcommit_memory

sysctl vm.overcommit_memory=1

Transparent Huge Pages (THP)

echo never > /sys/kernel/mm/transparent_hugepage/enabled

AOF and RDB

auto-aof-rewrite-percentage
auto-aof-rewrite-min-size

IO optimization for SSDs

echo noop | sudo tee /sys/block/sda/queue/scheduler

Reference

  • https://github.com/redis/redis/issues/3176
  • https://redis.io/topics/persistence

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try my iOS App