[Asterisk-Users] Nested MySQL Commands

John Daragon john at argv.co.uk
Wed Jan 11 14:56:29 MST 2006


Douglas Garstang wrote:

 > jd.... but..... but.... Asterisk still fires up a process each

 > time you make an AGI call in the dialplan. You could still have
 > 120 of these lightweight processes running, in _addition_ to the
 > other process. Doesn't sound like it provides much benefit.

True. But Linux is *good* at processes. The code is likely to be in
RAM (provided you use a compiled language),  And most databases are
*bad* (relatively) at new connections, and at large numbers of
connections.

By keeping connection numbers low, keeping them open, and keeping the
number of actual database calls to the minimum I'd be pretty confident
of a scalable solution. Remember that these processes will spend most
of their lives sleeping. Sure, there'll be more linked-list traversal 
&c, but that's what an OS is for.

I'm going to be building just such a beast over the next couple of
weeks (for a similar sort of application), perhaps I'll do some
performance estimation up front and post it.

jd

 >
 > -----Original Message-----
 > From: John Daragon [mailto:john at argv.co.uk]
 > Sent: Wednesday, January 11, 2006 2:14 PM
 > To: Asterisk Users Mailing List - Non-Commercial Discussion
 > Subject: Re: [Asterisk-Users] Nested MySQL Commands
 >
 >
 > Douglas Garstang wrote:
 >
 >> Peter, I assume you mean something like this in extensions.conf:
 >>
 >> exten => _X.,1,AGI(master-dial-logic.pl)
 >>
 >> and then there's only one call. All logic would be performed by
 >
 >
 >  > the perl script. This has many advantages. One disadvantage however
 >  > is that potentially, there could be 120 simultaneous instances of
 >  > this script running (one per call).
 >
 > Yes, but if you need it to scale efficiently, each of these could
 > be a very lightweight process. If you used each of these to communicate
 > via RPC or shared memory to a process with a small and configurable pool
 > of database connections (which isn't that difficult), you can build a
 > simple and scalable solution.
 >
 > jd
 >



-- 

John Daragon                                          john at argv.co.uk
argv[0] limited               (Asterisk implementation & consultancy)
Lambs Lawn Cottage,  Staple Fitzpaine,  Taunton,  TA3 5SL,  UK
v +44 (0) 1460 234068   f +44 (0) 1460 234069   m +44 (0) 7836 576127





More information about the asterisk-users mailing list