<div dir="ltr">Hi Dan<div><br></div><div>Ok about not being able to force calculation, it's done periodically. But for some reason, it's not calculating =(</div><div><br></div><div>You misunderstood me about the machine. On this scenario, I have complete control of the machines, all physical machines are ours. When I said the system is not overloaded during the night, I mean that both physical and virtual machines are not being used at all (load 0%).</div><div><br></div><div>I just checked that at least one of these machines are physical and not virtual, this is the config:</div><div><div>CPU0: Intel(R) Xeon(R) CPU X5560 @ 2.80GHz (fam: 06, model: 1a, stepping: 05)</div></div><div>smpboot: Total of 8 processors activated (44687.68 BogoMIPS)<br></div><div><br></div><div>Based on your explanation, my physical machine with 2.8GHz is computing at 5MHz, which is surely wrong. </div><div><br></div><div>I have a similar scenario deployed on more than 50 machine and almost every time Mediaproxy is started at linux boot, it doesn't calculate and show speed. After restarting the process, speed is calculated fine. </div><div><br></div><div><div>Could you please consider that the software may have a bug? Are you interested on fixing it? Can I help?</div><div><br></div></div><div>Thanks</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 5:32 PM, Dan Pascu <span dir="ltr"><<a href="mailto:dan@ag-projects.com" target="_blank">dan@ag-projects.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 28 Mar 2017, at 20:55, Daniel Zanutti wrote:<br>
<br>
> Hi Dan<br>
><br>
> Thanks for answering.<br>
><br>
> The machine is not overloaded, actually i have the same problem with 10 calls or 1000 calls.<br>
><br>
</span><span class="">> Syslog:<br>
> Mar 28 14:51:45 MP-104 media-relay[782]: warning: Aggregate speed calculation time exceeded 10ms: 15214 us for 418 sessions<br>
><br>
><br>
> TOP:<br>
> load average: 0.56, 0.61, 0.63<br>
<br>
</span>You misunderstood me. I was not talking about your virtual machine, I was talking about the real hardware being overloaded, probably running too many virtual machines.<br>
<br>
>From inside the virtual machine you cannot assess how loaded the real hardware is. You can have 0% CPU load inside your virtual machine, that doesn't mean things are OK. The fact that inside your virtual machine an operation takes 600 times longer than on 5 years old real hardware, means that your system is unable to perform as it should. If the real hardware CPU runs at let's say 3GHz, this is equivalent to saying that your virtual machine has a CPU running at 3000MHz/600 = 5MHz. You try to run a media relay that has to react in real time inside a virtual machine that behaves as if it has a 5MHz CPU!<br>
<br>
You may prefer to run things on virtual machines for reasons related to costs, but at the end of the day one thing is clear: a media relay requires a RTOS. Linux running on real hardware is not an RTOS, but if the machine doesn't run other things that can influence the resource allocation, it can approximate one pretty well. A virtual machine running 600 times slower than real hardware, with resources shared between multiple virtual machines, is as far removed from the idea of a RTOS as it can possibly be.<br>
<span class=""><br>
> You are right about being virtual, but I'm sure the server is not overloaded because I have the same problem during the night, with almost no traffic. During the day, it MAY be overloaded but surely not during the night and this information never shows up on these relays.<br>
><br>
> Is there any way to force it? Could you give some directions?<br>
<br>
</span>Force what? As I said the traffic calculations are done periodically at an interval specified in the configuration, with the default being 15 seconds. You can disable them by setting the sampling interval to 0. The warning doesn't mean they are skipped, it only means the relay took too long to compute them and was unresponsive for other requests during that time.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Thanks<br>
><br>
><br>
> On Tue, Mar 28, 2017 at 2:27 PM, Dan Pascu <<a href="mailto:dan@ag-projects.com">dan@ag-projects.com</a>> wrote:<br>
><br>
> On 24 Mar 2017, at 19:51, Daniel Zanutti wrote:<br>
><br>
> > Hi<br>
> ><br>
> > Looks like i'm diving deep on mediaproxy.<br>
> ><br>
> > Some of our relays are not calculating the speed on the network. If I restart a couple times it starts calculating fine.<br>
> ><br>
> > I found this log:<br>
> > media-relay[4100]: warning: Aggregate speed calculation time exceeded 10ms: 11644 us for 222 sessions<br>
> ><br>
> > Is there any solution to always calculate?<br>
><br>
> The relay always calculates. That is just a warning when it takes too long, but the calculation still took place.<br>
><br>
> The reasons why you might not see traffic:<br>
><br>
> 1. There is no actual traffic, despite having sessions setup, the devices do not send media<br>
> 2. There is traffic but for some reason reading the traffic information from the kernel fails (I have no idea why that could happen, except maybe a severely overloaded virtual machine - see below)<br>
><br>
> I noticed something very wrong with that warning. On a machine running on a Core I7 from 2012 (Sandy Bridge architecture, so not the latest hardware, but something from 5 years ago), the calculation for 222 sessions, takes 20 us (that is micro seconds). You got 11644 us, which is approximately 600 times slower. Which means your virtual machine is severely overloaded, or the amount of resources it has allocated from the real hardware is abysmal.<br>
><br>
> On the same machine I mentioned before, having 2000 active sessions results in the speed calculations taking 170 us, which is well below the warning limit of 10 ms. Which means, the relay can drive thousands of sessions and you'll never see the warning.<br>
><br>
> In conclusion, unless you run on a severely overloaded system, or a very underpowered virtual machine, you should never see that warning and seeing the warning doesn't mean that calculations didn't take place.<br>
><br>
> --<br>
> Dan<br>
><br>
><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
><br>
> ______________________________<wbr>_________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
<br>
<br>
--<br>
Dan<br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>