<p></p>
<h3>Description</h3>
<p>The commands available to extract dialog information <code>dlg.profile_list</code> and <code>dlg.list</code><br>
Are not fast enough to output a large amount of dialogs.</p>
<p>After doing some benchmark the time is spent in in <code>rpc->struct_add</code>, <code>rpc->add etc</code>, etc.<br>
it appears to be slowing down linearly.</p>
<h3>Possible Solutions</h3>
<p>I made a quick POC to verify what I can get if I output to file instead and I got blazing fast performance, this is good news since it means that iterating over the hash table etc. is super fast.</p>
<p><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/jchavanton/kamailio/commit/f28c5a6b6364d79ee35acb5be439e57612ad67ed/hovercard" href="https://github.com/jchavanton/kamailio/commit/f28c5a6b6364d79ee35acb5be439e57612ad67ed">jchavanton@<tt>f28c5a6</tt></a></p>
<pre><code> dialog: outputing large amount of dialogs to file

Test:
1) injecting 100K dialogs with voip_perf

2) confirmation that we have 100K+ dialogs
kamcmd dlg.profile_get_size outbound_call
100879

3) execute the quickly hacked modifications to output to /tmp/dialogs.txt
kamctl rpc dlg.profile_list outbound_call

3.1) verify how long it took
2020-03-31T22:28:18.398916476Z 12(31) : dialog [dialog.c:2174]: internal_rpc_profile_print_dlgs(): profile->lock
2020-03-31T22:28:18.554379411Z 12(31) : dialog [dialog.c:2190]: internal_rpc_profile_print_dlgs(): profile->lock release
// command took less then 20ms

3.2) verify the content of the output
wc   /tmp/dialogs.txt
  124355   117324 20547037 /tmp/dialogs.txt

Note about the content
// not everything is outputed in this quick hack but we can imagine that the impact will be very low.
call-id[uV.YzlhIZd1inE8SYDAlzmOLG12tYqVS]from[sip:voip_perf@147.75.65.247]to[sip:12060412757@52.42.112.21]h_entry[6207]h_id[44579]ref[2]contact[sip:voip_perf@147.75.65.247:5072;transport=udp]cseq[19528]
</code></pre>
<h3>Additional Information</h3>
<p>I am thinking about adding commands to output to file in <code>json</code> and/or <code>csv</code></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2269">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMPWAZ45VUHNZZC7RTRKJ2LZANCNFSM4LYEMCBA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZPSECG64WSBDZTXN2TRKJ2LZA5CNFSM4LYEMCBKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4I2BRMDQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2269",
"url": "https://github.com/kamailio/kamailio/issues/2269",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>