Modify File Descriptor Limit on Linux

System-wide File Descriptor Limit

  • Get current value: sysctl fs.file-max

  • modify max fd limit: sysctl -w fs.file-max=10000

User File Descriptor Limit

  • Get current value: ulimit -n

  • modify max fd limit: ulimit -n 10000

  • use ulimit -a to print all limits of a user, such as fd, processes, etc.

Based on http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/

Ref:

http://unix.stackexchange.com/questions/29577/ulimit-difference-between-hard-and-soft-limits

http://ss64.com/bash/ulimit.html

原文地址:https://www.cnblogs.com/darkmatter/p/3605686.html