<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    maxbuffer doesn't influence processing of udp traffic, because each
    SIP message over UDP is handled at once, not internal buffering of
    many udp packets.<br>
    <br>
    You look at the statistics for network interface to see if there are
    dropped received packets (ifconfig should show that).<br>
    <br>
    What is the value for children parameter in kamailio.cfg?<br>
    <br>
    CentOS has lots of hidden and strange limits, the next suggestion I
    could do it to try on a Debian server<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 28/09/15 19:07, José Seabra wrote:<br>
    </div>
    <blockquote
cite="mid:CAEVZRWvgBsopEVQgpJcqGVcnV4JDnYYasAU=kSBvu0NRP=ZRzA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello Daniel,
        <div><br>
        </div>
        <div>Indeed xlog doesn't print in syslog the sip message
          received and wireshak got it, that means that packet was
          received in network interface but kamailio didn't received the
          packet(as xlog didn't print that packet).<br>
        </div>
        <div><br>
        </div>
        <div>Anyway i have configured the following parameters in sysctl</div>
        <div><br>
        </div>
        <div>
          <div style="margin:0px;padding:0px;border:0px"><span
              style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif">net.ipv4.udp_rmem_min
              = 131072</span><br>
          </div>
          <div style="margin:0px;padding:0px;border:0px">
            <div
style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:medium"><font
                style="margin:0px;padding:0px;border:0px">net.ipv4.udp_wmem_min
                = 131072</font></div>
            <div
style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:medium"><font
                style="margin:0px;padding:0px;border:0px">net.core.netdev_max_backlog=1000</font></div>
            <div
style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:medium"><font
                style="margin:0px;padding:0px;border:0px">net.core.rmem_max=67108864</font></div>
            <div
style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:medium"><font
                style="margin:0px;padding:0px;border:0px">net.ipv4.udp_mem
                = 192576 256768 385152</font></div>
            <div><font style="margin:0px;padding:0px;border:0px"><br>
              </font></div>
            <div>and also set maxbuffer=134190336 in my kamailio
              configuration.</div>
            <div><br>
            </div>
            <div>With these configurations I got an improvement but
              still below of what we need and even the CPU is between
              65% and 70%  sleeping.<br>
            </div>
            <div><br>
            </div>
            <div>Do you have any suggestion? the traffic average that
              interface receives now is 200mbs.</div>
            <div><br>
            </div>
            <div>The server network interface is 10GB.</div>
            <div><br>
            </div>
            <div>Any suggestion is welcome.</div>
            <div><br>
            </div>
            <div>Best Regards</div>
            <div>José Seabra</div>
            <div><br>
            </div>
          </div>
        </div>
        <div><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">2015-09-27 17:08 GMT+01:00
            Daniel-Constantin Mierla <span dir="ltr"><<a
                moz-do-not-send="true" href="mailto:miconda@gmail.com"
                target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a></a>></span>:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
                <br>
                first, be sure you run latest version of branch 4.3,
                there was a fix for dialog since 4.3.2.<br>
                <br>
                If a process in shown to run recvfrom() that means it
                waits for kernel to pass a new upd packet to it --
                recvfrom() is a function from standard lib c.<br>
                <br>
                Wireshark (like other sniffing tools) is capturing the
                network traffic before the kernel passes it to
                application layer. If wireshark see it, doesn't mean the
                application has received it from kernel, it can still be
                dropped by firewall or other kernel modules.<br>
                <br>
                You can add a xlog() at the beginning of request_route
                to see what requests are received by kamailio.<br>
                <br>
                Cheers,<br>
                Daniel
                <div>
                  <div><br>
                    <br>
                    <div>On 27/09/15 15:52, José Seabra wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">Hello Danel,
                        <div>Thank you for your response,</div>
                        <div><br>
                        </div>
                        <div>Well i don't have SELinux enabled and
                          IPTables isn't running.</div>
                        <div><br>
                        </div>
                        <div>About kamailio configuration, Pike module
                          isn't also enabled, the only thing that i have
                          enabled to limit the number of concurrent
                          calls  is the dialog module, counting the
                          number of active dialogs and reject next new
                          invites only  after it has reached the 10.000
                          simultaneous calls.</div>
                        <div><br>
                        </div>
                        <div>The strange behavior is that kamailio only
                          stop processing some sip messages like Byes
                          and 200 Ok after more or less 40 seconds after
                          siptester start sending calls.<br>
                        </div>
                        <div><br>
                        </div>
                        <div>And i can see several cases in wireshark
                          that kamailio receives BYES/200OK from
                          interface B(Carriers interface) but it isn't
                          forward to Interface A(customer interface), if
                          i make for example 20cps i don't have this
                          issue, all packets are handled correctly and
                          there isn't 408 requests timeouts.</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div>Best Regards</div>
                        <div>José Seabra</div>
                        <div><br>
                        </div>
                        <div> </div>
                      </div>
                      <div class="gmail_extra"><br>
                        <div class="gmail_quote">2015-09-27 13:52
                          GMT+01:00 Daniel-Constantin Mierla <span
                            dir="ltr"><<a moz-do-not-send="true"
                              href="mailto:miconda@gmail.com"
                              target="_blank">miconda@gmail.com</a>></span>:<br>
                          <blockquote class="gmail_quote"
                            style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                            <div bgcolor="#FFFFFF" text="#000000"> The
                              tmp variable is not intialized by default,
                              so it can be anything therefore the out of
                              bounds value. It used only when printing
                              some errors, so it didn't get a proper
                              value as no such error was printed for you
                              case.<br>
                              <br>
                              The backtrace shows the process in in
                              recvfrom(), so it waits for traffic from
                              network. That is the case when the
                              processing of former sip message was
                              finished and now Kamailio waits to receive
                              another one.<br>
                              <br>
                              If you run centos, be sure you don't have
                              limits in selinux rules - better disable
                              it completely and test again. Also, be
                              sure you don't have limits in the
                              firewall, especially contrack module and
                              sip firewall modules in the kernel.<br>
                              <br>
                              In kamailio.cfg, if you have pike module,
                              be sure you don't drop good packet with
                              this module.<br>
                              <br>
                              Cheers,<br>
                              Daniel
                              <div>
                                <div><br>
                                  <br>
                                  <div>On 25/09/15 19:53, José Seabra
                                    wrote:<br>
                                  </div>
                                </div>
                              </div>
                              <blockquote type="cite">
                                <div>
                                  <div>
                                    <div dir="ltr">
                                      <div>Adding more information to my
                                        last email, when kamailio starts
                                        receiving calls, after more or
                                        less 40 seconds it stops
                                        processing some sip messages.</div>
                                      <div><br>
                                      </div>
                                      I'm using the kamailio version
                                      4.3.2
                                      <div><br>
                                      </div>
                                      <div>Best Regards</div>
                                      <div><br>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </blockquote>
                            </div>
                          </blockquote>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <blockquote
cite="mid:CAEVZRWvgBsopEVQgpJcqGVcnV4JDnYYasAU=kSBvu0NRP=ZRzA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000">
                <div>
                  <div>
                    <pre cols="72"><table style="border-collapse:collapse"><tbody><tr width="100" style="float:right"><td style="float:right;margin-left:5px;padding:0px"></td><td style="float:right;margin-left:5px;padding:0px"></td><td style="float:right;padding:0px"></td></tr></tbody></table></pre>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
</pre>
  </body>
</html>