Skip to content

Redis Optimization Cheatsheet

homepage-banner

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

Back to Table of Contents

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