[asterisk-bugs] [JIRA] (ASTERISK-24011) safe_asterisk tries to set ulimit -n too high on linux systems with lots of RAM
Michael Myles (JIRA)
noreply at issues.asterisk.org
Mon Jul 14 08:16:56 CDT 2014
[ https://issues.asterisk.org/jira/browse/ASTERISK-24011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=220505#comment-220505 ]
Michael Myles commented on ASTERISK-24011:
------------------------------------------
Reattached.
You're right, I added that before my license was processed, but Jira still allowed me to link to the uploaded file despite not listing it as an attachment.
> safe_asterisk tries to set ulimit -n too high on linux systems with lots of RAM
> -------------------------------------------------------------------------------
>
> Key: ASTERISK-24011
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-24011
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Environment:
> Reporter: Michael Myles
> Assignee: Michael Myles
> Severity: Minor
> Attachments: safe_asterisk-ulimit.diff, safe_asterisk-ulimit.diff, safe_asterisk-ulimit.diff
>
>
> It appears the safe_asterisk script tries to increase the open file limit based on the value in /proc/sys/fs/file-max divided by 2. In some modern linux systems this value is calculated based on the amount of RAM available and turns out to be roughly 100 per 1MB of RAM.
> see: fs/file_table.c in linux kernel
> /*
> * One file with associated inode and dcache is very roughly 1K.
> * Per default don't use more than 10% of our memory for files.
> */
> n = (mempages * (PAGE_SIZE / 1024)) / 10;
> files_stat.max_files = max_t(unsigned long, n, NR_FILE);
> On systems with lots of RAM, (In our case a CentOS 6.4 server with 24GB of RAM) this number / 2 can exceed the upper limit which can actually be set per process (2^20=1048576)
> This causes the safe_asterisk script to fail to increase the max number of open files and ulimit to display the error: "open files: cannot modify limit: Operation not permitted"
> Suggest adding an upper bound check to the script to ensure that the value/2 is not above the maximum.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list