<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="NL">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="NL"><o:p> </o:p></span></p>
<p class="MsoNormal">We’re currently using the NEventSocket library to control our freeswitch servers for starting python scripts (using a backgroundjob and pyrun py_module_name) which internally use the freeswitch.py library to originate a call.<o:p></o:p></p>
<p class="MsoNormal">However, we’re running into some performance limitations where we can’t seem to get more than 5 call setups per second.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">To quote the documentation (<a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_python">https://freeswitch.org/confluence/display/FREESWITCH/mod_python</a>):<o:p></o:p></p>
<p class="MsoNormal">“A single python interpreter is spawned at module startup and used for the lifetime of the freeswitch process.”<o:p></o:p></p>
<p class="MsoNormal">“Each thread swaps in its "thread state" before executing python code and then swaps it out when finished. Also during blocking calls into freeswitch, a thread will swap out its thread state in order to not block other threads, and then
swap it in after the blocking call to freeswitch has finished.”<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">How does this relate to the number of threads freeswitch is allowed to start and run python scripts? If there are hard limitations set, can these be increased? I couldn’t find hard numbers in the source files, so this may be controlled
somewhere else?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 1.5pt 0cm">
<p class="MsoNormal"><span style="font-size:16.0pt;color:#1657EA">Grant Bagdasarian</span><span style="font-size:12.0pt;color:#1657EA"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 15.0pt 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Senior Developer</span><span style="font-size:9.0pt;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 1.5pt 0cm">
<p class="MsoNormal"><span style="font-size:9.0pt;color:#1657EA"><o:p> </o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 15.0pt 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;color:#1657EA"><a href="https://cm.com"><span style="color:blue">cm.com</span></a></span><span style="font-size:9.0pt;color:#1657EA"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:3.75pt 0cm 16.5pt 0cm">
<p class="MsoNormal"><o:p> </o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="NL"><o:p> </o:p></span></p>
</div>
</body>
</html>