<div dir="ltr"><div>Hi,</div><div>The number of shmem:fragments reduced by half and the real_used_size is lower as well.</div><div>Thanks<br></div><div class="gmail_quote">On Tue, Sep 11, 2012 at 11:12 AM, Uri Shacked <span dir="ltr">&lt;<a href="mailto:ushacked@gmail.com" target="_blank">ushacked@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">Thanks.<br>
Will it ork on pkg as well?<br>
<div class="im"><br>
On 9/11/12, Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; On 9/10/12 2:27 PM, Uri Shacked wrote:<br>
&gt;&gt; thanks a lot.<br>
&gt;&gt; so as i undestand, the real_used_size is the right value to calculate<br>
&gt;&gt; size. but, it grows because of fragmentation data.<br>
&gt;&gt; in the core, what does it mean &quot;It is effective if MEM_JOIN_FREE<br>
&gt;&gt; compile option is defined&quot;<br>
&gt;&gt; is there something else i need to do except adding to the cfg the<br>
&gt;&gt; mem_join=1 ?<br>
&gt; no, iirc MEM_JOIN_FREE is enabled by default -- this is an option to<br>
&gt; turn the feature off at compile time. Let us know if the number of<br>
&gt; fragments is lower.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Daniel<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Sep 10, 2012 at 2:39 PM, Daniel-Constantin Mierla<br>
</div><div class="im">&gt;&gt; &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;     Hello,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     On 9/10/12 1:14 PM, Uri Shacked wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     Thanks,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     The stuff i sent is from my test server that has 3.3.1 installed.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     On my prod servers i use 3.2.x.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     how would you explain that when kamailio starts (on prod with<br>
&gt;&gt;&gt;     similar data and same cfg) it take around 20% of the shmem, after<br>
&gt;&gt;&gt;     reload 30% and in time (6-8 weeks) it gets up to 39% ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     if used_size does not have variations, then it is no leak. The<br>
&gt;&gt;     variations of real_used_size is from fragmentation management --<br>
&gt;&gt;     each fragment has a structure associated to it.<br>
&gt;&gt;<br>
&gt;&gt;     Cheers,<br>
&gt;&gt;     Daniel<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt;     I start with 4G of shmem.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     It feels like a leak but i have trouble investigating it....<br>
&gt;&gt;&gt;     where would you look? The reload, the dialog or the avp&#39;s?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     BR,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     Uri<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     On Mon, Sep 10, 2012 at 11:06 AM, Daniel-Constantin Mierla<br>
</div><div><div class="h5">&gt;&gt;&gt;     &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         Hello,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         the used size is pretty much the same after the reload, so<br>
&gt;&gt;&gt;         doesn&#39;t look as leak. If you do 2-3 reloads is<br>
&gt;&gt;&gt;         shmem:used_size staying around same value?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         It is clear boost in the fragments, I would say that after<br>
&gt;&gt;&gt;         start the number of fragments is quite low, because it should<br>
&gt;&gt;&gt;         contain the good records in memory as well.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         Btw, the version 3.3.x has options for defragmentation, see<br>
&gt;&gt;&gt;         the core cookbook, you can enable it.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         Cheers,<br>
&gt;&gt;&gt;         Daniel<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         On 9/9/12 10:18 AM, Uri Shacked wrote:<br>
&gt;&gt;&gt;&gt;         Hi,<br>
&gt;&gt;&gt;&gt;         here is the statistics after kamailio starts:<br>
&gt;&gt;&gt;&gt;         shmem:fragments = 28<br>
&gt;&gt;&gt;&gt;         shmem:free_size = 3800871312<br>
&gt;&gt;&gt;&gt;         shmem:max_used_size = 494132368<br>
&gt;&gt;&gt;&gt;         shmem:real_used_size = 494095984<br>
&gt;&gt;&gt;&gt;         shmem:total_size = 4294967296<br>
&gt;&gt;&gt;&gt;         shmem:used_size = 342642072<br>
&gt;&gt;&gt;&gt;         here it is after reload of the num table:<br>
&gt;&gt;&gt;&gt;         shmem:fragments = 9161531<br>
&gt;&gt;&gt;&gt;         shmem:free_size = 3654274496<br>
&gt;&gt;&gt;&gt;         shmem:max_used_size = 959885552<br>
&gt;&gt;&gt;&gt;         shmem:real_used_size = 640692800<br>
&gt;&gt;&gt;&gt;         shmem:total_size = 4294967296<br>
&gt;&gt;&gt;&gt;         shmem:used_size = 342654552<br>
&gt;&gt;&gt;&gt;         here is the cfg part for mtree:<br>
&gt;&gt;&gt;&gt;         #------- mtree params -------------<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;db_url&quot;, CFGDB)<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;mtree&quot;,<br>
&gt;&gt;&gt;&gt;         &quot;name=odr;dbtable=service_odr_view;type=0;&quot;)<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;mtree&quot;,<br>
&gt;&gt;&gt;&gt;         &quot;name=oper;dbtable=service_oper_type;type=0;&quot;)<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;mtree&quot;,<br>
&gt;&gt;&gt;&gt;         &quot;name=permis;dbtable=service_permisions_to_oper;type=0;&quot;)<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;mtree&quot;,<br>
&gt;&gt;&gt;&gt;         &quot;name=num;dbtable=service_numbers_to_areas_view;type=0;&quot;)<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;char_list&quot;, &quot;0123456789&quot;)<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;pv_value&quot;, &quot;$avp(mtval)&quot;)<br>
&gt;&gt;&gt;&gt;         modparam(&quot;mtree&quot;, &quot;pv_values&quot;, &quot;$avp(mtvals)&quot;)<br>
&gt;&gt;&gt;&gt;         here is the number of raws from the DB:<br>
&gt;&gt;&gt;&gt;         SELECT count(*) FROM<br>
&gt;&gt;&gt;&gt;         `service`.`service_numbers_to_areas_view` = 4195528<br>
&gt;&gt;&gt;&gt;         and attached is the memory log.<br>
&gt;&gt;&gt;&gt;         thanks,<br>
&gt;&gt;&gt;&gt;         Uri<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;         On Fri, Sep 7, 2012 at 10:26 AM, Daniel-Constantin Mierla<br>
</div></div><div class="im">&gt;&gt;&gt;&gt;         &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;             Hello,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;             is this taken only after startup? Get one at startup and<br>
&gt;&gt;&gt;&gt;             another one after reload, so it can be compared.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;             Cheers,<br>
&gt;&gt;&gt;&gt;             Daniel<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;             On 9/6/12 9:22 AM, Uri Shacked wrote:<br>
&gt;&gt;&gt;&gt;&gt;             Hi,<br>
&gt;&gt;&gt;&gt;&gt;             here:<br>
&gt;&gt;&gt;&gt;&gt;             shmem:fragments = 143898<br>
&gt;&gt;&gt;&gt;&gt;             shmem:freesize = 3446570952<br>
&gt;&gt;&gt;&gt;&gt;             shmem:max_used_size = 861854768<br>
&gt;&gt;&gt;&gt;&gt;             shmem:real_used_size = 848396344<br>
&gt;&gt;&gt;&gt;&gt;             shmem:total_size = 4294967296<br>
&gt;&gt;&gt;&gt;&gt;             shmem:used_size = 319676976<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;             On Thu, Sep 6, 2012 at 9:49 AM, Daniel-Constantin<br>
</div>&gt;&gt;&gt;&gt;&gt;             Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;&gt;<br>
<div class="im">&gt;&gt;&gt;&gt;&gt;             wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                 Hello,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                 On 9/5/12 3:06 PM, Uri Shacked wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                     Hi,<br>
&gt;&gt;&gt;&gt;&gt;                     I use MTREE to load 5 million rows from the<br>
&gt;&gt;&gt;&gt;&gt;                     database. it takes about 30 sec to start<br>
&gt;&gt;&gt;&gt;&gt;                     kamailio and it is running great.<br>
&gt;&gt;&gt;&gt;&gt;                     Whern I check the shmem usage I see the data<br>
&gt;&gt;&gt;&gt;&gt;                     take about 0.8G out of 4G i set on shmem.<br>
&gt;&gt;&gt;&gt;&gt;                     When i reload the data while kamailio is<br>
&gt;&gt;&gt;&gt;&gt;                     running, the memory usage rises to 1.3G and<br>
&gt;&gt;&gt;&gt;&gt;                     stays there (the second and next reloads stays<br>
&gt;&gt;&gt;&gt;&gt;                     on 1.3G as well).<br>
&gt;&gt;&gt;&gt;&gt;                     Why doesn&#39;t it return to 0.8G after the reload<br>
&gt;&gt;&gt;&gt;&gt;                     is completed?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                 can you send the statistics related to shmem?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                 kamctl fifo get_statistics shmem:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                 There are different values there, some usage come<br>
&gt;&gt;&gt;&gt;&gt;                 from overhead of memory chunks management.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                 Cheers,<br>
&gt;&gt;&gt;&gt;&gt;                 Daniel<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;                 --<br>
&gt;&gt;&gt;&gt;&gt;                 Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
&gt;&gt;&gt;&gt;&gt;                 <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a><br>
</div>&gt;&gt;&gt;&gt;&gt;                 &lt;<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#%21/miconda</a>&gt; -<br>
<div class="im">&gt;&gt;&gt;&gt;&gt;                 <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
&gt;&gt;&gt;&gt;&gt;                 Kamailio Advanced Training, Berlin, Nov 5-8, 2012 -<br>
&gt;&gt;&gt;&gt;&gt;                 <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a><br>
&gt;&gt;&gt;&gt;&gt;                 Kamailio Advanced Training, Miami, USA, Nov 12-14,<br>
&gt;&gt;&gt;&gt;&gt;                 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;             --<br>
&gt;&gt;&gt;&gt;             Daniel-Constantin Mierla -<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
&gt;&gt;&gt;&gt;             <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a><br>
</div>&gt;&gt;&gt;&gt; &lt;<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#%21/miconda</a>&gt;  -<a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>

