Redis prompts Incremented maximum number of open files to 10032
Today, Redis on the server has been failing. Check the log and find the following prompt: Increased maximum number of open files to 10032 (it was originally set to 1024)
The problem is that the number of file descriptors in Redis exceeds the system limit. The file descriptor is a unique identifier used to reference open files and network sockets in UNIX and Linux systems.
Open the/etc/sysctl.conf file and add the following line at the end of the file:
fs.file-max = 10032
This setting will increase the number of file descriptors at the system level, save and close the file.
Run the following command for the settings to take effect immediately:
sudo sysctl -p
After that, you need to add the following content to the/etc/security/limits.conf file:
* soft nofile 10032 * hard nofile 10032
This will increase the number of file descriptors at the user level. Note that there is an asterisk in front of it. Save and close the file.
Finally, the following lines need to be added to the systemd service unit file of Redis:
[Service] LimitNOFILE=10032
Then reload the systemd configuration and restart Redis:
sudo systemctl daemon-reload sudo systemctl restart redis