<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>Hi again.</div>
<div><br>
</div>
<div>I have set up wireshark to check why the CDR rating engine uses so much time.</div>
<div><br>
</div>
<div>The following SQL queries are run from CDRTool to my OpenSIPS server:</div>
<div>select * from domain;</div>
<div>select * from trusted_peers;</div>
<div>Select rpid from subscriber where username = ‘+47xxxxxxxx’ and domain = ‘example.sip.com’</div>
<div><br>
</div>
<div>(with username and domain scrambled here)</div>
<div><br>
</div>
<div>The rpid select statement is run for each caller in the search period. What is strange is that these selects are only run each 10 second, and if I am searching</div>
<div>Within a period of time and there has been 7 different callers, it will take 70 seconds. After this the GUI is “released” and updated with the maching CDR list.</div>
<div><br>
</div>
<div>My subscriber table in open sips is empty. Why does this take so long?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Tomas Andersen</div>
<div><br>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Tomas Andersen<br>
<span style="font-weight:bold">Date: </span>Friday 27 November 2015 at 09:10<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>"<br>
<span style="font-weight:bold">Subject: </span>CDR search slow in CDRTool<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hi</div>
<div><br>
</div>
<div>I have set up CDRTool to read CDRs from my radius database for OpenSIP calls. I am successfully rating calls, but everytime I search for CDR records using the </div>
<div>CDRTool GUI it takes 1-3 minutes before the search result window is shown.</div>
<div><br>
</div>
<div>If there are no matching records the result window is shown immediately. Does anyone else have any experience with this? I suspect that there might be a database lock,</div>
<div>Database connection pool problems or just some configuration error somewhere.</div>
<div><br>
</div>
<div>In my browser I get the following in my developer console / network (note the huge duration for the HTTP POST):</div>
<div><br>
</div>
<div>200 POST<span class="Apple-tab-span" style="white-space:pre"> </span>callsearch.pthml<span class="Apple-tab-span" style="white-space:pre"></span><destip><span class="Apple-tab-span" style="white-space:pre">
</span>html<span class="Apple-tab-span" style="white-space:pre"></span>105.41 kb<span class="Apple-tab-span" style="white-space:pre">
</span>150212 ms</div>
<div>200 GET<span class="Apple-tab-span" style="white-space:pre"> </span>date picker.css<span class="Apple-tab-span" style="white-space:pre"></span><destip><span class="Apple-tab-span" style="white-space:pre">
</span>css<span class="Apple-tab-span" style="white-space:pre"></span>9.96 kb<span class="Apple-tab-span" style="white-space:pre">
</span>14 ms</div>
<div><br>
</div>
<div>Followed by several lines of </div>
<div>304 GETs</div>
<div><br>
</div>
<div><br>
</div>
<div>When checking with Wireshark I notice that after the HTTP POST to callsearch, I get several TCP Keep-Alive messages as the server is slow..</div>
<div>After 2m 38 seconds everything is suddenly released and some HTTP GETs make the page to update.</div>
<div><br>
</div>
<div>I see nothing in syslog (from cdrtool) but some mysql connection statements.. No lock/unlock or similar statements..</div>
<div><br>
</div>
<div>
<div>I appreciate if anyone could enlighten me on this subject.</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div>Best Regards,</div>
<div>Tomas Andersen</div>
<div> </div>
<div>
<div id=""></div>
</div>
</div>
</div>
</span>
</body>
</html>