<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/3823/">https://reviewboard.asterisk.org/r/3823/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On July 17th, 2014, 9:43 a.m. CDT, <b>Paul Belanger</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Could you maybe explain why this is needed? I couldn't find anything on Jira / wiki that explained the need.  I assume it is because of performance issues?</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch is the 'sledgehammer' option for tweaking your system's performance. It was a natural extension of https://issues.asterisk.org/jira/browse/ASTERISK-23811.

Say, for example, you know that don't want RTCP events. That means you don't want them from AMI, and you don't mind breaking res_hep_rtcp (now up on review board) as well. You know, beyond a shadow of a doubt, that your system will never, ever, under any circumstance, want this information.

You could, of course, just filter out the events from AMI, and not load res_hep_rtcp. However, Asterisk is still doing work under the hood:

(1) We are grabbing snapshots of things from the Stasis cache, and building out a new Stasis message, allocating some memory along the way
(2) We're publishing the information to everyone who may want it on the Stasis message bus
(3) Since there are no consumers, we're dereferencing the message, calling destructors and disposing of memory

And we're doing all of this for every RTP channel, all the time. And no one wants it :-(

This patch lets you get rid of all that extra work by just killing the message type. If the message type is not present, then we don't do the vast majority of what I just listed out, and things continue to move along.

Will that improve performance? Sure, since you're not doing the work any more. Do we know how much? Nope, because this is so system dependent it's impossible to guess. But at least if someone *does* run into a problem, they have some options on what all their system attempts to do.</pre>
<br />










<p>- Matt</p>


<br />
<p>On July 17th, 2014, 7:49 a.m. CDT, opticron wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers and Corey Farrell.</div>
<div>By opticron.</div>


<p style="color: grey;"><i>Updated July 17, 2014, 7:49 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This introduces stasis.conf and a mechanism to prevent certain message types from being published.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tested by causing the stasis unittests to fail with the following stasis.conf configuration:
[declined_message_types]
decline=TestMessage</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>trunk/tests/test_stasis_channels.c <span style="color: grey">(418715)</span></li>

 <li>trunk/tests/test_stasis.c <span style="color: grey">(418715)</span></li>

 <li>trunk/main/stasis_message.c <span style="color: grey">(418715)</span></li>

 <li>trunk/main/stasis_cache.c <span style="color: grey">(418715)</span></li>

 <li>trunk/main/stasis.c <span style="color: grey">(418715)</span></li>

 <li>trunk/include/asterisk/stasis.h <span style="color: grey">(418715)</span></li>

 <li>trunk/configs/stasis.conf.sample <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/3823/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>