0

I got

ERR max number of clients reached

from my redis server so I decidied to increase the allowed max client connections in its configuration. This also requires according to the documentation, to increase the respective open file limits for the user.

So I made the following changes:

$ grep maxclient /etc/redis/redis.conf 
  maxclients 100000


$ grep redis /etc/security/limits.conf
  redis          -       nofile         100000

Then I did systemctl restart redis-server

However, when I check the limits for the redis-server process which is run by the system user redis, the max allowed files report something else:

  $ ps -u redis
    PID TTY          TIME CMD
    21168 ?        00:00:22 redis-server
  $ grep 'open files' /proc/21168/limits
    Max open files            4096                 4096                 files  

Do I need to reboot the machine for the changes to take effect? Or is it something else?

1

/etc/security/limits.conf is the configuration file for the pam_limits PAM module. It only affects users logging in with PAM, not services started in other ways.

You'll need to configure systemd to change the limits on the processes it starts, see e.g. How to set ulimits on service with systemd? on how to do that.

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.