Re: [asterisk-users] MYSQL problem

2010-01-28 Thread David Gibbons
snip
However, if you're going to be doing
massive joins for reporting, you're better off using something else (or
running individual MySQL slaves, whose purpose is to run those complex queries
and doing nothing else).  In a past life, our MySQL database ran circles
around Oracle, Informix, and DB2... until someone ran a massive join on the
same server, which caused MySQL to crawl.
/snip

Good distinction to make. I should have been more clear.

I believe mysql has read only slave capabilities within a clustered 
environment, so your point about the slaves isn't out of the question.

However I don't believe in database engines doing really anything other than 
transaction processing. That's why IMHO there should always be a distinction 
between the database backend and whatever software you're using to generate 
OLAP data (this software should NOT be the database engine). I know this is not 
a common opinion, but if we keep the database engine doing what it's good at 
and leave any report processing to external software, we're generally able to 
get better performance out of each individual piece...

-Dave

-- 
_
-- 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 problem

2010-01-27 Thread Zhang Shukun
2010/1/27 Steve Edwards asterisk@sedwards.com:
 Un-mid-posting...

 On Fri, 22 Jan 2010, Zhang Shukun wrote:

 as you know, we can use MYSQL command to visit mysql database but if i
 use other database like Oracke,sybase,etc, Could i use MYSQL command ?

 2010/1/23 Steve Edwards asterisk@sedwards.com:

 ODBC will do what you want.

 Personally, I'd vote for an AGI using whatever C API your DB provides
 -- like Pro*C to access Oracle.

 You will have access to all of the features of your DB and your
 dialplan will be a lot cleaner and easier to maintain.

 On Wed, 27 Jan 2010, Zhang Shukun wrote:

 Thanks, while i think because oracle has no offical ODBC for linux
 system. is that better use mysql than oracle. considering the
 perfoermace and speed. many people around think mysql is not a good
 option for database, they think mysql is only suit for small business.
 but i want to have a try. i need to convince them to use this.

 So don't use ODBC, use Pro*C...

you said Personally, I'd vote for an AGI using whatever C API your DB provides

what do you think about phpagi and cagi, if i choose the agi method.

while phpagi seems used more popular than cagi.


 Back when Yahoo was relevant, they ran on MySQL.

 Can you quantify your requirements (number of rows, queries per second,
 simultaneous connections) and test it on hardware similar to your
 production environment?

i cant quantify my requirement now. but the business has not be start.

and the user will increase as time going.


 While I'm sure Yahoo spent a lot of time and money designing and tuning
 their system, sometimes explain plan can point you to small changes that
 yield significant results.

 If your shop is committed to Oracle, can finance the licenses, and has the
 in-house talent -- use it. Nobody ever lost their job by buying IBM...


 --
 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




-- 
Best regards,
Sucan

-- 
_
-- 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 problem

2010-01-27 Thread Tilghman Lesher
On Wednesday 27 January 2010 01:34:57 Zhang Shukun wrote:
 2010/1/23 Steve Edwards asterisk@sedwards.com:
  On Fri, 22 Jan 2010, Zhang Shukun wrote:
  as you know, we can use MYSQL command to visit mysql database
 
  but if i use other database like Oracke,sybase,etc, Could i use MYSQL
  command ?
 
  ODBC will do what you want.

 Thanks, while i think because oracle has no offical ODBC for linux system.

I've used this driver with Oracle before with good results.  Just make sure
that you use the full Oracle libraries, not the Instant Client.  The Instant
Client has a severe resource leak that makes it inappropriate for long-running
processes.

http://home.fnal.gov/~dbox/oracle/odbc/

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com  www.asterisk.org

-- 
_
-- 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 problem

2010-01-27 Thread David Gibbons
This is WAY OT but I had no idea what fnal.gov was, so I checked it out:
http://computing.fnal.gov/xms/Services/Getting_Services/Web_at_Fermilab/Professional_Home_Pages_at_Fermilab

And I quote ...professional information about themself...

About themself? Really? Really?

That is all.

