das sandesh
2009-Oct-21 18:30 UTC
[asterisk-users] Concurrent calls including mysql taking lot of time for execution
Hi, I tried getting our server setup for 400-500 simultaneous calls, calls were going through properly but at around 200-250 calls, mysql (connect ...) statement was taking at least 5-10 sec to connect to the database. I optimized all possible parameters in my.cnf: max_connection=1000 wait_timeout=60 query_cache_type=1 query_cache_limit=4M query_cache_size=512M interactive_timeout=120 connect_timeout=80 table_cache=1024 thread_concurrency=8 long_query_time=10 tmp_table_size=64M join_buffer_size=1M thread_cache_size=200 key_buffer=32M table_cache=1024 sort_buffer_size=2M read_buffer_size=2M read_rnd_buffer_size=4M And I am running on asterisk 1.4.22.1, Quadcore processor 2.4Ghz, 4GB RAM, mysql 5.0. Some times we get dead air even after 50-100 calls. Is there any other additional parameters or variables or resources (hardware) to be looked into to increase the speed of mysql connections? Your advice is really appreciated. Thanks Sandesh. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091021/dc517e88/attachment.htm
Steve Edwards
2009-Oct-21 19:21 UTC
[asterisk-users] Concurrent calls including mysql taking lot of time for execution
On Wed, 21 Oct 2009, das sandesh wrote:> I tried getting our server setup for 400-500 simultaneous calls, calls > were going through properly but at around 200-250 calls, mysql (connect > ...) statement was taking at least 5-10 sec to connect to the database. > I optimized all possible parameters in my.cnf:This isn't a "MySQL" performance list and I'm not an "expert," but... I cobbled up a little C program that created 1,000 concurrent connections to my database and it takes 0.15 seconds on an "AMD Phenom(tm) 8650 Triple-Core Processor." I confirmed via netstat that there were 1,000 connections. Opening and closing a single connection 1,000 times was still less than a second. This was connecting to "localhost" so it used the UNIX socket. Changing to a TCP socket took 0.19 seconds. I'd look elsewhere -- it's not the MySQL connection that's the problem. How are you connecting? Is in in an AGI? What language are you using? What are you doing with MySQL? A few more details will help :) -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
David Backeberg
2009-Oct-21 19:56 UTC
[asterisk-users] Concurrent calls including mysql taking lot of time for execution
On Wed, Oct 21, 2009 at 2:30 PM, das sandesh <sandesh440 at gmail.com> wrote:> I tried getting our server setup for 400-500 simultaneous calls, calls were > going through properly but at around 200-250 calls, mysql (connect ...) > statement was taking at least 5-10 sec to connect to the database. I > optimized all possible parameters in my.cnf:My guess is DNS taking a long time to timeout? Trying changing the connection string to use straight ip address rather than hostname.
Matt Riddell
2009-Oct-21 20:57 UTC
[asterisk-users] Concurrent calls including mysql taking lot of time for execution
On 22/10/09 7:30 AM, das sandesh wrote:> Hi, > > I tried getting our server setup for 400-500 simultaneous calls, calls > were going through properly but at around 200-250 calls, mysql (connect > ...) statement was taking at least 5-10 sec to connect to the database. > I optimized all possible parameters in my.cnf:Without knowing what you're optimising you're unlikely to have much luck just setting values. We have had quite good success with the tunish-primer.sh script: http://www.day32.com/MySQL/ http://www.day32.com/MySQL/tuning-primer.sh We run with MySQL at about 500 queries per second with no problems - we don't however use Asterisk's MySQL libraries. -- Cheers, Matt Riddell Director _______________________________________________ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer) http://www.venturevoip.com/c3.php (ConduIT3 PABX Systems)
Matt Riddell
2009-Oct-21 21:01 UTC
[asterisk-users] Concurrent calls including mysql taking lot of time for execution
On 22/10/09 8:56 AM, David Backeberg wrote:> On Wed, Oct 21, 2009 at 2:30 PM, das sandesh<sandesh440 at gmail.com> wrote: >> I tried getting our server setup for 400-500 simultaneous calls, calls were >> going through properly but at around 200-250 calls, mysql (connect ...) >> statement was taking at least 5-10 sec to connect to the database. I >> optimized all possible parameters in my.cnf: > > My guess is DNS taking a long time to timeout? > > Trying changing the connection string to use straight ip address > rather than hostname.Alternatively install a caching name server. In debian just do "apt-get install bind9" then change your nameserver to 127.0.0.1 -- Cheers, Matt Riddell Director _______________________________________________ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer) http://www.venturevoip.com/c3.php (ConduIT3 PABX Systems)