memcached: Failed To Set rlimit For Open Files Error and Solution

The error “memcached: Failed to set rlimit for open files” can occur when starting the memcached service on a Linux system. This error message indicates that the memcached service is unable to set the maximum number of open files (also known as file descriptors) allowed for its process.

To resolve this issue, you can try the following steps:

  1. Check the current limits on the number of open files by running the following command:
ulimit -n

This will show the current limit on the number of open files for your system.

  1. Modify the limits on the number of open files by adding the following line to the /etc/security/limits.conf file:
* soft nofile 65536
* hard nofile 65536

Note that the values 65536 can be increased or decreased based on your system’s requirements and resources.

  1. Restart the memcached service. You can do this by running the following command:
sudo service memcached restart

By following these steps, you should be able to resolve the “memcached: Failed to set rlimit for open files” error and start the memcached service on your system without any issues.

Leave a Comment