Asterisk 12 Crashes with TLS load

I was testing my asterisk server with sipp (traffic generator). The server is a t1.micro amazon ec2 instance. My set up is as follows:

I have three instances, Server ‘A’ runs asterisk 12, with real-time configuration enabled and is the server I have to test. Server ‘B’ is the traffic generator and Server ‘C’ is another Asterisk 11 instance. Server C is registered as a Trunk in Server A. Server A,B runs on Ubuntu 14.04 and Server C is a pbx in a flash instance. Server B and C are m1.medium instances.

Server B registers as real-time extensions in server A and dials to extension 1000. The 1000 extension dials SIP/SERVER-C/1000 which plays an audio.

The Server B - Server A connections are encrypted(signalling via TLS and each RTP is RTP/SAVPF with crypto AES_CM_128_HMAC_SHA1_80 and AES_CM_128_HMAC_SHA1_32) but Server A - Server C connections are unencrypted.

The traffic I generated was as follows

1 call in 1 second, each call of 10 s duration. (1 call = REGISTER -> MAKE CALL -> HANGUP)
Hence maximum concurrent calls will be 10 calls (which i verified by ‘core show channels command’). The calls were generated from 10 different extensions. Qualify interval is 60s with OPTIONS message and 200 OK reply. Each call opens its own port and I have my ulimit value for asterisk set at 1024000.

The load average value in the server was below 0.50 and remains there when suddenly, this value spikes to 700 and asterisk crashes. The time for this crash is inversely proportional to the load. When I increase the load to 20 concurrent calls, this crash occurs faster and when I reduce it to 5 concurrent calls the crash is delayed. But it crashes anyway. All crashes happens after running for atleast 5 minutes.

The crash also occurs with no rtp and just TLS registrations and qualify when 2500 extensions were registered at a rate of 2 reg/sec over 900 s (15 minutes) with qualifyfreq 60s.

I don’t think this is a big load for asterisk and I’m not able to find out the reason behind this crash. And I couldn’t find anything in the logs. It just shows the registration and call logs. And by crash, I mean the asterisk service is stopped/killed.

Can anyone help me? Thanks in advance

Without the traceback from the crash dump, there is probably nothing you can do. You will need an unoptimised build for this.

If it is deadlocking, one would normally ask for thread debugging but that would have a considerable impact on performance.

Have you considered that you may just have gone over quota on your CPU usage.

In any case, I don’t understand why you would want to benchmark Asterisk on a VM instance type that really is not intended for performance sensitive applications…

This is a part of my project - to build a scale-able system using many small instances as and when required, dynamically. So I want to know how much load a small system can take for my load distribution calculations. Can the issue be a deadlock? Or is it because of the Asterisk 12 stability issue? Any tips for pin pointing what the cause is? I am not much familiar working with low level stuff … +Backtrace

I would suggest testing it to its limits on low powered real hardware, e.g. Raspberry Pi, before you try it on a service that was never intended for such applications. That way you can separate issues to do with the service from those due to running Asterisk on underpowered hardware.