How to Increase Max Open File Limit in Linux System

Channel: Linux
Abstract: Permanently Increase Open File Limit Q. How to increase open file limit in permanently on Linux systemthen increase limit temporarily. Temporarily Inc

Some times we faced issue some think like 「Too many open files」 on heavy load server. It means our server has hits max open file limit. Now question is how can I increase open file limit on Linux. For your answer follow below article, I will help you for managing Open

Check Current Open File Limit

Q. How to check current open file limit in Linux system ?
A. Use following command to check open file limit in Linux system.

# cat /proc/sys/fs/file-max

50000
Increase Open File Limit in Linux

We can increase open file limit temporarily or permanently as per our requirement. If we need changes just for testing, then increase limit temporarily.

Temporarily Increase Open File Limit

Q. How to increase open file limit in temporarily on Linux system ?
A. Use one of following commands to temporarily increase open file limit on Linux system. These setting will lost after system reboot.

# sysctl -w fs.file-max=500000

[or]

# echo "500000" > /proc/sys/fs/file-max
Permanently Increase Open File Limit

Q. How to increase open file limit in permanently on Linux system ?
A. Edit /etc/sysctl.conf and append following configuration to permanently increase open file limit on Linux system. These setting will remain even after system reboot.

# vim /etc/sysctl.conf
fs.file-max = 500000

after appending configuration in file execute following command to changes take effect.

# sysctl -p

Ref From: tecadmin

Related articles