[Asterisk-Users] Question about AGI vs. FastAGI vs. straight C/DB development

Mohit Muthanna mohit.muthanna at gmail.com
Tue Mar 8 18:31:12 MST 2005


> Opinions? Would any of you bother writing an IVR-only
> application (like the app_voicemail application) in C?
> Why or why not?

I would strongly advise against using C _unless absolutely necessary_.
While it is true that you will see performance gains by using C
(linked in that is), the tradeoff from using a scripting language
(like Perl or Python) is quite significant.

What tradeoff? Maintenability, development effort / ease, portability, security.

Of course, it can be argued that all of the above can be overcome by a
good C programmer. But that takes a good, experienced C programmer;
and even so, you may be better off using a scripting language. C
definitely has it's place, but this, IMHO, is not the right one.
Also... debugging memory leaks, maintaining build files / makefiles,
etc. is just not fun.

If performance is your primary concern, I would suggest using FastAGI.
An added benefit to FastAGI is the ability to easily write load
balanced and fault tolerant apps. This makes your applications easier
to scale up as the need arises.

The problem with just AGI (not FastAGI), which really is more relevant
to systems with lots of short concurrent calls, is that the OS has to
fork a new process for every call. For some applications, this can
have a significant performance impact.

If your FastAGI app is implemented correctly, e.g., by passing
connections to new threads, or using a poll()/select() style loop, you
can see considerable speed improvements.

Anyhow... my point is... don't use C unless you have a good reason. Go
for Perl / Python w/ FastAGI.

My $0.02.

HTH,
Mohit.



-- 
Mohit Muthanna [mohit (at) muthanna (uhuh) com]
"There are 10 types of people. Those who understand binary, and those
who don't."



More information about the asterisk-users mailing list