Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis 5.0.5: WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128

I have windows 10 home, where is installed Ubuntu

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

I have installed Redis 5.0.5 (it mostly with make and make install)

When I startup the server with redis-server it shows some warnings.

I have removed one about overcommit_memory

But about:

WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

I have read these two links:

  • WARNING: /proc/sys/net/core/somaxconn is set to the lower value of 128. #35
  • Performance tips for Redis Cache Server

Thus both indicate do the following:

  • Go to the /etc directory
  • Create the rc.local file, sudo vim rc.local
  • Add the sysctl -w net.core.somaxconn=65535 content and save

I can confirm through

cat rc.local
sysctl -w net.core.somaxconn=65535

Well in a secondary terminal I execute redis-cli shutdown and in the primary terminal execute again redis-server

Problem the same warning appears, What is missing?

Note I have the same situation even after to execute sudo chmod +x rc.local

like image 761
Manuel Jordan Avatar asked May 24 '19 18:05

Manuel Jordan


1 Answers

I was facing a similar issue, warnings appearing on logs. I came across the solution with the following:

Try to echo 1024 > /proc/sys/net/core/somaxconn

add these two, to this file /etc/sysctl.conf

vm.overcommit_memory=1
net.core.somaxconn=65535

if everything is ok, restart your redis server: systemctl restart redis.service

Check redis logs again:

cat /var/log/redis/redis.log

like image 145
Sabuhi Shukurov Avatar answered Sep 16 '22 13:09

Sabuhi Shukurov