Cheers
Dave

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Tilghman Lesher
Sent: Wednesday, January 27, 2010 10:25 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] MYSQL problem

On Wednesday 27 January 2010 01:34:57 Zhang Shukun wrote:
 2010/1/23 Steve Edwards asterisk@sedwards.com:
  On Fri, 22 Jan 2010, Zhang Shukun wrote:
  as you know, we can use MYSQL command to visit mysql database
 
  but if i use other database like Oracke,sybase,etc, Could i use MYSQL
  command ?
 
  ODBC will do what you want.

 Thanks, while i think because oracle has no offical ODBC for linux system.

I've used this driver with Oracle before with good results.  Just make sure
that you use the full Oracle libraries, not the Instant Client.  The Instant
Client has a severe resource leak that makes it inappropriate for long-running
processes.

http://home.fnal.gov/~dbox/oracle/odbc/

--
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com  www.asterisk.org

--
_
-- 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

-- 
_
-- 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 problem

2010-01-27 Thread Steve Edwards
 2010/1/27 Steve Edwards asterisk@sedwards.com:

 So don't use ODBC, use Pro*C...

On Wed, 27 Jan 2010, Zhang Shukun wrote:

 you said Personally, I'd vote for an AGI using whatever C API your DB 
 provides what do you think about phpagi and cagi, if i choose the agi 
 method. while phpagi seems used more popular than cagi.

I write my AGIs in C because that's my sharpest tool and because I'm 
old-school enough to care about shaving milliseconds. You can execute 
xxx AGIs written in C in the time it will take to load the PHP interpreter 
and parse your script. If you expect to process a lot of calls, all those 
milliseconds add up -- at least in my mind.

I wrote my own AGI library because I started before cagi was available so 
I have no experience with it.

On Wed, 27 Jan 2010, Zhang Shukun wrote:

 i cant quantify my requirement now. but the business has not be start. 
 and the user will increase as time going.

If you don't know where you are going how will you know what road to take?

If you and your peers don't know how big your database will be or how many 
queries per second how can you say MySQL is not up to the job?

-- 
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 problem

2010-01-27 Thread David Gibbons
snip
many people around think mysql is not a good option for database, they
think mysql

is only suit for small business. but i want to have a try. i need to
convince them to use this.
/snip

This statement is absolute BS. Give me some factual, backed statements by 
trained database professionals who don't work for Microsoft or Oracle (OK, Sun) 
and we can talk.

rant
I guarantee that mysql can be made at least as fast as Oracle with a relational 
database that's designed, indexed and implemented properly. The problem with 
the backend is NEARLY ALWAYS a problem with the DBA. I hate to hear crap DBAs 
blame their problems on the backend. MySQL is top-notch and production ready if 
you are logical about your DB design.
/rant

-Dave

-- 
_
-- 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 problem

2010-01-27 Thread Tilghman Lesher
On Wednesday 27 January 2010 12:55:18 David Gibbons wrote:
 snip
 many people around think mysql is not a good option for database, they
 think mysql

 is only suit for small business. but i want to have a try. i need to
 convince them to use this.
 /snip

 This statement is absolute BS. Give me some factual, backed statements by
 trained database professionals who don't work for Microsoft or Oracle (OK,
 Sun) and we can talk.

 rant
 I guarantee that mysql can be made at least as fast as Oracle with a
 relational database that's designed, indexed and implemented properly. The
 problem with the backend is NEARLY ALWAYS a problem with the DBA. I hate to
 hear crap DBAs blame their problems on the backend. MySQL is top-notch and
 production ready if you are logical about your DB design. /rant

For OLTP, I'd agree with you, and in fact, I'd go one step further.  Nothing
can touch MySQL for speed with OLTP.  However, if you're going to be doing
massive joins for reporting, you're better off using something else (or
running individual MySQL slaves, whose purpose is to run those complex queries
and doing nothing else).  In a past life, our MySQL database ran circles
around Oracle, Informix, and DB2... until someone ran a massive join on the
same server, which caused MySQL to crawl.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com  www.asterisk.org

