High CPU Usage

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

High CPU Usage

Lloyd Hughes
Hi,

I ran a test of a very simple Click2Call application and the server was brought to its knees at about 20 concurrent calls. The CPU was completely maxed out. I am running JRuby 1.7.13, centos 6.5 with 8GB RAM and 8 CPU cores. It is a fairly beefy server and running Asterisk with Stripped down FreePBX we normally get about 100 concurrent calls out of it. The Jruby process spikes to 50% CPU usage every time it initiates a call and each call uses about 3 to 4% CPU.

The application is a modification of Justin Aiken's Click2Call app. It has a small HTTP API places a call, and initiates a dial when the agent answers. On the dial it plays a ringback tone and also starts recording the call when the calls are joined. When the call ends it writes a CDR to the DB.

This CPU usage seems very high and when I enable trace logging there is a ton of data coming in via the AMI, even if no calls have been originated via adhearsion. The asterisk instance is used for the call center, of which quite a few calls are made via a normal SIP phone. All the data related to these calls still comes via the AMI, and I think this could be causing the problem. I enabled the trace logging for about 20 seconds and ended up with around 30000 lines of logs. Surely this large amount of data add significant load to adhearsion? Is there anything I should do to JRuby in order to tweak it for better performance? I am using RVM to manage my Ruby versions.

My manager.conf file has the following entry:

[ahnuser]

secret = ***********

deny=0.0.0.0/0.0.0.0

permit=127.0.0.1/255.255.255.0

read = allwrite = all

eventfilter = !Event: RTCP*

eventfilter = !Variable: RTPAUDIOQOS*

Any help will be appreciated. 


Thanks

Lloyd

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: High CPU Usage

Justin Aiken
Hi Lloyd,


Most AMI events you probably don’t need, so you can nix them with that… should help a bit.  

-Justin

El ago 27, 2014, a las 9:57 AM, Lloyd <[hidden email]> escribió:

Hi,

I ran a test of a very simple Click2Call application and the server was brought to its knees at about 20 concurrent calls. The CPU was completely maxed out. I am running JRuby 1.7.13, centos 6.5 with 8GB RAM and 8 CPU cores. It is a fairly beefy server and running Asterisk with Stripped down FreePBX we normally get about 100 concurrent calls out of it. The Jruby process spikes to 50% CPU usage every time it initiates a call and each call uses about 3 to 4% CPU.

The application is a modification of Justin Aiken's Click2Call app. It has a small HTTP API places a call, and initiates a dial when the agent answers. On the dial it plays a ringback tone and also starts recording the call when the calls are joined. When the call ends it writes a CDR to the DB.

This CPU usage seems very high and when I enable trace logging there is a ton of data coming in via the AMI, even if no calls have been originated via adhearsion. The asterisk instance is used for the call center, of which quite a few calls are made via a normal SIP phone. All the data related to these calls still comes via the AMI, and I think this could be causing the problem. I enabled the trace logging for about 20 seconds and ended up with around 30000 lines of logs. Surely this large amount of data add significant load to adhearsion? Is there anything I should do to JRuby in order to tweak it for better performance? I am using RVM to manage my Ruby versions.

My manager.conf file has the following entry:

[ahnuser]

secret = ***********

deny=0.0.0.0/0.0.0.0

permit=127.0.0.1/255.255.255.0

read = allwrite = all

eventfilter = !Event: RTCP*


eventfilter = !Variable: RTPAUDIOQOS*

Any help will be appreciated. 


Thanks

Lloyd


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: High CPU Usage

Ben Langfeld
In reply to this post by Lloyd Hughes
You can try Justin's suggestion, which will relieve some load, but probably not as much as you would like. Additionally, you might try filtering other events in Asterisk if you do not require them.

Realistically, though, if you're in a situation where your Asterisk instance is processing a large number of calls that are unrelated to Adhearsion, you're probably not going to get satisfactory performance. I'd suggest you consider isolating your Adhearsion app with its own Asterisk instances and if necessary interface with the original instances via SIP.

Ben

Enviado via iPad

Em 27 Aug 2014, às 12:57, Lloyd <[hidden email]> escreveu:

Hi,

I ran a test of a very simple Click2Call application and the server was brought to its knees at about 20 concurrent calls. The CPU was completely maxed out. I am running JRuby 1.7.13, centos 6.5 with 8GB RAM and 8 CPU cores. It is a fairly beefy server and running Asterisk with Stripped down FreePBX we normally get about 100 concurrent calls out of it. The Jruby process spikes to 50% CPU usage every time it initiates a call and each call uses about 3 to 4% CPU.

The application is a modification of Justin Aiken's Click2Call app. It has a small HTTP API places a call, and initiates a dial when the agent answers. On the dial it plays a ringback tone and also starts recording the call when the calls are joined. When the call ends it writes a CDR to the DB.

This CPU usage seems very high and when I enable trace logging there is a ton of data coming in via the AMI, even if no calls have been originated via adhearsion. The asterisk instance is used for the call center, of which quite a few calls are made via a normal SIP phone. All the data related to these calls still comes via the AMI, and I think this could be causing the problem. I enabled the trace logging for about 20 seconds and ended up with around 30000 lines of logs. Surely this large amount of data add significant load to adhearsion? Is there anything I should do to JRuby in order to tweak it for better performance? I am using RVM to manage my Ruby versions.

My manager.conf file has the following entry:

[ahnuser]

secret = ***********

deny=0.0.0.0/0.0.0.0

permit=127.0.0.1/255.255.255.0

read = allwrite = all

eventfilter = !Event: RTCP*

eventfilter = !Variable: RTPAUDIOQOS*

