Update: This appears to be mostly fixed. I'm not 100% sure what I did, but it's running and also my sites are loading with it properly. However, I'm still having error #1 about the PID not being readable.

I'm hoping that I can get some help with figuring out why Redis-Server won't run for me. I had it completely running about 3 days ago, but when I attempted to start removing other caching programs from my WordPress install. I somehow broke Redis. Following, I've listed the errors, and then how I've attempted to correct them. Please let me know what your thoughts are and how I can try to fix it going forward.

I've installed Redis-Server originally from source from redis.io, but once that broke I ended up attempting to reinstall from source and also attempted to reinstall from apt. I'm having the same errors on both types of installs.

uname -a:  Linux serverName.tld 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 16.04
Redis-Server 4.0.2

I've used the following tutorial to install Redis-Server: Install Redis Object Cache for WordPress PHP 7 on Ubuntu 16.04


  1. redis-server.service: PID file /var/run/redis/redis.pid not readable (yet?) after start: No such file or directory

    • I've attempted to correct this by making sure that /var/run/redis/ is already created. I've also made sure that (at separate times) that /var/run/redis/ was owned by redis:redis and also redis:www-data (my apache2 group). I've also attempted many permissions schemes of 777, 755, 775, 007, 770.
      Across all of this, I occasionally still get the error.
    • I've also manually created the /var/run/redis/redis.pid file with the same type of permissions that I mentioned above.
    • Finally, per some recommendations on websites, I've also changed the PIDFile to redis-server.pid ...
    • None of these changes really seem to persist and work consistently for this error message.
  2. You requested maxclients of 20000 requiring at least 20032 max file descriptors. Server can't set maximum open files to 20032 because of OS error: Operation not permitted. Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.

    • This seems to be influenced by the "MaxClients" piece of the redis.conf file... I've attempted to change the MaxClients option by commenting out and it sets it to default 10000 ... I've also changed this to 20000 in redis.conf and the number goes up to 20032 ... so it always seems that it wants 32 more files than I'm permitted or something.
    • I've changed the /etc/systemd/system/redis-server.service file to include "LimitNOFILE=64000" ... this hasn't made a difference. I've restarted the server - no change.
    • I've changed /etc/default/redis-server and uncommented the "ULIMIT=65536" ... restarted, again no change.
  3. 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

    • This was corrected once I had issued the following command:
      echo never > /sys/kernel/mm/transparent_hugepage/enabled
      • I also added the above command to /etc/rc.local to persist past reboot. Again, this seems to have been resolved.
  4. WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

    • I issued the following command to attempt to combat this error ... it seems to only show up sometimes:

      echo "vm.overcommit_memory=1" >> /etc/sysctl.conf;  sysctl -p 

    This error happens every once in a while

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

    • I've added the following by performing the commands:

      echo "net.core.somaxconn=65536" >> /etc/sysctl.conf    
      echo "net.ipv4.tcp_max_syn_backlog=8192" >> /etc/sysctl.conf    

    To verify they were added ... sysctl -p

Below is my entire /etc/systemd/system/redis-server.service file.

Description=Redis Datastore Server  


\# Create and set perms for PIDFile directory  
ExecStartPre=/bin/mkdir -p /var/run/redis  
ExecStartPre=/bin/chown redis:www-data /var/run/redis  
ExecStartPre=/bin/chmod 775 -R /var/run/redis  

\# Create and set perms for Log directory  
\# This is commented out because I receive errors that the operation is not permitted.  
\#ExecStartPre=/bin/mkdir -p /var/log/redis  
\#ExecStartPre=/bin/chown redis -R /var/log/redis  
\#ExecStartPre=/bin/chmod 775 -R /var/log/redis  

\# Create and set perms for log file  
ExecStartPre=/bin/touch /var/log/redis/redis-server.log  
ExecStartPre=/bin/chown redis /var/log/redis/redis-server.log  
ExecStartPre=/bin/chmod 775 /var/log/redis/redis-server.log  

ExecStart=/sbin/start-stop-daemon --start --pidfile /var/run/redis/redis.pid --umask 007 --exec /usr/bin/redis-server -- /etc/redis/redis.conf  
ExecReload=/bin/kill -USR2 $MAINPID  
ExecStop=/usr/bin/redis-cli shutdown  


I'm at my wits end. I switched to Redis-Server after struggling with failing to get memcached working. The single time that memcached worked, I tried it out on my WordPress sites and it was SUPER fast. I was very impressed and very happy with the performance. However obviously, I can't get it to work, which is why I'm asking for assistance.


Might be unlikely since you don't mention other changes, I'll post anyway.

Perhaps this is an IPv6 / IPv4 issue. If you disabled IPv6 at any point, you'll get the result you described.

Take a look at /var/log/redis/redis-server.log. This is what I found in mine:

17008:C 24 Aug 07:17:45.193 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17008:C 24 Aug 07:17:45.193 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=17008, just started
17008:C 24 Aug 07:17:45.193 # Configuration loaded
17009:M 24 Aug 07:17:45.195 # Creating Server TCP listening socket ::1:6379: 
bind: Cannot assign requested address

Redis was attempting to use IPv6 (::1:6379:). I had disabled IPv6 on this system (for reasons), however the default redis-cache configuration enables both IPv4 and v6. If you're seeing the "Cannot assign" error in that log, take a look at /etc/redis/redis.conf. The "out-of-box" configuration enables IPv6 (::1):

bind ::1

So I removed that, changing it to:


Redis started right up after that.

Hope that helps!


Try this (tested Ubuntu 18.04):

sudo sh -c 'echo "httpd soft nofile 4096" >> /etc/security/limits.conf'
sudo sh -c 'echo "httpd hard nofile 10240" >> /etc/security/limits.conf'
sudo sh -c 'echo "fs.file-max = 100000" >> /etc/sysctl.conf'
sudo sh -c 'echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf'
sudo sh -c 'echo "net.core.somaxconn = 65535" >> /etc/sysctl.conf'
sudo apt -y install redis-server redis-tools
sudo service redis-server stop
sudo sed -i '/^bind/s/bind.*/bind' /etc/redis/redis.conf
if [ ! -d /var/run/redis ]; then sudo mkdir -p /var/run/redis && sudo chown redis /var/run/redis; fi
sudo service redis-server start

source: Ntopng maravento.com


An add-on to @Chris answer, but coming from the other way. Had an Ubuntu server with IPv6 enabled, but redis-server was trying to bind on IPv4 instead...

11558:C 16 Mar 21:09:24.694 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
11558:C 16 Mar 21:09:24.694 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=11558, just started
11558:C 16 Mar 21:09:24.694 # Configuration loaded
11569:M 16 Mar 21:09:24.709 # Creating Server TCP listening socket bind: Address already in use

Solution was change redis.conf from:


...to be:

bind ::1

Worked fine after that... be sure to reboot your server after any IP-related changes though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.