[prev in list] [next in list] [prev in thread] [next in thread] 

List:       serusers
Subject:    Re: [SR-Users] pv_buffer_size limit
From:       Daniel-Constantin Mierla <miconda () gmail ! com>
Date:       2019-10-20 7:02:59
Message-ID: 70ea2807-3f1d-f9be-7bcd-04e50473ce25 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

you have to allocate more private (pkg) memory via -M command line
parameter.

Maybe in the future there should be a change in evapi module not to use
the pv static buffer for its parameter, as I can see it has use cases
with large values.

Cheers,
Daniel

On 19.10.19 21:22, Sergiu Pojoga wrote:
> Hi ppl,
>
> I'm testing this external app (cgrates, you all know it) that talks to
> Kamailio via evapi. 
> Every /n/ minutes the app sends an evapi request to Kamailio which
> returns back the list of all dialogs like so:
>
> jsonrpc_exec('{"jsonrpc":"2.0","id":1, "method":"dlg.list","params":[]}');
> evapi_relay("{\"event\":\"CGR_DLG_LIST_REPLY\",
> \"jsonrpl_body\":$jsonrpl(body)}");
>
> The problem is that the size of /$jsonrpl(body)/ PV is limited by
> Kamailio's /pv_buffer_size/ setting.
>
> My math shows that a single dialog is about 1KiB of json data.
>
> *Problem*: Kamailio fails to start with a /pv_buffer_size /higher
> than 117 KiB (119808 bytes), which in turn rends the system's limit to
> about 117 simultaneous calls... pretty sad.
>
> Below find the error when trying to start Kamailio with higher values:
>
>  0(17080) ERROR: <core> [core/mem/q_malloc.c:291]: qm_find_free():
> qm_find_free(0x7f02275c5010, 120832); Free fragment not found!
>  0(17080) ERROR: <core> [core/mem/q_malloc.c:425]: qm_malloc():
> qm_malloc(0x7f02275c5010, 120832) called from core: core/pvapi.c:
> pv_init_buffer(2069), module: core; Free fragment not found!
>  0(17080) ERROR: <core> [core/pvapi.c:2072]: pv_init_buffer(): cannot
> init PV print buffer slot[39]
>
> Is there a workaround for this?
>
> Thanks,
> --Sergiu
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat


[Attachment #5 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>you have to allocate more private (pkg) memory via -M command
      line parameter.</p>
    <p>Maybe in the future there should be a change in evapi module not
      to use the pv static buffer for its parameter, as I can see it has
      use cases with large values.<br>
    </p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 19.10.19 21:22, Sergiu Pojoga wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJZsGCnZ1oFknRsTrMunNm3B6v+XzP8_raUZyxDt4ZE_sAu5WQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi ppl,<br>
        <div><br>
        </div>
        <div>I'm testing this external app (cgrates, you all know it)
          that talks to Kamailio via evapi. </div>
        <div>Every <i>n</i> minutes the app sends an evapi request to
          Kamailio which returns back the list of all dialogs like so:</div>
        <div><br>
        </div>
        jsonrpc_exec('{"jsonrpc":"2.0","id":1,
        "method":"dlg.list","params":[]}');<br>
        evapi_relay("{\"event\":\"CGR_DLG_LIST_REPLY\",<br>
        <div>\"jsonrpl_body\":$jsonrpl(body)}");</div>
        <div><br>
        </div>
        <div>The problem is that the size of <i>$jsonrpl(body)</i> PV
          is limited by Kamailio's <i>pv_buffer_size</i> setting.</div>
        <div><br>
        </div>
        <div>My math shows that a single dialog is about 1KiB of json
          data.</div>
        <div><br>
        </div>
        <div><b>Problem</b>: Kamailio fails to start with a <i>pv_buffer_size
          </i>higher than 117 KiB (119808 bytes), which in turn rends
          the system's limit to about 117 simultaneous calls... pretty
          sad.<br>
        </div>
        <div><br>
        </div>
        <div>Below find the error when trying to start Kamailio with
          higher values:</div>
        <div><br>
        </div>
        <div> 0(17080) ERROR: &lt;core&gt; [core/mem/q_malloc.c:291]:
          qm_find_free(): qm_find_free(0x7f02275c5010, 120832); Free
          fragment not found!<br>
           0(17080) ERROR: &lt;core&gt; [core/mem/q_malloc.c:425]:
          qm_malloc(): qm_malloc(0x7f02275c5010, 120832) called from
          core: core/pvapi.c: pv_init_buffer(2069), module: core; Free
          fragment not found!<br>
           0(17080) ERROR: &lt;core&gt; [core/pvapi.c:2072]:
          pv_init_buffer(): cannot init PV print buffer slot[39]<br>
        </div>
        <div><br>
        </div>
        <div>Is there a workaround for this?</div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>--Sergiu</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" \
wrap="">_______________________________________________ Kamailio (SER) - Users \
Mailing List <a class="moz-txt-link-abbreviated" \
href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a> <a \
class="moz-txt-link-freetext" \
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
 </pre>
    </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, Oct 21-23, 2019, Berlin, Germany -- <a \
class="moz-txt-link-freetext" \
href="https://asipto.com/u/kat">https://asipto.com/u/kat</a></pre>  </body>
</html>


[Attachment #6 (text/plain)]

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic