Stefan Viljoen
2015-Aug-12 07:06 UTC
[asterisk-users] 786 000 files limit Centos 7 - Asterisk keep complaining
Hi Steve Just running about 50 calls?? If I do lsof | grep asterisk | wc -l to narrow the realm of what is reported I still get just under 100 000 files: lsof | grep asterisk | wc -l 95903 with 50 calls running. So apparently this is excessive? I can only guess that there must be a MAJOR bug in 1.8.11.0 given that you are running 347 calls on 2161 open files with Ast 11...? I'm on Centos 7. As I mentioned previously, I have found that my problem with Asterisk running out of files is that the Asterisk binary, on startup, does NOT "detect" that the open file limit it 768 000, it always selects 1024 as the soft limit for open files and 4096 as the hard limit for open files. I have to manually (cron does not work - wonder why?) do /usr/bin/prlimit --pid `pidof asterisk` --nofile=786000:786000 in order to get the running Asterisk instance to ACTUALLY have a soft and hard number of files limit of 786 000. The machine under discussion never runs more than about 60 calls, at which point it consumes about 125 000 file descriptors / handles in Asterisk (total open files in the kernel goes to about 195 000) - I thought this was normal....! Note that besides some timer problems that pop up occassionally (unsure if it is related) the box is totally stable and has spent days at 100 000+ open file descriptors operating Asterisk 1.8.11.0 quite happily with no other problems save that when the binary started up for that run it did not have a sufficiently high file limit to actually work. Thanks for the reply! Kind regards,> I suspected something like that, though repeatedly running > > lsof | wc -l > > Always stays quite low - 100 000 open files, which is still 8 times > less than the system maximum as confirmed by running ulimit -nWhat the 'h' are you doing that takes x00,000 open files? I'm running Asterisk 11.17.0 on CentOS 6.7 and my 'numbers' seem insignificant by comparison. sudo /usr/sbin/asterisk -r -x 'core show channels' | grep active 347 active channels 344 active calls sudo lsof | wc -l 3945 sudo lsof | grep asterisk | wc -l 2161 -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST ------------------------------ _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users End of asterisk-users Digest, Vol 133, Issue 14 ***********************************************
Joshua Colp
2015-Aug-12 11:36 UTC
[asterisk-users] 786 000 files limit Centos 7 - Asterisk keep complaining
On Wed, Aug 12, 2015, at 04:06 AM, Stefan Viljoen wrote:> Hi Steve > > Just running about 50 calls?? > > If I do > > lsof | grep asterisk | wc -l > > to narrow the realm of what is reported I still get just under 100 000 > files: > > lsof | grep asterisk | wc -l > 95903 > > with 50 calls running. > > So apparently this is excessive? I can only guess that there must be a > MAJOR > bug in 1.8.11.0 given that you are running 347 calls on 2161 open files > with > Ast 11...?<snip> I vaguely recall potential leaks that caused excess file descriptor usage in older versions, but it's so old that it's hard to remember. Just to provide some scope of how many changes there are between even 1.8.11.0 and 1.8: ? jcolp at electron:~/development/asterisk/public [11|? 1]> git diff 1.8.11.0..1.8 | wc -l 221688 That's 221,688 changed lines. -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org