summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-06-02 18:19:13 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-06-09 10:32:07 -0500
commit4879cd875c932817c8259934814dd18cf15f5a1c (patch)
tree3fe532f547ee0b170cd0f1e293d5ed20d91fb2fe /res
parent2cd67d5b07d28891ea7c86aece702a4d6e436afc (diff)
sorcery: Add setting object type congestion levels.
Sorcery creates taskprocessors for object types to process object observer callbacks. An API call is needed to be able to set the congestion levels of these taskprocessors for selected object types. * Updated PJSIP's contact and contact_status sorcery object type observer default congestion levels based upon stress testing. Increased the congestion levels to reduce the potential for bursty register/unregister and subscribe/unsubscribe activity from triggering the taskprocessor overload alert. ASTERISK-26088 Reported by: Richard Mudgett Change-Id: I4542e83b556f0714009bfeff89505c801f1218c6
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip/location.c3
-rw-r--r--res/res_pjsip/pjsip_options.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 43e6ea40f..8f8c030c3 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -25,6 +25,7 @@
#include "asterisk/astobj2.h"
#include "asterisk/paths.h"
#include "asterisk/sorcery.h"
+#include "asterisk/taskprocessor.h"
#include "include/res_pjsip_private.h"
#include "asterisk/res_pjsip_cli.h"
#include "asterisk/statsd.h"
@@ -1114,6 +1115,8 @@ int ast_sip_initialize_sorcery_location(void)
ast_pjproject_get_buildopt("PJSIP_MAX_URL_SIZE", "%d", &pjsip_max_url_size);
ast_sorcery_apply_default(sorcery, "contact", "astdb", "registrar");
+ ast_sorcery_object_set_congestion_levels(sorcery, "contact", -1,
+ 3 * AST_TASKPROCESSOR_HIGH_WATER_LEVEL);
ast_sorcery_apply_default(sorcery, "aor", "config", "pjsip.conf,criteria=type=aor");
if (ast_sorcery_object_register(sorcery, "contact", contact_alloc, NULL, contact_apply_handler) ||
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 1114336bd..381de3754 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -31,6 +31,7 @@
#include "asterisk/test.h"
#include "asterisk/statsd.h"
#include "include/res_pjsip_private.h"
+#include "asterisk/taskprocessor.h"
#define DEFAULT_LANGUAGE "en"
#define DEFAULT_ENCODING "text/plain"
@@ -1004,6 +1005,8 @@ int ast_sip_initialize_sorcery_qualify(void)
/* initialize sorcery ast_sip_contact_status resource */
ast_sorcery_apply_default(sorcery, CONTACT_STATUS, "memory", NULL);
+ ast_sorcery_object_set_congestion_levels(sorcery, CONTACT_STATUS, -1,
+ 3 * AST_TASKPROCESSOR_HIGH_WATER_LEVEL);
if (ast_sorcery_internal_object_register(sorcery, CONTACT_STATUS,
contact_status_alloc, NULL, NULL)) {