Re: [asterisk-users] MYSQL queries from dial plan

2010-01-04 Thread Steve Edwards
On Mon, 4 Jan 2010, Neeraj Chand wrote:

 I currently run small scale mysql queries from the dialplan

[snip]

 This currently takes about 4 seconds to complete.

 If I run two simultaneous queries, this goes up to about 9 seconds for 
 both queries to complete.

4 seconds for a query is a bit extreme. 9 seconds for 2 simultaneous 
queries reinforce my guess that it is a database issue, not an Asterisk 
issue.

What sort of response time to you get if you issue the queries from the 
mysql command prompt?

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] MYSQL queries from dial plan

2010-01-04 Thread Scott L. Lykens
 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@lists.digium.com] On Behalf Of Neeraj Chand
 Sent: Monday, January 04, 2010 1:17 AM
 To: asterisk-users@lists.digium.com
 Subject: [asterisk-users] MYSQL queries from dial plan

[mysql dialplan function]

 This currently takes about 4 seconds to complete.
 
 If I run two simultaneous queries, this goes up to about 9 seconds for
 both queries to complete.
 
 Is there a way that I can bring this time down?

How long does the query take when executed at the MySQL command line?

In my experience there is no perceptible Asterisk-related delay in
executing MySQL from the dialplan versus ODBC versus the MySQL command
line. Is DNS involved or do you access MySQL by IP?

A long time ago we had a poorly written LCR routine that ran for about 3
seconds on a large set of tables. A little bit of intelligence and
indexing has brought that down to 0.3 seconds on old single-core
hardware.

sl

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] MYSQL queries from dial plan

2010-01-04 Thread Peter Lindqvist

On Jan 4, 2010, at 3:06 PM, Steve Edwards wrote:

 On Mon, 4 Jan 2010, Neeraj Chand wrote:
 
 I currently run small scale mysql queries from the dialplan
 
 [snip]
 
 This currently takes about 4 seconds to complete.
 
 If I run two simultaneous queries, this goes up to about 9 seconds for 
 both queries to complete.
 
 4 seconds for a query is a bit extreme. 9 seconds for 2 simultaneous 
 queries reinforce my guess that it is a database issue, not an Asterisk 
 issue.
 
 What sort of response time to you get if you issue the queries from the 
 mysql command prompt?

This have happened to me in various situations and is usually a result of 
reverse DNS lookups failing on the MySQL side. See: 
http://dev.mysql.com/doc/refman/5.0/en/dns.html
for a solution to that if that is the issue.

Best regards,

Peter Lindqvist
Voxion Ltd.
www.voxion.net
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] MYSQL queries from dial plan

2010-01-03 Thread Neeraj Chand
Hi all, 

I currently run small scale mysql queries from the dialplan 

exten = s,n,MYSQL(Connect

exten = s,n,MYSQL(Query resultid ${connid}

exten = s,n,MYSQL(FETCH fetchid

exten = s,n,MYSQL(Clear ${resultid})
exten = s,n,MYSQL(Disconnect ${connid})


This currently takes about 4 seconds to complete.

If I run two simultaneous queries, this goes up to about 9 seconds for
both queries to complete. 

Is there a way that I can bring this time down? 

What sort of time delays are there if I use func_odbc? 

Thanks, 

Neeraj

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users