[asterisk-bugs] [JIRA] (ASTERISK-26077) safe_asterisk ulimit can be above kernel max

rsw686 (JIRA) noreply at issues.asterisk.org
Tue May 31 12:47:56 CDT 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-26077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230855#comment-230855 ] 

rsw686 commented on ASTERISK-26077:
-----------------------------------

To provide some documentation please see the below exerts from https://www.kernel.org/doc/Documentation/sysctl/fs.txt. Based on this safe_asterisk should be modified to check if /proc/sys/fs/file-max / 2 is larger than /proc/sys/fs/nr_open. If it is than nr_open should be used instead to set the ulimit.

file-max & file-nr:
The value in file-max denotes the maximum number of file-
handles that the Linux kernel will allocate. When you get lots
of error messages about running out of file handles, you might
want to increase this limit.

nr_open:
This denotes the maximum number of file-handles a process can
allocate. Default value is 1024*1024 (1048576) which should be
enough for most machines.

> safe_asterisk ulimit can be above kernel max
> --------------------------------------------
>
>                 Key: ASTERISK-26077
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26077
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Contrib/General
>            Reporter: rsw686
>            Severity: Critical
>
> safe_asterisk calculates the ulimit based on file-max divided by two. On certain systems this value can be above the kernel max, which results in the open file limit not being applied. Some research shows the kernel max is 1024 * 1024 and I am able to successfully execute ulimit -n 1048576.
> cat /proc/sys/fs/file-max
> 2466684
> 2466684 / 2 = 1233342
> ulimit -n 1233342
> -bash: ulimit: open files: cannot modify limit: Operation not permitted



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list