[Asterisk-code-review] res pjsip: Set threadpool max size default to 50. (asterisk[13])

Matt Jordan asteriskteam at digium.com
Mon Nov 2 19:46:01 CST 2015


Matt Jordan has submitted this change and it was merged.

Change subject: res_pjsip: Set threadpool max size default to 50.
......................................................................


res_pjsip: Set threadpool max size default to 50.

During a stress test of subscriptions, a huge blast of
subscription-related traffic resulted in the threadpool expanding to a
ridiculous number of threads. The balooning of threads resulted in an
increase of memory, which led to a crash due to being out of memory.

An easy fix for the particular test was to limit the size of the
threadpool, thus reining in the amount of memory that would be used. It
was decided that there really is no downside to having a non-infinite
default value for the maximum size of the threadpool, so this change
introduces 50 threads as the maximum threadpool size for the SIP
threadpool.

ASTERISK-25513 #close
Reported by John Bigelow

Change-Id: If0b9514f1d9b172540ce1a6e2f2ffa1f2b6119be
---
M res/res_pjsip/config_system.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved



diff --git a/res/res_pjsip/config_system.c b/res/res_pjsip/config_system.c
index 473eca8..dfd9240 100644
--- a/res/res_pjsip/config_system.c
+++ b/res/res_pjsip/config_system.c
@@ -180,7 +180,7 @@
 			OPT_UINT_T, 0, FLDSET(struct system_config, threadpool.auto_increment));
 	ast_sorcery_object_field_register(system_sorcery, "system", "threadpool_idle_timeout", "60",
 			OPT_UINT_T, 0, FLDSET(struct system_config, threadpool.idle_timeout));
-	ast_sorcery_object_field_register(system_sorcery, "system", "threadpool_max_size", "0",
+	ast_sorcery_object_field_register(system_sorcery, "system", "threadpool_max_size", "50",
 			OPT_UINT_T, 0, FLDSET(struct system_config, threadpool.max_size));
 	ast_sorcery_object_field_register(system_sorcery, "system", "disable_tcp_switch", "yes",
 			OPT_BOOL_T, 1, FLDSET(struct system_config, disable_tcp_switch));

-- 
To view, visit https://gerrit.asterisk.org/1549
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If0b9514f1d9b172540ce1a6e2f2ffa1f2b6119be
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list