Summary: | ASTERISK-05381: [patch] Provide alternative pacing for outgoing SIP registrations to handle 1000s of them | ||
Reporter: | Steve Davies . (stevedavies) | Labels: | |
Date Opened: | 2005-10-28 04:53:25 | Date Closed: | 2008-01-15 15:52:50.000-0600 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) asterisk-lotsofsipregistrations.patch | |
Description: | In doing load testing, I tried to see how many registrations I could keep "up" at the same time between two Asterisk boxes. The result was not that good, resulting in a search for the bottlenecks. In existing chan_sip, all outgoing registration renewals are scheduled in a burst spread randonly over about 8 seconds. In my back-to-back test, this can't even get to 1000 registrations before we overload the sender system and overrun the receiver. What happens is that so many re-registrations tasks are in the scheduler that the sip thread doesn't service the network timeously etc. I concede that the typical Asterisk system isn't going to have 1000 outgoing registrations. Nevertheless, I submit this patch as a kind of "shared memory" of this bottleneck and a fix for it. This patch provides a second approach more suitable to sending 1000s of registrations - simply scheduling them all at 20msec intervals (that is, at 50 per second). 1000 registrations then take 20 seconds to work steadliy through, 10,000 take 200 seconds. With this approach I could easily handle 10,000 registrations, provided, of course, the renewal interval was more than 200 seconds. This second method is enabled by a #define; the default behaviour isn't changed. Regards, Steve ****** ADDITIONAL INFORMATION ****** the patch IS against 2005-10-28 cvs-head, but there will be a little fuzz for the second hunk because of another change that I'll load to mantis shortly. | ||
Comments: | By: Serge Vecher (serge-v) 2005-10-28 09:14:05 steve, good patch. Would it be possible to convert this into a setting in sip.conf? By: Mark Spencer (markster) 2005-10-30 02:22:47.000-0600 Is there a good reason *not* to just space them 50ms apart? By: Steve Davies . (stevedavies) 2005-10-30 08:53:55.000-0600 Mark: No obvious one. Mainly I was trying for a clearly low-risk patch. I suppose the existing code just spreads the work out. And it can't be common to do more than 400 outgoing registrations. The patch as is just provides a "plan B" for the unusual case when someone wants to do lots of registrations. Steve By: Mark Spencer (markster) 2005-10-30 16:44:37.000-0600 Should be fixed in CVS head in a more general way, feel free to reopen if it needs work. By: Digium Subversion (svnbot) 2008-01-15 15:52:50.000-0600 Repository: asterisk Revision: 6897 U trunk/channels/chan_sip.c ------------------------------------------------------------------------ r6897 | markster | 2008-01-15 15:52:50 -0600 (Tue, 15 Jan 2008) | 2 lines Fix ability to do lots of outbound registrations (bug ASTERISK-5381) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=6897 |