<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Hi Anthony,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Sorry, I forgot to mention that I already ran the test with the valgrind and i was not able to find anything. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Additionally, on your question i did quite a lot research before I sent this email. As per my understanding, behavior I encountered and documentation i read, freeswitch will not release memory until its restarted. (and that is happening in my case as well, if I stop the calls, memory will not increase anymore for sure, but will not decrease until you stop/restart freeswitch - When i start calling again it will follow already explained pattern).</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">I can create the ticket for sure and copy all of the relevant data from my first email to the JIRA.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Thank you,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Mersed</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 25, 2016 at 7:35 PM, Mersed Kahrimanovic <span dir="ltr">&lt;<a href="mailto:kahrimanovic.mersed@gmail.com" target="_blank">kahrimanovic.mersed@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Hi Nicholas, thank you for your reply.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Regarding your questions:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br>1. Are you sure that channels are being released -&gt; yes for sure. That is the first thing i checked. Test environment which is created do not goes over 65 channels as i mentioned within initial email.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">channels count, status and all other cli comands confirms that.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Additionally on sipp side you are always able to check in live how much calls you have connected currently.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">2. Regarding the schedule hangup, there is no issues with it i suppose, because i use schedule hangup to recreate simple call center with pure freeswitch installation. Within our call center solution we are not hanging up calls like that and it is encountering same issue as well.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">3. Regarding the request for memory usage per application:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">    That test i explained above is created using plain freeswitch installation without any kind of additions. Basically during that test, on server we had only freeswitch running and nothing else. As a confirmation here is the screenshot <a href="http://prnt.sc/awpxr6" target="_blank">http://prnt.sc/awpxr6</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Additionally i need to mention that i ran the same test before maybe few weeks ago with valgrind, and I was not able to find anything.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">All the best,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Mersed</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 25, 2016 at 7:18 PM, Nicholas Blasgen <span dir="ltr">&lt;<a href="mailto:nicholas@hellohunter.com" target="_blank">nicholas@hellohunter.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">NewRelic, which you seem to be using, also provides per-application memory usage.  Would be nice to see that after a day or partial day run.<div><br></div><div>Freeswitch uses a good amount of memory per channel.  Are you sure the channels are being released?  fs_cli -x status &gt;&gt; log_file ... and maybe run it on a crontab just to make sure the channels are being released.</div><div><br></div><div>Besides that, I personally don&#39;t have any ideas without recreating your test environment.  I guess you could see if FIFO or Scheduled Hangup is the issue by calling HANGUP instead of FIFO for extension 7011.  I&#39;ve never personally used Schedule Hangup and as that&#39;s the method being used here to release the channels, it might be a concern.</div></div><div class="gmail_extra"><br clear="all"><div><div><br><div>Nicholas Blasgen</div><div>Developer</div><div>Predictive Dialer Limited</div><div><a href="tel:%2B1%20%28724%29%20252-7436" value="+17242527436" target="_blank">+1 (724) 252-7436</a> (cell)</div><div>Skype: nblasgen</div><div><br></div><div><font color="#666666">24/7 Support available:</font></div><div><font color="#666666"><a href="http://www.hellohunter.com" target="_blank">www.hellohunter.com</a> | <a href="tel:%28800%29%20513-5555" value="+18005135555" target="_blank">(800) 513-5555</a> | skype hello.hunter | <a href="mailto:support@hellohunter.com" target="_blank">support@hellohunter.com</a></font></div></div></div>
<br><div class="gmail_quote"><div><div>On Mon, Apr 25, 2016 at 6:11 AM, Mersed Kahrimanovic <span dir="ltr">&lt;<a href="mailto:kahrimanovic.mersed@gmail.com" target="_blank">kahrimanovic.mersed@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:large">Hello,<br></div><div class="gmail_quote"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">We have implemented call center using a freeswitch as switch for handling calls. It is basically the logic where you have an agents within the queue waiting for an contacts to come in, or contact within the queue waiting if there is no any agents available.</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">For this kind of implementation we used pure lua and hash tables (and not mod_fifo) in order to have a better flexibility and possibility to manage different contact/agent states.</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">Everything was working fine on our old servers, now we are migrating to the cloud and we are using aws for that purpose, of course trying to cut some costs.</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">---------------</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">After initial setup of our solution we found out that there is a memory leak causing for freeswitch to consume 3 - 10 MB per minute during production hours.  (we did not notice anything on old servers because we had like 24 cores and 94GB of ram on those).</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">This is not too much of course but the bottom point is that increase is linear and its constantly raising consuming more and more of RAM.</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">In order to isolate an issue and to conclude that we don&#39;t have an issue within our solution I installed 1.6.7 version of freeswitch and setup really simple call center with mod_fifo without anything else (totally independent from call center we are working on)</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">For the reference:</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><b>Aws:</b> m4.large</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">         vCPU: 2</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">         RAM: 8GB</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">         Throughput (Mbps): 450         </div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br><b>Freeswitch version:</b> 1.6.7<br><b>OS:</b> Debian GNU/Linux 8 (jessie)</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><b>Number of agents:</b> 30</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><b>Number of calls per agent:</b> 1</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><b>Total numbers of channels at time:</b> 60</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><b>Agents simulated with:</b> pjsip(<a href="http://www.pjsip.org/" target="_blank">http://www.pjsip.org/</a>)</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><b>Contact simulated with:</b> sipp(<a href="http://sipp.sourceforge.net/" target="_blank">http://sipp.sourceforge.net/</a>) </div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><b>Configuration:</b> I used configuration which came with installation of freeswitch. The only things i changed is:</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">     - default password</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">     - internal rtp timeout</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">     - rtpip and sip ip</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">Test scenario:<br>1. Start the freeswitch.<br>2. Autoload lua script is going to ring all of the internal (agents) and push them to the extension where we had mod_fifo <br>3. After some time, same autoload script is going to start calling contacts each 800 miliseconds and push them to the extension where we have mod_fifo.</div><div style="font-family:arial,helvetica,sans-serif;font-size:large">4. mod_fifo will do the rest, bridge agent with the contact and handling the queue properly.</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">As a result we will have 30 agents constantly &quot;talking&quot;, and when ever call is dropped we will have agent connected with another. Parameters for the test match that scenario, and we dont have more then 60 - 65 channels open at the time (never).</div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large">Dialplan for handling mod_fifo</div><div><font face="arial, helvetica, sans-serif" size="4"><a href="http://pastie.org/10812261" target="_blank">http://pastie.org/10812261</a></font><br></div><div><font face="arial, helvetica, sans-serif" size="4"><br></font></div><div><font face="arial, helvetica, sans-serif" size="4">Autoload lua script</font></div><div><font face="arial, helvetica, sans-serif" size="4"><a href="http://pastie.org/10812263" target="_blank">http://pastie.org/10812263</a><br></font></div><div><font face="arial, helvetica, sans-serif" size="4"><br></font></div><div><font face="arial, helvetica, sans-serif" size="4">Result</font></div><div><font face="arial, helvetica, sans-serif" size="4"><a href="http://prnt.sc/awm4ao" target="_blank">http://prnt.sc/awm4ao</a></font><br></div><div><font face="arial, helvetica, sans-serif" size="4"><br></font></div><div><font face="arial, helvetica, sans-serif" size="4">The results are for 24hrs period, and indeed 24hrs is a lot. We will never have production running more then 12hrs (and daily restart will occur). But this basically means that we are not able to host more then 40-45 agents on servers with 8GB of ram.</font></div><div><font face="arial, helvetica, sans-serif" size="4"><br></font></div><div><font face="arial, helvetica, sans-serif" size="4">My question is:</font></div><div><font face="arial, helvetica, sans-serif" size="4">Is this something which can be considered as memory leak, or this is simply how freeswitch works, behaves and requirements it have?</font></div><div><font face="arial, helvetica, sans-serif" size="4"><br></font></div><div><font face="arial, helvetica, sans-serif" size="4">Thank you,</font></div><div><font face="arial, helvetica, sans-serif" size="4"><br></font></div><div><font face="arial, helvetica, sans-serif" size="4">Mersed</font></div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:large"><br></div></div>
</div><br></div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" rel="noreferrer" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>