[OpenSIPS-Users] Mediaproxy speed calculations
Dan Pascu
dan at ag-projects.com
Tue Mar 28 16:32:52 EDT 2017
On 28 Mar 2017, at 20:55, Daniel Zanutti wrote:
> Hi Dan
>
> Thanks for answering.
>
> The machine is not overloaded, actually i have the same problem with 10 calls or 1000 calls.
>
> Syslog:
> Mar 28 14:51:45 MP-104 media-relay[782]: warning: Aggregate speed calculation time exceeded 10ms: 15214 us for 418 sessions
>
>
> TOP:
> load average: 0.56, 0.61, 0.63
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.
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!
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.
> 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.
>
> Is there any way to force it? Could you give some directions?
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.
>
> Thanks
>
>
> On Tue, Mar 28, 2017 at 2:27 PM, Dan Pascu <dan at ag-projects.com> wrote:
>
> On 24 Mar 2017, at 19:51, Daniel Zanutti wrote:
>
> > Hi
> >
> > Looks like i'm diving deep on mediaproxy.
> >
> > Some of our relays are not calculating the speed on the network. If I restart a couple times it starts calculating fine.
> >
> > I found this log:
> > media-relay[4100]: warning: Aggregate speed calculation time exceeded 10ms: 11644 us for 222 sessions
> >
> > Is there any solution to always calculate?
>
> The relay always calculates. That is just a warning when it takes too long, but the calculation still took place.
>
> The reasons why you might not see traffic:
>
> 1. There is no actual traffic, despite having sessions setup, the devices do not send media
> 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)
>
> 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.
>
> 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.
>
> 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.
>
> --
> Dan
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
--
Dan
More information about the Users
mailing list