<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><tt>Thank you for <tt>the logs, <tt>t</tt></tt>his is <tt>what
I was looking for:</tt></tt></p>
<p><tt><tt><tt>Sep 12 19:39:34 sturn-test
/usr/local/sbin/opensips[23877]:
DBG:rest_client:start_async_http_req: libcurl TCP connect:
we should wait up to 977ms (timeout=1000ms)!<br>
Sep 12 19:39:34 sturn-test /usr/local/sbin/opensips[23877]:
DBG:rest_client:start_async_http_req: busy waiting 98ms ...</tt></tt></tt></p>
<p><tt><tt><tt><tt>So libcurl tells us <tt>we should</tt> wait<tt>,</tt>
at most, 1 second before <tt>we can proceed <tt>with the
tra<tt>nsfer</tt></tt>. <tt>The logic <tt>I added <tt>on
the dev branch <tt>only waits 10% of this
interval (<tt>98</tt>ms), but it's <tt>obviously
<tt>way too much, since <tt>the <tt>connection
is up within 8<tt>ms</tt></tt><tt></tt></tt><tt></tt>.</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></p>
<p><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>I will <tt>rework <tt><tt>this
10% logic</tt> into a "connect_<tt>poll<tt>ing_interval</tt>"
(milliseconds) module parameter<tt>,
so you ca<tt>n customize it <tt>according
to your environment</tt> and <tt>start
<tt>your </tt>transfers a lot
faster</tt></tt><tt>.</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt></tt></tt><tt></tt></tt></tt></tt></tt><br>
</p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 13.09.2016 21:14, Ramachandran,
Agalya (Contractor) wrote:<br>
</div>
<blockquote
cite="mid:2d60484295b4484ab569b2b77a674936@COPDCEX28.cable.comcast.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New",serif;
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New",serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle26
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle27
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle28
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle29
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle30
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle31
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle32
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle33
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:blue">Hi Liviu, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:blue">I have configured
“Connection_timeout” value as ‘1’ and ran 2 sipp calls.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue">After TCP port is
opened, HTTP request is sent out approx. 95 to 100ms later.
Am attaching the log of the opensips by enabling debugging
log.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:blue">I took the code
from master branch and tested it out. If you find everything
OK let me know.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue">Or if you feel to
test any specific scenario please update me, so that I can
test and share you the results.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:blue">P.S:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue">One more
observance.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue">In the case of
synchronous, TCP port is opened within 8 ms, whereas in the
case of async TCP port is opening after 100 ms.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue">Is it the expected
behavior?. <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:blue">What will be
expected time to give this fix in a branch version?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue">Log file ~70 MB if
I enable the debug calls for single call and couldn’t post
you that log, since it says limit for email is 40 MB.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:blue">Regards,<br>
Agalya<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
style="color:windowtext"> Liviu Chircu
[<a class="moz-txt-link-freetext" href="mailto:liviu@opensips.org">mailto:liviu@opensips.org</a>]
<br>
<b>Sent:</b> Monday, September 12, 2016 4:06 AM<br>
<b>To:</b> OpenSIPS users mailling list
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a>; Ramachandran, Agalya
(Contractor) <a class="moz-txt-link-rfc2396E" href="mailto:Agalya_Ramachandran@comcast.com"><Agalya_Ramachandran@comcast.com></a><br>
<b>Subject:</b> Re: FW:[OpenSIPS-Users] Asynchronous
operation for REST queries<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><tt><span style="font-size:10.0pt">Hi Agalya,</span></tt><o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">The "connection_timeout"
is a configurable module parameter, so tuning it properly
might just solve your problem.</span></tt><o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">If you need more
assistance, please enable debug logging (log_level = 4),
run the query and post the full log output.</span></tt><o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">Best regards,</span></tt><o:p></o:p></p>
<pre>Liviu Chircu<o:p></o:p></pre>
<pre>OpenSIPS Developer<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 09.09.2016 23:04, Ramachandran, Agalya
(Contractor) wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:blue">Hi Liviu, </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue">I have tested
the patch. Now I see the delay is 2 secs. i.e after 2 secs
it sends the HTTP request out.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue">I suspect this
2000 ms delay is due to the below field:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:red">long
connection_timeout = 20; </span>
<o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue">Can we reduce
this field to 5 or 10, so that it waits only half a second
or second to send the request out.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue">Let me know your
thoughts on this. </span>
<o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue">Am seeing the
below message in logs. Is everything working as you
expected?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:red">rest_client:start_async_http_req:
libcurl TCP connect: we should wait up to 1ms
(timeout=20000ms)!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue">Regards,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:blue">Agalya</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
style="color:windowtext"> Liviu Chircu [<a
moz-do-not-send="true"
href="mailto:liviu@opensips.org">mailto:liviu@opensips.org</a>]
<br>
<b>Sent:</b> Thursday, September 08, 2016 7:05 AM<br>
<b>To:</b> Ramachandran, Agalya (Contractor) <a
moz-do-not-send="true"
href="mailto:Agalya_Ramachandran@comcast.com">
<Agalya_Ramachandran@comcast.com></a>;
Bogdan-Andrei Iancu <a moz-do-not-send="true"
href="mailto:bogdan@opensips.org">
<bogdan@opensips.org></a>; OpenSIPS users
mailling list <a moz-do-not-send="true"
href="mailto:users@lists.opensips.org">
<users@lists.opensips.org></a><br>
<b>Subject:</b> Re: FW:[OpenSIPS-Users] Asynchronous
operation for REST queries</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">Hi, Agalya!</span></tt><o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">Regarding the 10s delay
problem, a fix was pushed to the development branch [1].
If you are running on 2.1.4 git branch, could you please
pull the latest changes (git pull --rebase), and test it
out? You can import it with:</span></tt><o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">git cherry-pick -x
66c337cc</span></tt><o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">[1]: <a
moz-do-not-send="true"
href="https://github.com/OpenSIPS/opensips/commit/66c337cc89a2b5c3e1bbd78c289371efcda21886">https://github.com/OpenSIPS/opensips/commit/66c337cc89a2b5c3e1bbd78c289371efcda21886</a></span></tt><o:p></o:p></p>
<p><tt><span style="font-size:10.0pt">Best regards,</span></tt><o:p></o:p></p>
<pre>Liviu Chircu<o:p></o:p></pre>
<pre>OpenSIPS Developer<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>