[asterisk-users] One thread per peer
mjordan at digium.com
Sun Nov 9 18:14:32 CST 2014
On Sat, Nov 8, 2014 at 11:21 PM, CDR <venefax at gmail.com> wrote:
> Is this normal to create one thread per peer in Asterisk 12, chan_sip
> regular, not pjsip?
> What happens is I have 659 peers, and I get 682 tasks on
> ls /proc/15373/task | wc -l
> If this is normal then of course I can only get a few instances before my
> box collapses.
> Is it any different in pjsip?
I would hazard a guess to say that all three of your e-mails  
(and this one) are the same problem. As such, I'll reply to this
thread and not the others.
Without seeing what in particular those threads are doing are how you
got the system into that state, it's impossible to say whether or not
the behaviour is expected. A few questions then:
1) Can you provide a scenario that reproduces this reliably? A sip
configuration (with a single peer) that results in a thread
'lingering' longer than anticipated would help to determine what is
2) Can you get a thread capture using gdb of a running Asterisk
process? That will inform us what the threads are actually doing when
this occurs. You can get instructions for getting a gdb backtrace from
the wiki , although the following should suffice:
# gdb -ex "thread apply all bt" --batch /usr/sbin/asterisk `pidof
asterisk` > backtrace-threads.txt
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
More information about the asterisk-users