Any help will be appreciated. 


Thanks

Lloyd

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: High CPU Usage

Lloyd Hughes
Hi Ben,

I have filtered as many events as I can from the asterisk side, I think your approach is correct. It is unfortunate but looks like I will need a separate Asterisk instance for this. Does Freeswitch suffer from the same issues or does Rayo have better filtering for events?

I will probably move away from Adhearsion for this and move directly to a SIP based click2call solution.

Thanks

On Thursday, 28 August 2014 15:16:03 UTC+2, Ben Langfeld wrote:
You can try Justin's suggestion, which will relieve some load, but probably not as much as you would like. Additionally, you might try filtering other events in Asterisk if you do not require them.

Realistically, though, if you're in a situation where your Asterisk instance is processing a large number of calls that are unrelated to Adhearsion, you're probably not going to get satisfactory performance. I'd suggest you consider isolating your Adhearsion app with its own Asterisk instances and if necessary interface with the original instances via SIP.

Ben

Enviado via iPad

Em 27 Aug 2014, às 12:57, Lloyd <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3gJ7YdoHAggJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">hughes...@...> escreveu:

Hi,

I ran a test of a very simple Click2Call application and the server was brought to its knees at about 20 concurrent calls. The CPU was completely maxed out. I am running JRuby 1.7.13, centos 6.5 with 8GB RAM and 8 CPU cores. It is a fairly beefy server and running Asterisk with Stripped down FreePBX we normally get about 100 concurrent calls out of it. The Jruby process spikes to 50% CPU usage every time it initiates a call and each call uses about 3 to 4% CPU.

The application is a modification of Justin Aiken's Click2Call app. It has a small HTTP API places a call, and initiates a dial when the agent answers. On the dial it plays a ringback tone and also starts recording the call when the calls are joined. When the call ends it writes a CDR to the DB.

This CPU usage seems very high and when I enable trace logging there is a ton of data coming in via the AMI, even if no calls have been originated via adhearsion. The asterisk instance is used for the call center, of which quite a few calls are made via a normal SIP phone. All the data related to these calls still comes via the AMI, and I think this could be causing the problem. I enabled the trace logging for about 20 seconds and ended up with around 30000 lines of logs. Surely this large amount of data add significant load to adhearsion? Is there anything I should do to JRuby in order to tweak it for better performance? I am using RVM to manage my Ruby versions.

My manager.conf file has the following entry:

[ahnuser]

secret = ***********

deny=0.0.0.0/0.0.0.0

permit=127.0.0.1/255.255.255.0

read = allwrite = all

eventfilter = !Event: RTCP*

eventfilter = !Variable: RTPAUDIOQOS*

Any help will be appreciated. 


Thanks

Lloyd

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3gJ7YdoHAggJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">adhearsion+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: High CPU Usage

Ben Langfeld
Rayo, being inherently multi-tenant does not suffer the same problem.

Em 29/08/2014, às 06:48, Lloyd <[hidden email]> escreveu:

Hi Ben,

I have filtered as many events as I can from the asterisk side, I think your approach is correct. It is unfortunate but looks like I will need a separate Asterisk instance for this. Does Freeswitch suffer from the same issues or does Rayo have better filtering for events?

I will probably move away from Adhearsion for this and move directly to a SIP based click2call solution.

Thanks

On Thursday, 28 August 2014 15:16:03 UTC+2, Ben Langfeld wrote:
You can try Justin's suggestion, which will relieve some load, but probably not as much as you would like. Additionally, you might try filtering other events in Asterisk if you do not require them.

Realistically, though, if you're in a situation where your Asterisk instance is processing a large number of calls that are unrelated to Adhearsion, you're probably not going to get satisfactory performance. I'd suggest you consider isolating your Adhearsion app with its own Asterisk instances and if necessary interface with the original instances via SIP.

Ben

Enviado via iPad

Em 27 Aug 2014, às 12:57, Lloyd <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3gJ7YdoHAggJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">hughes...@...> escreveu:

Hi,

I ran a test of a very simple Click2Call application and the server was brought to its knees at about 20 concurrent calls. The CPU was completely maxed out. I am running JRuby 1.7.13, centos 6.5 with 8GB RAM and 8 CPU cores. It is a fairly beefy server and running Asterisk with Stripped down FreePBX we normally get about 100 concurrent calls out of it. The Jruby process spikes to 50% CPU usage every time it initiates a call and each call uses about 3 to 4% CPU.

The application is a modification of Justin Aiken's Click2Call app. It has a small HTTP API places a call, and initiates a dial when the agent answers. On the dial it plays a ringback tone and also starts recording the call when the calls are joined. When the call ends it writes a CDR to the DB.

This CPU usage seems very high and when I enable trace logging there is a ton of data coming in via the AMI, even if no calls have been originated via adhearsion. The asterisk instance is used for the call center, of which quite a few calls are made via a normal SIP phone. All the data related to these calls still comes via the AMI, and I think this could be causing the problem. I enabled the trace logging for about 20 seconds and ended up with around 30000 lines of logs. Surely this large amount of data add significant load to adhearsion? Is there anything I should do to JRuby in order to tweak it for better performance? I am using RVM to manage my Ruby versions.

My manager.conf file has the following entry:

[ahnuser]

secret = ***********

deny=0.0.0.0/0.0.0.0

permit=127.0.0.1/255.255.255.0

read = allwrite = all

eventfilter = !Event: RTCP*

eventfilter = !Variable: RTPAUDIOQOS*

Any help will be appreciated. 


Thanks

Lloyd

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3gJ7YdoHAggJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">adhearsion+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.