Thursday, April 22, 2010

Increase limit on RLIMIT_NOFILE or other resources

Use setrlimit() to change the soft limit. But there is a hard limit which the setrlimit can not increase beyond.

In order to change the hard limit, you need to change the setting in following file
/etc/security/limits.conf

The syntax of the lines is as follows:

[domain] [type] [item] [value]

Use man limits.conf to see detailed explanation.

You can use command 'lsof -p [pid]' to see files opened by process pid.

No comments: