[Freeswitch-dev] Fwd: Call Center - Memory Leak

Mersed Kahrimanovic kahrimanovic.mersed at gmail.com
Mon Apr 25 17:11:31 MSD 2016


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.

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.

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


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).
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.

In order to isolate an issue and to conclude that we don'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)

For the reference:

*Aws:* m4.large
         vCPU: 2
         RAM: 8GB
         Throughput (Mbps): 450

*Freeswitch version:* 1.6.7
*OS:* Debian GNU/Linux 8 (jessie)
*Number of agents:* 30
*Number of calls per agent:* 1
*Total numbers of channels at time:* 60
*Agents simulated with:* pjsip(http://www.pjsip.org/)
*Contact simulated with:* sipp(http://sipp.sourceforge.net/)
*Configuration:* I used configuration which came with installation of
freeswitch. The only things i changed is:
     - default password
     - internal rtp timeout
     - rtpip and sip ip

Test scenario:
1. Start the freeswitch.
2. Autoload lua script is going to ring all of the internal (agents) and
push them to the extension where we had mod_fifo
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.
4. mod_fifo will do the rest, bridge agent with the contact and handling
the queue properly.

As a result we will have 30 agents constantly "talking", 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).

Dialplan for handling mod_fifo

Autoload lua script


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.

My question is:
Is this something which can be considered as memory leak, or this is simply
how freeswitch works, behaves and requirements it have?

Thank you,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20160425/cca34039/attachment.html 

Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-dev mailing list