Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-6400

Improve sip ping generation by distributing them across an interval

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mod_sofia
    • Labels:
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • Userland:
      GNU/Linux
    • Distribution:
      CentOS
    • Distribution Version:
      CentOS 6
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      1cde5f01e0ffd206c8a455ba89b21e11eabf53a8
    • GIT Master Revision hash::
      1cde5f01e0ffd206c8a455ba89b21e11eabf53a8
    • Target Version:
      1.5

      Description

      Right now, fs sends out sip pings (if enabled) every registration-thread-frequency (by default 30 seconds)

      On large switches, with nated phones, is pretty common to have maybe 1000~10000 phones which means that freeswitch sends out 1000~10000 sip options packets every 30 seconds, without any throttling mechanism.

      This means that fs have to process many messages (responses) in short time).

      Also if you have an sbc or proxy in front of fs, this means bombing the poor sbc/proxy (and the packets from fs can be dropped...)

      This simple patch does the following:
      * split sip pings handling from registrations check timer
      * add param to control the sip ping thread timer ( ping-thread-frequency, by default 1 second )
      * add param to control the "mean" ping interval ( ping-mean-interval, by default 30 seconds )

      The interval is "mean" because a random, uniformly distributed delay is computed to have a "mean" of ping-mean-interval seconds.

      This allows to spread sip pings across the interval, avoiding the "bursts" that the current implementation does.

      Side note: because of linux rand() not being thread safe and win lacking drand48_r functions, a separate implementation of the random generator is made for both platforms. Both works under linux, but I have not tested under a windows platform.

        Attachments

          Activity

            People

            • Assignee:
              mikej Mike Jerris
              Reporter:
              mbranca Matteo Brancaleoni
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: