RE: [Asterisk-Users] Re: Nested MySQL Commands
Do you have a link to where it says this? The DBI docs that I looked at (perldoc dbi) said that it isn't thread-safe. -Original Message- From: Leo Ann Boon [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 12:50 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Douglas Garstang wrote: I also don't believe perl DBI is thread safe The lastest docs says that DBI does support multithread connection pooling. Otherwise, you are always free to implement your AGI in 'modern' :) programming languages like Java or C# that support threads and pooling. -Original Message- From: Douglas Garstang Sent: Wed 1/11/2006 9:08 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: RE: [Asterisk-Users] Re: Nested MySQL Commands Since about 1992... and the Asterisk docs for FastAGI are pretty rotten. But that's ok, I've come to expect that. -Original Message- From: Kevin P. Fleming [mailto:[EMAIL PROTECTED] Sent: Wed 1/11/2006 8:11 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Douglas Garstang wrote: I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. How long have you been around Unix/Linux systems? Do you have any clue how much less expensive it is to open a TCP socket as compared to forking the Asterisk process, exec()-ing another program, having that program open database/web connections, etc.? ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
Connection pooling doesn't require threading. You can also use a pool of processes which are quite cheap on Linux. Douglas Garstang wrote: Do you have a link to where it says this? The DBI docs that I looked at (perldoc dbi) said that it isn't thread-safe. -Original Message- From: Leo Ann Boon [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 12:50 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Douglas Garstang wrote: I also don't believe perl DBI is thread safe The lastest docs says that DBI does support multithread connection pooling. Otherwise, you are always free to implement your AGI in 'modern' :) programming languages like Java or C# that support threads and pooling. -Original Message- From: Douglas Garstang Sent: Wed 1/11/2006 9:08 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: RE: [Asterisk-Users] Re: Nested MySQL Commands Since about 1992... and the Asterisk docs for FastAGI are pretty rotten. But that's ok, I've come to expect that. -Original Message- From: Kevin P. Fleming [mailto:[EMAIL PROTECTED] Sent: Wed 1/11/2006 8:11 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Douglas Garstang wrote: I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. How long have you been around Unix/Linux systems? Do you have any clue how much less expensive it is to open a TCP socket as compared to forking the Asterisk process, exec()-ing another program, having that program open database/web connections, etc.? ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
Tony Mountifield wrote: In article [EMAIL PROTECTED], Douglas Garstang [EMAIL PROTECTED] wrote: Peter, Too slow! We're going to potentially be doing several MySQL lookups for routing even the most basic of calls, and if every one of those queries has to make a call out to an AGI script, it would become a performance problem. AGI is only slow if you're calling it repeatedly and implementing it in a scripting language that needs a big interpreter. I have had great success writing AGIs in C and interfacing to MySQL from within them. They end up nice and small and fast. A single AGI invocation does all the database transactions necessary to decide on the disposition of the call, and then jumps to the appropriate extension and priority in the dialplan. And if you like writing your AGIs in interpreted languages, there is always FastAGI. ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
RE: [Asterisk-Users] Re: Nested MySQL Commands
I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. -Original Message- From: Mike Fedyk [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 11, 2006 4:32 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Tony Mountifield wrote: In article [EMAIL PROTECTED], Douglas Garstang [EMAIL PROTECTED] wrote: Peter, Too slow! We're going to potentially be doing several MySQL lookups for routing even the most basic of calls, and if every one of those queries has to make a call out to an AGI script, it would become a performance problem. AGI is only slow if you're calling it repeatedly and implementing it in a scripting language that needs a big interpreter. I have had great success writing AGIs in C and interfacing to MySQL from within them. They end up nice and small and fast. A single AGI invocation does all the database transactions necessary to decide on the disposition of the call, and then jumps to the appropriate extension and priority in the dialplan. And if you like writing your AGIs in interpreted languages, there is always FastAGI. ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
Yes, but the AGI process doesn't die, it stays running. If it stops for some reason, asterisk will start it again. http://www.voip-info.org/wiki-Asterisk+FastAGI http://www.sineapps.com/news.php?rssid=142 Douglas Garstang wrote: I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. -Original Message- From: Mike Fedyk [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 11, 2006 4:32 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Tony Mountifield wrote: In article [EMAIL PROTECTED], Douglas Garstang [EMAIL PROTECTED] wrote: Peter, Too slow! We're going to potentially be doing several MySQL lookups for routing even the most basic of calls, and if every one of those queries has to make a call out to an AGI script, it would become a performance problem. AGI is only slow if you're calling it repeatedly and implementing it in a scripting language that needs a big interpreter. I have had great success writing AGIs in C and interfacing to MySQL from within them. They end up nice and small and fast. A single AGI invocation does all the database transactions necessary to decide on the disposition of the call, and then jumps to the appropriate extension and priority in the dialplan. And if you like writing your AGIs in interpreted languages, there is always FastAGI. ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
Douglas Garstang wrote: I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. How long have you been around Unix/Linux systems? Do you have any clue how much less expensive it is to open a TCP socket as compared to forking the Asterisk process, exec()-ing another program, having that program open database/web connections, etc.? ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. Which is exactly what would solve your supposed problem with AGI scripts, there is no overhead with starting up the interpreter so you can just write a Perl daemon with a well designed connection pool to your DB. I think you are underestimating AGI's power, your application is far less demanding than AGI's we run in Python with no issues, Python takes much longer to initialize than Perl. If you are having performance issues it's probably not the technology but how you are implementing it Also the programming model of Asterisk modules is pretty simple, I've never used the Perl module but that could be an option as well if it works, I know the first year it came out alot of people I know complained about it crashing all the time but that was a while ago. ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
RE: [Asterisk-Users] Re: Nested MySQL Commands
Since about 1992... and the Asterisk docs for FastAGI are pretty rotten. But that's ok, I've come to expect that. -Original Message- From: Kevin P. Fleming [mailto:[EMAIL PROTECTED] Sent: Wed 1/11/2006 8:11 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Douglas Garstang wrote: I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. How long have you been around Unix/Linux systems? Do you have any clue how much less expensive it is to open a TCP socket as compared to forking the Asterisk process, exec()-ing another program, having that program open database/web connections, etc.? ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users winmail.dat___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
RE: [Asterisk-Users] Re: Nested MySQL Commands
I also don't believe perl DBI is thread safe -Original Message- From: Douglas Garstang Sent: Wed 1/11/2006 9:08 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: RE: [Asterisk-Users] Re: Nested MySQL Commands Since about 1992... and the Asterisk docs for FastAGI are pretty rotten. But that's ok, I've come to expect that. -Original Message- From: Kevin P. Fleming [mailto:[EMAIL PROTECTED] Sent: Wed 1/11/2006 8:11 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Douglas Garstang wrote: I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. How long have you been around Unix/Linux systems? Do you have any clue how much less expensive it is to open a TCP socket as compared to forking the Asterisk process, exec()-ing another program, having that program open database/web connections, etc.? ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
Douglas Garstang wrote: Since about 1992... and the Asterisk docs for FastAGI are pretty rotten. But that's ok, I've come to expect that. And what does that have to do with your question? Is it just more whining? Your question clearly demonstrated that you understood the difference between AGI and FastAGI being execution of a program (binary or otherwise) vs. opening a TCP socket. You then claimed that you didn't see how there could be any noticeable performance difference between the two. This has absolutely nothing to do with Asterisk docs (or Asterisk at all for that matter), it's basic Unix/Linux knowledge. How about this: write yourself a bash script that runs some simple program (that outputs a line of text) via normal execution 1,000,000 times, and compare it to a version that opens a TCP socket and receives the same line of text from an existing script listening on that socket. You'll probably be shocked at the difference, and that doesn't even take into account database connections or any other 'expensive' operations. ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
Since about 1992... and the Asterisk docs for FastAGI are pretty rotten. But that's ok, I've come to expect that. Thats a silly comment, there is ample explanation for what the purpose of fastagi is and examples all over the net. What did you exactly think the socket was opened for? Haven't you heard of fastcgi after 14 years of Linux? So either you are clueless about any sort of net/web/admin development with perl or you drank alot of caugh syroup half way through this thread. Shidan ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Re: Nested MySQL Commands
Douglas Garstang wrote: I also don't believe perl DBI is thread safe The lastest docs says that DBI does support multithread connection pooling. Otherwise, you are always free to implement your AGI in 'modern' :) programming languages like Java or C# that support threads and pooling. -Original Message- From: Douglas Garstang Sent: Wed 1/11/2006 9:08 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: RE: [Asterisk-Users] Re: Nested MySQL Commands Since about 1992... and the Asterisk docs for FastAGI are pretty rotten. But that's ok, I've come to expect that. -Original Message- From: Kevin P. Fleming [mailto:[EMAIL PROTECTED] Sent: Wed 1/11/2006 8:11 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Cc: Subject: Re: [Asterisk-Users] Re: Nested MySQL Commands Douglas Garstang wrote: I don't get the whole concept of FastAGI. It's nothing special. Asterisk just opens a connection to a TCP port instead of executing a binary. How long have you been around Unix/Linux systems? Do you have any clue how much less expensive it is to open a TCP socket as compared to forking the Asterisk process, exec()-ing another program, having that program open database/web connections, etc.? ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users