} TFLAGS;
#define SOFIA_MAX_MSG_QUEUE 64
-#define SOFIA_MSG_QUEUE_SIZE 100
+#define SOFIA_MSG_QUEUE_SIZE 250
struct mod_sofia_globals {
switch_memory_pool_t *pool;
runtime.cpu_count = sysinfo.dwNumberOfProcessors;
#endif
+ if (!runtime.cpu_count) runtime.cpu_count = 1;
+
/* If we have more than 1 cpu, we should use realtime priority so we can have priority threads */
if (runtime.cpu_count > 1) {
return set_realtime_priority();
}
#endif
+ if (!runtime.cpu_count) runtime.cpu_count = 1;
+
+
/* INIT APR and Create the pool context */
if (apr_initialize() != SWITCH_STATUS_SUCCESS) {
*err = "FATAL ERROR! Could not initialize APR\n";
#include <switch.h>
#include <switch_event.h>
//#define SWITCH_EVENT_RECYCLE
-#define DISPATCH_QUEUE_LEN 10000
+#define DISPATCH_QUEUE_LEN 1000
//#define DEBUG_DISPATCH_QUEUES
/*! \brief A node to store binded events */
launch_dispatch_threads(SOFT_MAX_DISPATCH + 1, DISPATCH_QUEUE_LEN, RUNTIME_POOL);
switch_mutex_unlock(EVENT_QUEUE_MUTEX);
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Out of event dispatch threads! Resorting to a blocking push.... Look for laggy event consumers or event_socket connections!\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Event Thread %d is blocking\n", my_id);
switch_queue_push(EVENT_DISPATCH_QUEUE[0], event);
+ event = NULL;
}
}
}
*/
/* don't need any more dispatch threads than we have CPU's*/
- MAX_DISPATCH = switch_core_cpu_count();
+ MAX_DISPATCH = switch_core_cpu_count() + 1;
switch_assert(pool != NULL);