-- 
_
-- 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 problem

2010-01-26 Thread Zhang Shukun
2010/1/23 Steve Edwards asterisk@sedwards.com:
 On Fri, 22 Jan 2010, Zhang Shukun wrote:

 as you know, we can use MYSQL command to visit mysql database

 but if i use other database like Oracke,sybase,etc, Could i use MYSQL
 command ?

 ODBC will do what you want.

Thanks, while i think because oracle has no offical ODBC for linux system.

is that better use mysql than oracle. considering the perfoermace and speed.

many people around think mysql is not a good option for database, they
think mysql

is only suit for small business. but i want to have a try. i need to
convince them to use this.


 Personally, I'd vote for an AGI using whatever C API your DB provides
 -- like Pro*C to access Oracle.

 You will have access to all of the features of your DB and your dialplan
 will be a lot cleaner and easier to maintain.

 --
 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




-- 
Best regards,
Sucan

-- 
_
-- 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 problem

2010-01-26 Thread Steve Edwards
Un-mid-posting...

 On Fri, 22 Jan 2010, Zhang Shukun wrote:

 as you know, we can use MYSQL command to visit mysql database but if i 
 use other database like Oracke,sybase,etc, Could i use MYSQL command ?

 2010/1/23 Steve Edwards asterisk@sedwards.com:

 ODBC will do what you want.

 Personally, I'd vote for an AGI using whatever C API your DB provides 
 -- like Pro*C to access Oracle.

 You will have access to all of the features of your DB and your 
 dialplan will be a lot cleaner and easier to maintain.

On Wed, 27 Jan 2010, Zhang Shukun wrote:

 Thanks, while i think because oracle has no offical ODBC for linux 
 system. is that better use mysql than oracle. considering the 
 perfoermace and speed. many people around think mysql is not a good 
 option for database, they think mysql is only suit for small business. 
 but i want to have a try. i need to convince them to use this.

So don't use ODBC, use Pro*C...

Back when Yahoo was relevant, they ran on MySQL.

Can you quantify your requirements (number of rows, queries per second, 
simultaneous connections) and test it on hardware similar to your 
production environment?

While I'm sure Yahoo spent a lot of time and money designing and tuning 
their system, sometimes explain plan can point you to small changes that 
yield significant results.

If your shop is committed to Oracle, can finance the licenses, and has the 
in-house talent -- use it. Nobody ever lost their job by buying IBM...

-- 
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


[asterisk-users] MYSQL problem

2010-01-22 Thread Zhang Shukun
hi,all

as you know, we can use MYSQL command to visit mysql database

but if i use other database like Oracke,sybase,etc, Could i use MYSQL command ?

if not, is there any other alternative could do the same
function(visit database in dailplan)?

Thanks!
-- 
Best regards,
Sucan

-- 
_
-- 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 problem

2010-01-22 Thread Tilghman Lesher
On Friday 22 January 2010 02:06:08 Zhang Shukun wrote:
 as you know, we can use MYSQL command to visit mysql database

 but if i use other database like Oracke,sybase,etc, Could i use MYSQL
 command ?

 if not, is there any other alternative could do the same
 function(visit database in dailplan)?

func_odbc will do what you want.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com  www.asterisk.org

-- 
_
-- 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 problem

2010-01-22 Thread Steve Edwards
On Fri, 22 Jan 2010, Zhang Shukun wrote:

 as you know, we can use MYSQL command to visit mysql database

 but if i use other database like Oracke,sybase,etc, Could i use MYSQL 
 command ?

ODBC will do what you want.

Personally, I'd vote for an AGI using whatever C API your DB provides 
-- like Pro*C to access Oracle.

You will have access to all of the features of your DB and your dialplan 
will be a lot cleaner and easier to maintain.

-- 
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


[asterisk-users] MYSQL problem and configuration

2007-08-24 Thread Jari-Pekka Lehtinen
Greetings everyone

I've set up a call recording system on debian 4.0 with asterisk and mysql db
for handling user information (accessible over the net for users). My
asterisk is running on one machine and the mysql on another. The connection
is over lan. Now I have a problem and a question.

