[Asterisk-Dev] file descriptors per call?

Steven Critchfield critch at basesys.com
Mon Feb 28 04:38:46 MST 2005


On Mon, 2005-02-28 at 09:39 +0100, Roy Sigurd Karlsbakk wrote:
> >>> how many file descriptors will asterisk need per concurrent gatewayed
> >>> call between SIP and IAX2?
> >>
> >> I don't know the answer for sure, but I believe it to be a significant
> >> number; there are pipes created for each channel's audio, and also for
> >> alerting the channel driver of events. If the channel uses RTP, then a
> >> socket will be created for that as well. There could be 4-6 fds used 
> >> for
> >> a channel in some cases.
> >
> > That doesn't sound right. There shouldn't be any pipes for the audio.
> > IAX2 and SIP both have a socket open for the call and RTP would be 
> > extra
> > one more. Audio would be converted to an ast_frame and transfered
> > internally as a data structure.
> 
> seems there can be a lot, though
> # lsof -p 9569|wc -l
>      639
> 
> that's on a SIP/IAX2 gateway with around 35 active channels

Have you looked through the list generated by the above command? On a
machine not doing much, I have nearly 200 files open. My quick guess is
you should have 3 file descriptors per SIP<->IAX2 traversal(1 SIP, 1
RTP, 1 IAX2) and 3 * 35 = 105. 

So with my baseline of 200 file descriptors and the 105 or so from my
guess above, you should have about 300 file descriptors. 

The only thing I don't know and is not accounted for in my quick check
is what you may have done in your setup. You would for sure have more
file descriptors open for more modules, for stuff in asterisk-addons,
and if you are using realtime configs. 

All this boils down to needing to do a better inspection of the lsof
output than just a wc.  
-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-dev mailing list