<br><br><div class="gmail_quote">On Mon, Aug 15, 2011 at 6:30 PM, Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You must have something setup strangely cos it would definitely reduce<br>
your overall cps to use ESL but not down to 2 CPS.<br>
<br>
Did you look over the server stats like top etc and look for any<br>
misconfiguration?<br>
<div><div></div><div><br></div></div></blockquote><div>Hello Anthony, thanks for your response....<br><br>yay, i found the cause .... testserver and FS were running on the same server. The server had just 1GB of RAM and of course ... by forking testserver (on 8 CPS) took all the remaining RAM ending to write into swap ... this triggered a domino effect on the entire server becoming less and less responsive as testserver started to run from swap!!!... yay .. really bad... didn't see it happen until i started nmon ... top/htop didn't make it in time to show this issue..<br>
<br>anyhow, i moved testserver to another machine reaching 35 CPS ... really nice indeed.<br><br><br>now, having a referent point (testserver) im trying to reach that 35 CPS with a java application.<br><br>yes, i notices few issues :=)<br>
<br>please check: <a href="http://pastebin.freeswitch.org/17052">http://pastebin.freeswitch.org/17052</a><br><br><br>------------------------------------snipp-----------------------------------<br><br>Control: full<br><br>
<br>// here i subscribe to all events ... well not good idea but its a start <br>events plain all<br><br>Content-Type: command/reply<br>Reply-Text: +OK event listener enabled plain<br><br>//and here i do a filter per uuid <br>
filter Unique-ID f7a7b97b-df96-41f3-a6a3-fdf24350a45c<br><br>Content-Type: command/reply<br>Reply-Text: +OK filter added. [Unique-ID]=[f7a7b97b-df96-41f3-a6a3-fdf24350a45c]<br><br>linger<br><br>Content-Type: command/reply<br>
Reply-Text: +OK will linger<br><br><br>// here i send answer in sync mode ( i could change it into async)<br>sendmsg<br>call-command: execute<br>execute-app-name: answer<br>event-lock: true<br><br>Content-Type: command/reply<br>
Reply-Text: +OK<br><br>Content-Length: 1805<br>Content-Type: text/event-plain<br><br><br>--------------------------------------------------------------------------------<br>
<br><br><br><br>so my questions:<br><br>if i use <action application="socket" data="<a href="http://192.168.254.99:8084">192.168.254.99:8084</a> async full"/> and if i subscribe to "myevents" i don't need to set a filter on uuid and i could gain performance.<br>
if i use <action application="socket" data="<a href="http://192.168.254.99:8084">192.168.254.99:8084</a> async"/> i will be getting events for the call in question only... so no special filters needed and i could limit the number of events im subscribing<br>
<br><br>what is a better approach in a matter of performance ?<br>What do i loose/gain by using async full vs async mode ?<br><br><br><br>Thanks for your answer,<br>Tihomir.<br><br><br><br><br><br><br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div><div>
<br>
On Thu, Aug 11, 2011 at 6:56 PM, Tihomir Culjaga <<a href="mailto:tculjaga@gmail.com" target="_blank">tculjaga@gmail.com</a>> wrote:<br>
> is there any other method than esl to controll calls on FS from an eternal<br>
> application?<br>
> will mod_curl or mod_xml_curl get better performance?<br>
><br>
> T.<br>
><br>
> On Fri, Aug 12, 2011 at 1:33 AM, Tihomir Culjaga <<a href="mailto:tculjaga@gmail.com" target="_blank">tculjaga@gmail.com</a>> wrote:<br>
>><br>
>> Hi Anthony, thanks for your response ...<br>
>><br>
>><br>
>> this is what i have:<br>
>><br>
>> esl_filter(&handle, "unique-id",<br>
>> esl_event_get_header(handle.info_event, "caller-unique-id"));<br>
>> esl_events(&handle, ESL_EVENT_TYPE_PLAIN, "CHANNEL_DATA<br>
>> CHANNEL_EXECUTE_COMPLETE CHANNEL_HANGUP");<br>
>><br>
>> what do you suggest i put there ?<br>
>><br>
>><br>
>> is the inbound method less costly ?<br>
>><br>
>><br>
>><br>
>><br>
>> I modified testserver.c just a bit...<br>
>><br>
>> #include <sys/types.h> /* include this before any other sys headers */<br>
>> #include <sys/wait.h> /* header for waitpid() and various macros */<br>
>> #include <signal.h> /* header for signal functions */<br>
>> #include <stdio.h> /* header for fprintf() */<br>
>> #include <unistd.h> /* header for fork() */<br>
>> #include <stdlib.h><br>
>> #include <esl.h><br>
>><br>
>> void sig_chld(int); /* prototype for our SIGCHLD handler */<br>
>><br>
>> static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock,<br>
>> struct sockaddr_in *addr)<br>
>> {<br>
>> esl_handle_t handle = {{0}};<br>
>> int done = 0;<br>
>> esl_status_t status;<br>
>> time_t exp = 0;<br>
>><br>
>> if (fork() != 0) {<br>
>> close(client_sock);<br>
>> return;<br>
>> }<br>
>><br>
>> esl_attach_handle(&handle, client_sock, addr);<br>
>><br>
>> esl_log(ESL_LOG_INFO, "Connected! %d\n", handle.sock);<br>
>><br>
>> esl_filter(&handle, "unique-id",<br>
>> esl_event_get_header(handle.info_event, "caller-unique-id"));<br>
>> esl_events(&handle, ESL_EVENT_TYPE_PLAIN, "CHANNEL_DATA<br>
>> CHANNEL_EXECUTE_COMPLETE CHANNEL_HANGUP");<br>
>><br>
>> esl_send_recv(&handle, "linger");<br>
>><br>
>> esl_execute(&handle, "answer", NULL, NULL);<br>
>> //esl_execute(&handle, "conference", "3000@default", NULL);<br>
>> esl_execute(&handle, "playback", "/home/tculjaga/myWavFile.wav",<br>
>> NULL);<br>
>> //esl_execute(&handle, "sleep", "1000", NULL);<br>
>> //esl_execute(&handle, "hangup", NULL, NULL);<br>
>><br>
>> while((status = esl_recv_timed(&handle, 1000)) != ESL_FAIL) {<br>
>> if (done) {<br>
>> if (time(NULL) >= exp) {<br>
>> break;<br>
>> }<br>
>> } else if (status == ESL_SUCCESS) {<br>
>> const char *type =<br>
>> esl_event_get_header(handle.last_event, "content-type");<br>
>> if (type && !strcasecmp(type,<br>
>> "text/disconnect-notice")) {<br>
>> const char *dispo =<br>
>> esl_event_get_header(handle.last_event, "content-disposition");<br>
>> esl_log(ESL_LOG_INFO, "Got a disconnection<br>
>> notice dispostion: [%s]\n", dispo ? dispo : "");<br>
>> if (!strcmp(dispo, "linger")) {<br>
>> done = 1;<br>
>> esl_log(ESL_LOG_INFO, "Waiting 5<br>
>> seconds for any remaining events.\n");<br>
>> exp = time(NULL) + 5;<br>
>> }<br>
>> }<br>
>> }<br>
>> }<br>
>><br>
>> esl_log(ESL_LOG_INFO, "Disconnected! %d\n", handle.sock);<br>
>> esl_disconnect(&handle);<br>
>><br>
>> close(client_sock);<br>
>><br>
>> _exit(0);<br>
>> }<br>
>><br>
>> /*<br>
>> * The signal handler function -- only gets called when a SIGCHLD<br>
>> * is received, ie when a child terminates<br>
>> */<br>
>> void sig_chld(int signo)<br>
>> {<br>
>> int status;<br>
>><br>
>> /* Wait for any child without blocking */<br>
>> if (waitpid(-1, &status, WNOHANG) < 0)<br>
>> {<br>
>> /*<br>
>> * calling standard I/O functions like fprintf() in a<br>
>> * signal handler is not recommended, but probably OK<br>
>> * in toy programs like this one.<br>
>> */<br>
>> fprintf(stderr, "waitpid failed\n");<br>
>> return;<br>
>> }<br>
>> }<br>
>><br>
>> int main(void)<br>
>> {<br>
>> struct sigaction act;<br>
>><br>
>> /* Assign sig_chld as our SIGCHLD handler */<br>
>> act.sa_handler = sig_chld;<br>
>><br>
>> /* We don't want to block any other signals in this example */<br>
>> sigemptyset(&act.sa_mask);<br>
>><br>
>> /*<br>
>> * We're only interested in children that have terminated, not<br>
>> ones<br>
>> * which have been stopped (eg user pressing control-Z at<br>
>> terminal)<br>
>> */<br>
>> act.sa_flags = SA_NOCLDSTOP;<br>
>><br>
>> /*<br>
>> * Make these values effective. If we were writing a real<br>
>> * application, we would probably save the old value instead of<br>
>> * passing NULL.<br>
>> */<br>
>> /* if (sigaction(SIGCHLD, &act, NULL) < 0)<br>
>> {<br>
>> fprintf(stderr, "sigaction failed\n");<br>
>> return 1;<br>
>> }<br>
>> */<br>
>> signal(SIGCHLD, SIG_IGN);<br>
>><br>
>> esl_global_set_default_logger(0);<br>
>> esl_listen("localhost", 8088, mycallback);<br>
>><br>
>> return 0;<br>
>> }<br>
>><br>
>><br>
>><br>
>><br>
>> On Thu, Aug 11, 2011 at 9:59 PM, Anthony Minessale<br>
>> <<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>> wrote:<br>
>>><br>
>>> try removing the filter and event subscriptions<br>
>>> it's costly to consume all of the events especially at 75cps.<br>
>>><br>
>>><br>
>>> On Thu, Aug 11, 2011 at 5:23 AM, Tihomir Culjaga <<a href="mailto:tculjaga@gmail.com" target="_blank">tculjaga@gmail.com</a>><br>
>>> wrote:<br>
>>> > hello,<br>
>>> ><br>
>>> > im wondering how much performance do we loose when using ESL instead of<br>
>>> > running it via dialplan?<br>
>>> ><br>
>>> ><br>
>>> > without ESL with a fine tuned FS and a short dialplan ( answer,<br>
>>> > playback<br>
>>> > like 20 seconds file, hangup ) im able to service 75 CPS. On the same<br>
>>> > FS,<br>
>>> > when i use ESL to answer the call, playback the same file and hangup,<br>
>>> > im not<br>
>>> > able to run more than 2 CPS... this is a huge impact and i really can't<br>
>>> > believe it.<br>
>>> ><br>
>>> > I'm using event-socket outbound e.g.:<br>
>>> ><br>
>>> > <action application="socket" data="<a href="http://127.0.0.1:8088" target="_blank">127.0.0.1:8088</a> async full"/><br>
>>> ><br>
>>> > my extension looks like:<br>
>>> ><br>
>>> > <extension name="ESL_C"><br>
>>> > <condition field="destination_number" expression="^(6666)$"><br>
>>> > <action application="socket" data="<a href="http://127.0.0.1:8088" target="_blank">127.0.0.1:8088</a> async full"/><br>
>>> > <action application="sleep" data="1000"/><br>
>>> > <action application="hangup"/><br>
>>> > </condition><br>
>>> > </extension><br>
>>> ><br>
>>> ><br>
>>> > im using testserver from lib/esl/ and i just removed the conference<br>
>>> > command<br>
>>> > and added the playback one.... also i moved the esl_debug lvl to 0<br>
>>> ><br>
>>> ><br>
>>> > anyhow, FS cannot run more than 2 CPS compared to 75 CPS when the<br>
>>> > playback<br>
>>> > is done from the dialplan.<br>
>>> ><br>
>>> ><br>
>>> > Please, can someone give me a clue on what is going on?<br>
>>> > Maybe im doing something wrong?<br>
>>> > how to get maximum FS performance using ESL ?<br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > Regards,<br>
>>> > Tihomir.<br>
>>> ><br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > Join us at ClueCon 2011, Aug 9-11, Chicago<br>
>>> > <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
>>> ><br>
>>> > FreeSWITCH-users mailing list<br>
>>> > <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>> > <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>> ><br>
>>> > UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>> > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>>> ><br>
>>> ><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Anthony Minessale II<br>
>>><br>
>>> FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
>>> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
>>> Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
>>><br>
>>> AIM: anthm<br>
>>> <a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
>>> GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
>>> IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
>>><br>
>>> FreeSWITCH Developer Conference<br>
>>> <a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
>>> <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
>>> pstn:<a href="tel:%2B19193869900" value="+19193869900" target="_blank">+19193869900</a><br>
>>><br>
>>> _______________________________________________<br>
>>> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
>>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
>>><br>
>>> FreeSWITCH-users mailing list<br>
>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
><br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Anthony Minessale II<br>
<br>
FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
<br>
AIM: anthm<br>
<a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
<br>
FreeSWITCH Developer Conference<br>
<a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:<a href="tel:%2B19193869900" value="+19193869900" target="_blank">+19193869900</a><br>
<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br>