res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack

The PJSIP taskprocessors could be overflowed on startup
if there are many (thousands) realtime endpoints
configured with unsolicited mwi.
The PJSIP stack could be totally unresponsive for a few minutes
after boot completed.

This patch creates a separate PJSIP serializers pool for mwi
and makes unsolicited mwi use serializers from this pool.
This patch also adds 2 new global options to tune taskprocessor
alert levels: 'mwi_tps_queue_high' and 'mwi_tps_queue_low'.

This patch also adds new global option 'mwi_disable_initial_unsolicited'
to disable sending unsolicited mwi to all endpoints on startup.
If disabled then unsolicited mwi will start processing
on next endpoint's contact update.

ASTERISK-26230 #close

Change-Id: I4c8ecb82c249eb887930980a800c9f87f28f861a
This commit is contained in:
Alexei Gradinari
2016-08-08 13:53:32 -04:00
parent bf21359292
commit a06a1af0eb
7 changed files with 333 additions and 6 deletions

View File

@@ -956,6 +956,27 @@
; set to this value if there is no better option (such as
; auth/realm) to be used
; Asterisk Task Processor Queue Size
; On heavy loaded system with DB storage you may need to increase
; taskprocessor queue.
; If the taskprocessor queue size reached high water level,
; the alert is triggered.
; If the alert is set the pjsip distibutor stops processing incoming
; requests until the alert is cleared.
; The alert is cleared when taskprocessor queue size drops to the
; low water clear level.
; The next options set taskprocessor queue levels for MWI.
;mwi_tps_queue_high=500 ; Taskprocessor high water alert trigger level.
;mwi_tps_queue_low=450 ; Taskprocessor low water clear alert level.
; The default is -1 for 90% of high water level.
; Unsolicited MWI
; If there are endpoints configured with unsolicited MWI
; then res_pjsip_mwi module tries to send MWI to all endpoints on startup.
;mwi_disable_initial_unsolicited=no ; Disable sending unsolicited mwi to all endpoints on startup.
; If disabled then unsolicited mwi will start processing
; on the endpoint's next contact update.
; MODULE PROVIDING BELOW SECTION(S): res_pjsip_acl
;==========================ACL SECTION OPTIONS=========================
;[acl]