[Asterisk-bsd] FreePBX reload is now very slow.

Ian FREISLICH ianf at clue.co.za
Mon Sep 13 08:06:17 CDT 2010


"Ian FREISLICH" wrote:
> It looks like the response from Asterisk is delayed by 0.1 seconds
> per lookup.  This neatly matches net.inet.tcp.delacktime (100ms).
> 
> Turning off delayed ack resolves the problem.  But I'd rather have
> delayed_ack enabled.  I'm not too familiar with the asterisk sources.
> Would main/tcptls.c be the place to set the TCP_NODELAY option on
> the SOCK_STREAM sockets?

Replying to myself - the following patch to asterisk fixes the problem:

--- main/tcptls.c.orig  2010-09-13 15:03:38.000000000 +0200
+++ main/tcptls.c       2010-09-13 15:02:48.000000000 +0200
@@ -329,6 +329,7 @@
        }
 
        setsockopt(desc->accept_fd, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x));
+       setsockopt(desc->accept_fd, IPPROTO_TCP, TCP_NODELAY, &x, sizeof(x));
        if (bind(desc->accept_fd, (struct sockaddr *)&desc->sin, sizeof(desc->sin))) {
                ast_log(LOG_ERROR, "Unable to bind %s to %s:%d: %s\n",
                        desc->name,


Ian

-- 
Ian Freislich



More information about the Asterisk-BSD mailing list