786 000 Files Limit CentOS 7 – Asterisk

Home » Asterisk Users » 786 000 Files Limit CentOS 7 – Asterisk
Asterisk Users 2 Comments

Hi Markus

Thanks for the reply, I have set those files previously as well…

It seems the problem for me is on my CentOS 7 box that the Asterisk binary does not “know” that these are the limits, and imposes a 1024 open file limit count for some reason.

It seems using prlimit to force the running binary to use a higher file limit is working – but it has to be done manually each time the asterisk process is started, the prlimit cronjob I set up to force the file limit higher does not seem to work – you have to physically type in

/usr/bin/prlimit –pid `pidof asterisk` –nofilex6000:786000

and running that from a script (As root) doesn’t seem to work.

Anyway, thanks for the advice and taking the time to reply.

Kind regards,

Message: 11
Date: Tue, 11 Aug 2015 18:29:01 +0200
From: Markus Weiler
To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] 786 000 files limit CentOS 7 – Asterisk keep complaining Message-ID: <55CA22CD.4060400@mailworks.org>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hi Stefan,

we ran into a similar problem using Debian.

There we are able to check the current limits using:

pidof asterisk -> 23351
cat /proc/23351/limits

Output:
Limit Soft Limit Hard Limit Units Max open files 1024 1024 files

I think that in the end

/etc/security/limits.conf

* hard nofile 500000
* soft nofile 500000
root hard nofile 500000
root soft nofile 500000

did the trick. We also tried

vi /etc/sysctl.conf fs.file-max = 500000

not sure what the solution in the end was. But I remember rebooting was important.

Markus

Am 11.08.2015 um 11:00 schrieb Stefan Viljoen:
when it)
all

consistent thousands microsecs files)
set ACTUALLY

—————————-

2 thoughts on - 786 000 Files Limit CentOS 7 – Asterisk

  • Hi Tony

    Thanks again for replying.

    Ok, I’ve set the SYSMAXFILES and MAXFILES in the script, hopefully it will have an effect.

    Kind regards,

    Message: 12
    Date: Tue, 11 Aug 2015 16:50:29 +0000 (UTC)
    From: tony@softins.co.uk (Tony Mountifield)
    To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] 786 000 files limit CentOS 7 – Asterisk keep complaining Message-ID:

    In article <002b01d0d414$36af31b0$a40d9510$@verishare.co.za>, Stefan Viljoen wrote:

    Yes, this is likely. Have a look in /usr/sbin/safe_asterisk, at the commented-out settings for SYSMAXFILES and MAXFILES, and try setting those.

    Cheers Tony