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

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


Hi

After upgrading to 1.6 from ports, the FreePBX reload/commit changes
is extraordinarily slow.  It's sortof ok at home where I Have 10
extensions, but at work where there are 130 extensions it takes
well on a minute.

What seems to be holding things up is astdb lookups connections:

12:46:43.196443 IP (tos 0x0, ttl 64, id 48176, offset 0, flags [DF], proto TCP (6), length 120, bad cksum 0 (->804d)!)
    127.0.0.1.37272 > 127.0.0.1.5038: Flags [P.], cksum 0xfdf1 (correct), seq 1544:1612, ack 2618, win 8960, options [nop,nop,TS val 69263874 ecr 2011348549], length 68
        0x0000:  4500 0078 bc30 4000 4006 0000 7f00 0001  E..x.0 at .@.......
        0x0010:  7f00 0001 9198 13ae cc1a 8f91 efee b62d  ...............-
        0x0020:  8018 2300 fdf1 0000 0101 080a 0420 e202  ..#.............
        0x0030:  77e2 be45 4163 7469 6f6e 3a20 436f 6d6d  w..EAction:.Comm
        0x0040:  616e 640d 0a43 6f6d 6d61 6e64 3a20 6461  and..Command:.da
        0x0050:  7461 6261 7365 2067 6574 2041 4d50 5553  tabase.get.AMPUS
        0x0060:  4552 2035 3031 2f64 6963 7461 7465 2f65  ER.501/dictate/e
        0x0070:  6d61 696c 0d0a 0d0a                      mail....
12:46:43.196575 IP (tos 0x0, ttl 64, id 48177, offset 0, flags [DF], proto TCP (6), length 91, bad cksum 0 (->8069)!)
    127.0.0.1.5038 > 127.0.0.1.37272: Flags [P.], cksum 0x985c (correct), seq 2618:2657, ack 1612, win 8960, options [nop,nop,TS val 2011348549 ecr 69263874], length 39
        0x0000:  4500 005b bc31 4000 4006 0000 7f00 0001  E..[.1 at .@.......
        0x0010:  7f00 0001 13ae 9198 efee b62d cc1a 8fd5  ...........-....
        0x0020:  8018 2300 985c 0000 0101 080a 77e2 be45  ..#..\......w..E
        0x0030:  0420 e202 5265 7370 6f6e 7365 3a20 466f  ....Response:.Fo
        0x0040:  6c6c 6f77 730d 0a50 7269 7669 6c65 6765  llows..Privilege
        0x0050:  3a20 436f 6d6d 616e 640d 0a              :.Command..
12:46:43.296471 IP (tos 0x0, ttl 64, id 48180, offset 0, flags [DF], proto TCP (6), length 52, bad cksum 0 (->808d)!)
    127.0.0.1.37272 > 127.0.0.1.5038: Flags [.], cksum 0x9191 (correct), seq 1612, ack 2657, win 8960, options [nop,nop,TS val 69263974 ecr 2011348549], length 0
        0x0000:  4500 0034 bc34 4000 4006 0000 7f00 0001  E..4.4 at .@.......
        0x0010:  7f00 0001 9198 13ae cc1a 8fd5 efee b654  ...............T
        0x0020:  8010 2300 9191 0000 0101 080a 0420 e266  ..#............f
        0x0030:  77e2 be45                                w..E
12:46:43.296489 IP (tos 0x0, ttl 64, id 48181, offset 0, flags [DF], proto TCP (6), length 97, bad cksum 0 (->805f)!)
    127.0.0.1.5038 > 127.0.0.1.37272: Flags [P.], cksum 0x3721 (correct), seq 2657:2702, ack 1612, win 8960, options [nop,nop,TS val 2011348649 ecr 69263974], length 45
        0x0000:  4500 0061 bc35 4000 4006 0000 7f00 0001  E..a.5 at .@.......
        0x0010:  7f00 0001 13ae 9198 efee b654 cc1a 8fd5  ...........T....
        0x0020:  8018 2300 3721 0000 0101 080a 77e2 bea9  ..#.7!......w...
        0x0030:  0420 e266 4461 7461 6261 7365 2065 6e74  ...fDatabase.ent
        0x0040:  7279 206e 6f74 2066 6f75 6e64 2e0a 2d2d  ry.not.found..--
        0x0050:  454e 4420 434f 4d4d 414e 442d 2d0d 0a0d  END.COMMAND--...
        0x0060:  0a                                       .

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?

Ian

-- 
Ian Freislich



More information about the Asterisk-BSD mailing list