In this case i think the time required to spawn each individual process is definitively having an effect. A well coded FastAGI server with persistent database connections and a minimum number of worker threads would help for sure.<br>
<br>Donny<br><br><div class="gmail_quote">On Sun, May 9, 2010 at 8:13 PM, Deepesh D <span dir="ltr"><<a href="mailto:deep.d2010@gmail.com">deep.d2010@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am looking at handling around 20-25 calls per second. Without AGI my<br>
system is able to take upto 30-35 CPS, with AGI this falls to 13-15<br>
CPS. Even this figure was reached after I did database optimizations<br>
and combined 4 agis into one. Earlier with 4 agis per call it used to<br>
take only 5-7 CPS.<br>
<br>
I also did a test where the AGI exits without doing anything. Just the<br>
process of calling the AGI increases the CPU utilization by 25%.<br>
<br>
On Sun, May 9, 2010 at 10:58 PM, Steve Edwards<br>
<div class="im"><<a href="http://asterisk.org" target="_blank">asterisk.org</a>@<a href="http://sedwards.com" target="_blank">sedwards.com</a>> wrote:<br>
</div><div><div></div><div class="h5">>>> On Sun, 9 May 2010, Deepesh D wrote:<br>
>>><br>
>>>> Performance is the main reason for switching from AGI to module. Will<br>
>>>> a FastAGI running on the same server as asterisk give me improved<br>
>>>> performance?<br>
><br>
>> On Sun, May 9, 2010 at 9:09 PM, Steve Edwards<br>
><br>
>>> While creating a new process is typically a very "expensive" (in CPU<br>
>>> resources) process, any reasonably modern processor can create hundreds<br>
>>> of processes per second.<br>
>>><br>
>>> Before switching to FastAGI, why do you think process creation is the<br>
>>> limiting factor in your quest for improved performance?<br>
>>><br>
>>> How about some details about exactly what you are doing and what your<br>
>>> AGIs are doing?<br>
><br>
> On Sun, 9 May 2010, Deepesh D wrote:<br>
><br>
>> The AGI does some database lookups and based on the results sets some<br>
>> dialplan variables. In the dialplan the call is routed to different<br>
>> extensions based on the value of these variables. The database I use is<br>
>> postgresql. The AGI uses libpq++ (postgresql's C++ interface) to connect<br>
>> with database.<br>
><br>
> I see no benefit to implementing this as a module.<br>
><br>
> Implementing your AGI as FastAGI would eliminate process creation and<br>
> database connection overhead.<br>
><br>
> I suspect a minor improvement in database design, indexing, etc. could<br>
> yield orders of magnitude more improvement in performance than converting<br>
> from AGI to FastAGI.<br>
><br>
> How many calls per second are you handling? I have a host (Intel(R)<br>
> Xeon(TM) CPU 3.40GHz) handling 60,000 calls per day -- just under 1 call<br>
> per second.<br>
><br>
> Each call executes 4 AGIs, each accessing the database, before the caller<br>
> hears first audio. Each call may execute dozens of other AGIs through the<br>
> life of the call.<br>
><br>
> If I were to do it again, I would merge the 4 AGIs into a single AGI and<br>
> would consider FastAGI, but I have no performance problems at this CPS<br>
> level.<br>
><br>
> I'm not against FastAGI, I'm just saying it may not be the silver bullet<br>
> you are looking for.<br>
><br>
> --<br>
> Thanks in advance,<br>
> -------------------------------------------------------------------------<br>
> Steve Edwards <a href="mailto:sedwards@sedwards.com">sedwards@sedwards.com</a> Voice: +1-760-468-3867 PST<br>
> Newline Fax: +1-760-731-3000<br>
><br>
> --<br>
> _____________________________________________________________________<br>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
><br>
> asterisk-dev mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</div></div></blockquote></div><br>