<div class="im">&gt;&gt;&gt;&gt;             Kamailio Advanced Training, Berlin, Nov 5-8, 2012<br>
</div>&gt;&gt;&gt;&gt; -<a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a><br>
<div class="im">&gt;&gt;&gt;&gt;             Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012<br>
&gt;&gt;&gt;&gt; -<a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         --<br>
&gt;&gt;&gt;         Daniel-Constantin Mierla -<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
</div>&gt;&gt;&gt;         <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a>  &lt;<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#%21/miconda</a>&gt;<br>

&gt;&gt;&gt; -<a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
<div class="im">&gt;&gt;&gt;         Kamailio Advanced Training, Berlin, Nov 5-8, 2012<br>
</div>&gt;&gt;&gt; -<a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a><br>
<div class="im">&gt;&gt;&gt;         Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012<br>
&gt;&gt;&gt; -<a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     --<br>
&gt;&gt;     Daniel-Constantin Mierla -<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
</div>&gt;&gt;     <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a>  &lt;<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#%21/miconda</a>&gt;<br>
&gt;&gt; -<a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
<div class="im">&gt;&gt;     Kamailio Advanced Training, Berlin, Nov 5-8, 2012<br>
</div>&gt;&gt; -<a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a><br>
<div class="im">&gt;&gt;     Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012<br>
</div>&gt;&gt; -<a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a><br>
<div class="im">&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
&gt; <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
&gt; Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a><br>
&gt; Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 -<br>
&gt; <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a><br>
&gt;<br>
&gt;<br>
<br>
--<br>
</div>Sent from my mobile device<br>
</blockquote></div><br></div>