]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tune event socket params a bit
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 16 Dec 2010 17:34:02 +0000 (11:34 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 16 Dec 2010 17:34:02 +0000 (11:34 -0600)
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
src/switch_event.c

index ee7cfc9eafd8903112746c3f462af1033cd3e27d..596a953dcbca1882b52df7ce70b91b7542c0cf8c 100644 (file)
@@ -31,8 +31,8 @@
  */
 #include <switch.h>
 #define CMD_BUFLEN 1024 * 1000
-#define MAX_QUEUE_LEN 5000
-#define MAX_MISSED 200
+#define MAX_QUEUE_LEN 25000
+#define MAX_MISSED 2000
 SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load);
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown);
 SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime);
@@ -170,7 +170,7 @@ static switch_status_t socket_logger(const switch_log_node_t *node, switch_log_l
                if (switch_test_flag(l, LFLAG_LOG) && l->level >= node->level) {
                        switch_log_node_t *dnode = switch_log_node_dup(node);
 
-                       if (switch_queue_trypush(l->log_queue, dnode) == SWITCH_STATUS_SUCCESS) {
+                       if (switch_queue_push(l->log_queue, dnode) == SWITCH_STATUS_SUCCESS) {
                                if (l->lost_logs) {
                                        int ll = l->lost_logs;
                                        switch_event_t *event;
@@ -366,7 +366,7 @@ static void event_handler(switch_event_t *event)
 
                if (send) {
                        if (switch_event_dup(&clone, event) == SWITCH_STATUS_SUCCESS) {
-                               if (switch_queue_trypush(l->event_queue, clone) == SWITCH_STATUS_SUCCESS) {
+                               if (switch_queue_push(l->event_queue, clone) == SWITCH_STATUS_SUCCESS) {
                                        if (l->lost_events) {
                                                int le = l->lost_events;
                                                l->lost_events = 0;
@@ -1233,7 +1233,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
                                if (switch_channel_get_state(chan) < CS_HANGUP && switch_channel_test_flag(chan, CF_DIVERT_EVENTS)) {
                                        switch_event_t *e = NULL;
                                        while (switch_core_session_dequeue_event(listener->session, &e, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
-                                               if (switch_queue_trypush(listener->event_queue, e) != SWITCH_STATUS_SUCCESS) {
+                                               if (switch_queue_push(listener->event_queue, e) != SWITCH_STATUS_SUCCESS) {
                                                        switch_core_session_queue_event(listener->session, &e);
                                                        break;
                                                }
index f782c15900504a28b3f31765d351b3b1c06032cc..dce42f8e2982ea6fa14782140a9841d936abb478 100644 (file)
@@ -339,7 +339,7 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
                                        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 threads!\n");
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Out of event dispatch threads! Slowing things down.\n");
                                        switch_yield(1000000);
                                }
                        }