My problem is:
When mysql_real_connect doesn't get connection to the mysql server asterisk
pretty much freezes and doesn't let any info go in or out, even the CLI
freezes. I've seen a bug report on this but no solution(?)
Although this might be a bug with asterisk when I have the connection set to
a hosted mysql server (company that hosts our website during the testing
period) the connection works fine so I've come to conclusion that the
problem might be the mysql and/or debian configuration I have. SO...

My question is:
How should I configure mysql (and debian box) for asterisk connections?

Best regards
Jari-Pekka Lehtinen


___
--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 problem and configuration

2007-08-24 Thread Karim H
Hello,I am new to asterisk but i have vbeen scriptinh PHP SQL and webLanguages 
for a long time.I can Give you a solution but using php 
AGI:extensions.con- AGI(connect.agi);/var/lib/asterisk/agi-bin/connect.agi 
:#!/usr/bin/php 
-q?phpset_time_limit(0);ob_implicit_flush();error_reporting(0);//Initialisation
 des entrée-sortiefunction init() {#create file handles if 
neededif(!defined('STDIN')){
define('STDIN',fopen('php://stdin','r'));}if(!defined('STDOUT')){
define('STDOUT',fopen('php://stdout','w'));}if(!defined('STDERR')){
define('STDERR',fopen('php://stderr','w'));}#retrieve all AGI variables from 
Asteriskwhile(!feof(STDIN)){$temp=trim(fgets(STDIN,4096));
if(($temp==)||($temp==\n)){break;}$s=split(:,$temp);  
  $name=str_replace(agi_,,$s[0]);$agi[$name]=trim($s[1]);}return 
$agi;}function checkresult($res){trim($res);
if(preg_match('/^200/',$res)){
if(!preg_match('/result=(-?\d+)/',$res,$matches)){
fwrite(STDERR,FAIL ($res)\n);fflush(STDERR);return0;  
  } else {fwrite(STDERR,PASS (.$matches[1].)\n);
fflush(STDERR);return $matches[1];}} else {
fwrite(STDERR,FAIL (unexpected result '$res')\n);fflush(STDERR);  
  return -1;}}$agivar = init();$hostname= '';
$database= 'x';
$username= 'x';
$password= '';
$dbprotect = mysql_pconnect($hostname, $username, $password) or 
trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $dbprotect);$result = mysql_query(SELECT * FROM 
user_table WHERE user_age12);while($entry = mysql_fetch_array($result)) 
{fwrite(STERR, Name : $entry['name'], Age: $entry['age']  
\n);fflush(STDOUT);$result = 
trim(fgets(STDIN,4096));checkresult($result);}?It will return things on the 
asterisk CLI You can adapt this example for youI don't know if it help but 
it shows a way to do...Kheraud From: [EMAIL PROTECTED] To: 
asterisk-users@lists.digium.com Date: Fri, 24 Aug 2007 12:56:55 +0300 
Subject: [asterisk-users] MYSQL problem and configuration  Greetings 
everyone  I've set up a call recording system on debian 4.0 with asterisk and 
mysql db for handling user information (accessible over the net for users). 
My asterisk is running on one machine and the mysql on another. The 
connection is over lan. Now I have a problem and a question.  My problem 
is: When mysql_real_connect doesn't get connection to the mysql server 
asterisk pretty much freezes and doesn't let any info go in or out, even the 
CLI freezes. I've seen a bug report on this but no solution(?) Although this 
might be a bug with asterisk when I have the connection set to a hosted mysql 
server (company that hosts our website during the testing period) the 
connection works fine so I've come to conclusion that the problem might be the 
mysql and/or debian configuration I have. SO...  My question is: How should 
I configure mysql (and debian box) for asterisk connections?  Best regards 
Jari-Pekka Lehtinen   ___ 
--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
_
Le blog Messenger de Michel, candidat de la Nouvelle Star : analyse, news, 
coulisses… A découvrir !
http://michel-nouvelle-star2007.spaces.live.com/___
--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