Current location: home page > programming >Redis prompts Incremented maximum number of open files to 10032

Redis prompts Incremented maximum number of open files to 10032

Precocious 1 month ago (04-07) programming nine hundred and twenty-nine three

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

Copyright notice: Weihan Blog Released. If it needs to be reproduced, please indicate the source.

Link to this article:

Related articles

Zblog topic - MANIFEST test 13 years ago (2011-06-29)
Zblog topic - imitating QQMailService 13 years ago (2011-07-23)
Zblog Topic Manifest Sharing 13 years ago (2011-11-19)
Z-Blog WeChat subscription 11 years ago (2013-04-16)

Comment List

5 days ago

This article is written in simple terms, which makes me understand it!

 Fertile soil
2 weeks ago (05-11)

It seems simple to search for half a day

 Ninety nine seven
3 weeks ago (04-29)

Thanks for sharing



 I can't see it clearly. Change it

◎ Welcome to participate in the discussion. Please express your views and opinions here.