<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>The rpc command is to arm the printing of the pkg usage summary
      in the syslog file. Then, when the kamailio process handles the
      next sip message, it is printing the summary in the syslog file,
      so look inside /var/log/syslog or /var/log/messages, you should
      spot the related log messages, they should contain "summary" or
      something similar...</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 16.10.22 23:48, mayamatakeshi wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABaNFCa0ZnRmU0Wgjfq=aSQS85i2WGVu72noCHQXjWpChqs4pQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Fri, Oct 14, 2022 at 5:25
            PM Daniel-Constantin Mierla <<a
              href="mailto:miconda@gmail.com" moz-do-not-send="true"
              class="moz-txt-link-freetext">miconda@gmail.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div>
              <p>OK. Can you run the tests for a while and then execute:</p>
              <p>kamctl rpc corex.pkg_summary idx 1</p>
              <p>The value for idx should be the kamailio process
                expected to handle sip traffic. If it is mostly udp and
                the first socket is the corresponding udp socket, then
                the value 1, like above, is ok. If it is tcp/tls or you
                have different listen parameters on udp, see the
                processes index with:</p>
              <p>kamctl ps</p>
            </div>
          </blockquote>
          <div>I tried calling <br>
          </div>
          <div>
            <div>  kamctl rpc corex.pkg_summary idx 1</div>
            before and after the memory problem started to be logged but
            it always showed up with result empty:
            <div><br>
            </div>
            {<br>
              "jsonrpc":  "2.0",<br>
              "result": {<br>
              },<br>
              "id": 3824999<br>
            <div>} </div>
            <div><br>
            </div>
            <div>Here is result for all processes:</div>
            <div>  <a href="https://pastebin.com/AabwyJwx"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://pastebin.com/AabwyJwx</a><br>
            </div>
            <div>I tried several times but I never saw a non-empty
              result.</div>
            <div> <br>
            </div>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div>
              <p>It should not be required to wait till you get out of
                memory errors, but be sure you run it long enough to
                have many accounting records written by the process that
                is going to print the pkg summary. You can eventually
                set the children to 1 or 2, to "force" traffic via a
                smaller group of processes.</p>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>By reducing children from</div>
          <div>  children=12</div>
          <div>to</div>
          <div>  children=1</div>
          <div>I started to get memory allocation error just a after a
            few minutes of load test:</div>
          <div><br>
          </div>
          <div>[root@lab002107-flip-server ~]$ grep memory
            /var/log/kamailio/kamailio.log |head<br>
            2022-10-17T06:20:41.314619+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: acc [acc_extra.c:234]: extra2strar(): could not
            allocate private memory from pkg pool<br>
            2022-10-17T06:20:41.916596+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: acc [acc_extra.c:234]: extra2strar(): could not
            allocate private memory from pkg pool<br>
            2022-10-17T06:20:41.916786+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: acc [acc_extra.c:234]: extra2strar(): could not
            allocate private memory from pkg pool<br>
            2022-10-17T06:20:42.518013+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: acc [acc_extra.c:234]: extra2strar(): could not
            allocate private memory from pkg pool<br>
            2022-10-17T06:20:42.518248+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: acc [acc_extra.c:234]: extra2strar(): could not
            allocate private memory from pkg pool<br>
            2022-10-17T06:20:43.114454+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: <core> [core/rvalue.c:253]: rval_new_empty():
            could not allocate private memory from pkg pool<br>
            2022-10-17T06:20:43.163816+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: <core> [core/rvalue.c:253]: rval_new_empty():
            could not allocate private memory from pkg pool<br>
            2022-10-17T06:20:43.165863+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: <core> [core/rvalue.c:253]: rval_new_empty():
            could not allocate private memory from pkg pool<br>
            2022-10-17T06:20:43.167092+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: <core> [core/rvalue.c:253]: rval_new_empty():
            could not allocate private memory from pkg pool<br>
            2022-10-17T06:20:43.167247+09:00 lab002107-flip-server
            /usr/local/src/git/kamailio-master/src/kamailio[3576087]:
            ERROR: <core> [core/data_lump.c:163]:
            insert_new_lump_before(): could not allocate private memory
            from pkg pool<br>
          </div>
          <div><br>
          </div>
          <div>I collected the pkg summary after 4000 CDRs were written
            to DB but again, i could not see a non-empty result:</div>
          <div>  <a href="https://pastebin.com/CpaRYLAR"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://pastebin.com/CpaRYLAR</a> <br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
  Nov 7-10, 2022 (Europe Timezone)
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>