简体   繁体   English

为Redis 3.2.6调整Linux内核堆栈

[英]Tuning Linux Kernel Stack for Redis 3.2.6

I am setting up a Redis 3.2.6 cluster. 我正在设置Redis 3.2.6集群。 In this blog it is mentioned to change the following parameters for "Tuning the kernel network stack" 在此博客中 ,提到要更改以下参数以“调整内核网络堆栈”

vm.swappiness=0                       # turn off swapping
net.ipv4.tcp_sack=1                   # enable selective acknowledgements
net.ipv4.tcp_timestamps=1             # needed for selective acknowledgements
net.ipv4.tcp_window_scaling=1         # scale the network window
net.ipv4.tcp_congestion_control=cubic # better congestion algorythm
net.ipv4.tcp_syncookies=1             # enable syn cookied
net.ipv4.tcp_tw_recycle=1             # recycle sockets quickly
net.ipv4.tcp_max_syn_backlog=NUMBER   # backlog setting
net.core.somaxconn=NUMBER             # up the number of connections per port
net.core.rmem_max=NUMBER              # up the receive buffer size
net.core.wmem_max=NUMBER              # up the buffer size for all connections

Can someone explain me how the above parameters effect the behavior of redis? 有人可以解释一下上述参数如何影响Redis的行为吗?

Also other than the ones mentioned above do I need to look into some other parameters for preparing the OS for redis installation? 除了上面提到的那些参数之外,我还需要查看其他一些参数来为准备Redis安装的操作系统做准备吗?

Environment 环境

  • Debian 8 Debian 8
  • RAM - 128 GB 内存-128 GB
  • Cores - 24 核心数-24

Most of that flags seem related to optimize for very frequent TCP connections and for latency of TCP connections. 大多数标志似乎与优化用于非常频繁的TCP连接和TCP连接的延迟有关。 In some cases they may help but Redis clients and servers already do the most important thing which is to disable the Nagle's algorithm. 在某些情况下,它们可能会有所帮助,但是Redis客户端和服务器已经做了最重要的事情,即禁用了Nagle的算法。 However the MOST critical things with setting up a Linux kernel for Redis are actually: 但是,为Redis设置Linux内核最关键的事情实际上是:

  1. Disable THP (Transparent Huge Pages). 禁用THP(透明大页面)。
  2. Allow memory overcommitting during fork(). 在fork()期间允许内存过量使用。

If the above are not set correctly, recent versions of Redis will warn you. 如果上述设置不正确,Redis的最新版本将警告您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM