Hi everyone, I was wondering if anyone has ever reached the max limit of file descriptors in Asterisk. I’m currently running a Asterisk 11 based app (code is modified) on Centos 6.4 64 bits, and I reached the 1024 limit at one of my customers. One of our applications that wasen’t closing a network connection properly which was causing the nb of fd’s used by asterisk to accumulate until it reached the limit specified by ulimit -n (which was 1024 in my case).
Now when I do a ‘ls’ in /proc/ASTERISK_PROCID/fd, I see a lot of stuff in there that I’m not sure what they are, and if its normal to have those fd’s still opened on a idle system, perhaps someone can help, here is what I see on an asterisk that has been sitting idle for a while:
[root@Asterisk11-1 ~]# ls -lah /proc/1682/fd
total 0
dr-x------ 2 root root 0 Nov 22 11:57 .
dr-xr-xr-x 7 root root 0 Oct 31 16:50 …
lr-x------ 1 root root 64 Nov 22 13:09 0 -> /dev/tty9
l-wx------ 1 root root 64 Nov 22 13:09 1 -> /dev/tty9
lrwx------ 1 root root 64 Nov 22 13:09 10 -> socket:[133059]
lr-x------ 1 root root 64 Nov 22 13:09 101 -> pipe:[980911]
l-wx------ 1 root root 64 Nov 22 13:09 103 -> pipe:[980911]
l-wx------ 1 root root 64 Nov 22 13:09 104 -> pipe:[981050]
l-wx------ 1 root root 64 Nov 22 13:09 105 -> pipe:[981019]
lrwx------ 1 root root 64 Nov 22 13:09 108 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 11 -> socket:[133060]
lrwx------ 1 root root 64 Nov 22 13:09 110 -> anon_inode:[timerfd]
l-wx------ 1 root root 64 Nov 22 13:09 111 -> pipe:[980959]
lr-x------ 1 root root 64 Nov 22 13:09 112 -> pipe:[980921]
lrwx------ 1 root root 64 Nov 22 13:09 115 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 117 -> pipe:[173381]
lrwx------ 1 root root 64 Nov 22 13:09 118 -> anon_inode:[timerfd]
l-wx------ 1 root root 64 Nov 22 13:09 119 -> pipe:[173381]
lrwx------ 1 root root 64 Nov 22 13:09 12 -> socket:[133062]
lr-x------ 1 root root 64 Nov 22 13:09 120 -> pipe:[172847]
l-wx------ 1 root root 64 Nov 22 13:09 121 -> pipe:[172847]
lrwx------ 1 root root 64 Nov 22 13:09 13 -> socket:[133063]
lrwx------ 1 root root 64 Nov 22 13:09 130 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 132 -> pipe:[980938]
l-wx------ 1 root root 64 Nov 22 13:09 133 -> pipe:[980938]
l-wx------ 1 root root 64 Nov 22 13:09 138 -> pipe:[980921]
lrwx------ 1 root root 64 Nov 22 13:09 145 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 146 -> pipe:[980970]
l-wx------ 1 root root 64 Nov 22 13:09 147 -> pipe:[980970]
lr-x------ 1 root root 64 Nov 22 13:09 15 -> inotify
lrwx------ 1 root root 64 Nov 22 13:09 158 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 159 -> pipe:[980877]
lr-x------ 1 root root 64 Nov 22 13:09 16 -> pipe:[133065]
l-wx------ 1 root root 64 Nov 22 13:09 160 -> pipe:[980877]
l-wx------ 1 root root 64 Nov 22 13:09 17 -> pipe:[133065]
lrwx------ 1 root root 64 Nov 22 13:09 18 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 19 -> pipe:[1042708]
l-wx------ 1 root root 64 Nov 22 13:09 2 -> /dev/tty9
l-wx------ 1 root root 64 Nov 22 13:09 20 -> pipe:[1042708]
lrwx------ 1 root root 64 Nov 22 13:09 21 -> anon_inode:[timerfd]
l-wx------ 1 root root 64 Nov 22 13:09 22 -> /var/log/asterisk/queue_log
lrwx------ 1 root root 64 Nov 22 13:09 23 -> socket:[133246]
lrwx------ 1 root root 64 Nov 22 13:19 24 -> socket:[1164942]
lrwx------ 1 root root 64 Nov 22 13:19 25 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 26 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:19 27 -> pipe:[1203571]
lrwx------ 1 root root 64 Nov 22 13:09 28 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 29 -> pipe:[948178]
lr-x------ 1 root root 64 Nov 22 13:09 3 -> /dev/urandom
lr-x------ 1 root root 64 Nov 22 13:09 30 -> pipe:[981035]
lr-x------ 1 root root 64 Nov 22 13:09 31 -> pipe:[1042794]
l-wx------ 1 root root 64 Nov 22 13:09 32 -> pipe:[1042794]
lrwx------ 1 root root 64 Nov 22 13:09 33 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 34 -> pipe:[1042811]
lr-x------ 1 root root 64 Nov 22 13:09 35 -> inotify
l-wx------ 1 root root 64 Nov 22 13:09 36 -> pipe:[1042811]
l-wx------ 1 root root 64 Nov 22 13:09 37 -> pipe:[981035]
l-wx------ 1 root root 64 Nov 22 13:58 38 -> pipe:[1203571]
lrwx------ 1 root root 64 Nov 22 13:09 39 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 4 -> socket:[133039]
lrwx------ 1 root root 64 Nov 22 13:09 40 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:58 41 -> /var/lib/asterisk/sounds/en/silence/9.gsm
lrwx------ 1 root root 64 Nov 22 13:09 42 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 43 -> pipe:[1043018]
l-wx------ 1 root root 64 Nov 22 13:09 44 -> pipe:[1043018]
l-wx------ 1 root root 64 Nov 22 13:09 45 -> pipe:[948178]
lrwx------ 1 root root 64 Nov 22 13:09 46 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 47 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 48 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 49 -> anon_inode:[timerfd]
l-wx------ 1 root root 64 Nov 22 13:09 5 -> /var/log/asterisk/messages
lrwx------ 1 root root 64 Nov 22 13:09 53 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 55 -> pipe:[173428]
lrwx------ 1 root root 64 Nov 22 13:09 56 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 57 -> pipe:[980560]
lrwx------ 1 root root 64 Nov 22 13:09 59 -> anon_inode:[timerfd]
l-wx------ 1 root root 64 Nov 22 13:09 6 -> /var/log/asterisk/full
l-wx------ 1 root root 64 Nov 22 13:09 60 -> pipe:[173428]
l-wx------ 1 root root 64 Nov 22 13:09 61 -> pipe:[980560]
lr-x------ 1 root root 64 Nov 22 13:09 62 -> pipe:[981036]
l-wx------ 1 root root 64 Nov 22 13:09 63 -> pipe:[981036]
lr-x------ 1 root root 64 Nov 22 13:09 64 -> pipe:[981019]
lr-x------ 1 root root 64 Nov 22 13:09 65 -> pipe:[1043144]
l-wx------ 1 root root 64 Nov 22 13:09 66 -> pipe:[1043144]
lrwx------ 1 root root 64 Nov 22 13:09 67 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 69 -> pipe:[980892]
lrwx------ 1 root root 64 Nov 22 13:09 7 -> /var/lib/asterisk/astdb.sqlite3
l-wx------ 1 root root 64 Nov 22 13:09 70 -> pipe:[980892]
lr-x------ 1 root root 64 Nov 22 13:09 72 -> pipe:[936741]
l-wx------ 1 root root 64 Nov 22 13:09 73 -> pipe:[936741]
lrwx------ 1 root root 64 Nov 22 13:09 76 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 77 -> anon_inode:[timerfd]
lrwx------ 1 root root 64 Nov 22 13:09 78 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 79 -> pipe:[981039]
lr-x------ 1 root root 64 Nov 22 13:09 8 -> /dev/urandom
l-wx------ 1 root root 64 Nov 22 13:09 80 -> pipe:[981039]
lr-x------ 1 root root 64 Nov 22 13:09 82 -> pipe:[981008]
l-wx------ 1 root root 64 Nov 22 13:09 84 -> pipe:[981008]
lrwx------ 1 root root 64 Nov 22 13:09 88 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 89 -> pipe:[980901]
lrwx------ 1 root root 64 Nov 22 13:09 9 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 91 -> pipe:[948181]
l-wx------ 1 root root 64 Nov 22 13:09 93 -> pipe:[948181]
lrwx------ 1 root root 64 Nov 22 13:09 95 -> anon_inode:[timerfd]
lr-x------ 1 root root 64 Nov 22 13:09 96 -> pipe:[981050]
l-wx------ 1 root root 64 Nov 22 13:09 97 -> pipe:[980901]
lr-x------ 1 root root 64 Nov 22 13:09 99 -> pipe:[980959]
Thanks in advance
Wallnut