Asterisk 11 mysql realtime failing with overload

Hello,
I have Asterisk 11.0.2, running realtime with a2billing agi script, under Centos 6.4.

My Problem, is when I start to receive much traffic, over 400 channles, asterisk-mysql connector start to fail, and get stacked, and all calls are being dropped.

In the asterisk log I have:

When this lines apear in the log, calls are being stacked in slinces and apear as:

So, this lack of activity it’s comming due to mysql no reponse, as you can see…

This behavior take some seconds, asterisk reconnect, and then calls start to flue back untill next peak…

In my res_odbc.conf I have give:

[quote]pooling => no
limit => 10
pre-connect => yes
share_connections => yes[/quote]

In my res_config_mysql.conf I have:

[quote][general]
dbname = XXXXX
dbuser = xxxxx
dbpass = xxxxxxxx
dbport = 3306
dbsock = /var/lib/mysql/mysql.sock
dbcharset = utf8
requirements=warn[/quote]

[quote] # ulimit -n
750000[/quote]

My server is running dual Intel(R) Xeon(R) CPU E5-2470 0 @ 2.30GHz with 32 CPUs, within 32GB Ram, and 100GB in swap.
and lastly my.cnf is:

[quote][mysql]

CLIENT

port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
user=mysql
max_connections = 50000
skip_innodb
key_buffer_size = 20G
myisam_sort_buffer_size = 16M
join_buffer_size = 1M
read_buffer_size = 2M
sort_buffer_size = 2M
table_cache = 1028
thread_cache_size = 9000
tmp_table_size = 32M
max_heap_table_size = 32M
max_allowed_packet = 1920M
max_connect_errors = 1000000
read_rnd_buffer_size = 1024M
bulk_insert_buffer_size = 396M
query_cache_limit = 8098M
query_cache_size =0
query_cache_type = 0
query_prealloc_size = 65536
query_alloc_block_size = 131072
default-storage-engine = MyISAM
symbolic-links=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
thread_concurrency = 100[/quote]

Please any idea into this, I’m turning since one week, and I have contracted several experts, no one solve it, if any, can help, share idea, or advice, even professionally, I’d apreciate help!

Regards,