some perfomance tweaks

This commit is contained in:
Anthony Minessale
2012-05-03 16:31:21 -05:00
parent 2368f556ac
commit 8664dc6d5a
10 changed files with 141 additions and 105 deletions
+14 -4
View File
@@ -91,6 +91,10 @@ static switch_status_t sofia_on_init(switch_core_session_t *session)
sofia_set_flag(tech_pvt, TFLAG_RECOVERED);
}
if (switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_INBOUND) {
nua_respond(tech_pvt->nh, 101, "Dialing", TAG_END());
}
if (sofia_test_flag(tech_pvt, TFLAG_OUTBOUND) || sofia_test_flag(tech_pvt, TFLAG_RECOVERING)) {
const char *var;
@@ -5343,7 +5347,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_chat_interface_t *chat_interface;
switch_api_interface_t *api_interface;
switch_management_interface_t *management_interface;
uint32_t cpus = switch_core_cpu_count();
struct in_addr in;
memset(&mod_sofia_globals, 0, sizeof(mod_sofia_globals));
@@ -5381,9 +5384,16 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for profiles to start\n");
switch_yield(1500000);
/* start one message thread per cpu */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Starting %u message threads.\n", cpus);
sofia_msg_thread_start(cpus);
mod_sofia_globals.cpu_count = switch_core_cpu_count();
mod_sofia_globals.max_msg_queues = mod_sofia_globals.cpu_count + 1;
if (mod_sofia_globals.max_msg_queues > SOFIA_MAX_MSG_QUEUE) {
mod_sofia_globals.max_msg_queues = SOFIA_MAX_MSG_QUEUE;
}
/* start one message thread */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Starting initial message thread.\n");
sofia_msg_thread_start(0);
if (switch_event_bind_removable(modname, SWITCH_EVENT_CUSTOM, MULTICAST_EVENT, event_handler, NULL,
&mod_sofia_globals.custom_node) != SWITCH_STATUS_SUCCESS) {