Central FreeSWITCH nodes management with Mod_XML_Curl vs Mod_Lua
Hi FreeSWITCH experts, My question is as regards performance and which is the best option. I am trying to scale and manage multiple nodes of FreeSWITCH centrally from my external web server/site using Mod_XML_Curl, But someone more experience than me says otherwise that Mod_XML_Curl may not be the best option: Here is his statement below: *" The thing I don't like about mod_xml_curl is that to scale it you have to scale the web server with more listeners. If you run out of listeners your ability to answer new calls fails. If the web server crashes your ability to handle calls is gone.* * * *Instead, I use Lua which is embedded into FreeSWITCH as the XML handler. The Lua reads the info from the database and hands it off to FreeSWITCH. This approach is not dependent on a service that can fail, or that can run out of listeners. "* What do you experts think about this comment above? Wouldn't Lua reading directly from database still face some of the issues i may be running from using mod_xml_curl, like database crashing, slow reading from database? Unlike using mod_xml_curl whereby i can optimise my code to make use of memcached or radis to reduce some calls to database, can i still do such with mod_lua? So what do experts think, should i go with Mod_Lua approach just as he said above or should i continue with using Mod_XML_Curl? You opinion will be appreciated. Regards Eugene
I dont understand what they meant by 'listeners' AFAIK if the web server process is running it will always return the XML
On Tue, Jul 17, 2012 at 12:30 PM, Vik Killa <vipkilla@gmail.com> wrote:
I dont understand what they meant by 'listeners' AFAIK if the web server process is running it will always return the XML
Last time I checked, there were one or two websites out there that could handle thousands of requests per second. The web has given birth to tools that allow for many, many concurrent requests. The LAMP stack on a beefy machine can do quite a lot of traffic. Furthermore, MySQL/Postgres/et al all have backup/redundancy/HA options built in, as does Apache/HTTP. It seems to me that you could scale farther and have more redundancy using these time-tested tools. Just my $0.02. -MC P.S. - Don't get me wrong - I really like Lua. I just don't know if it's really a "better" solution to this problem.
Comments inline: On Tue, Jul 17, 2012 at 10:33 AM, Eugene Azuka <eugeneazuka@gmail.com> wrote:
" The thing I don't like about mod_xml_curl is that to scale it you have to scale the web server with more listeners. If you run out of listeners your ability to answer new calls fails. If the web server crashes your ability to handle calls is gone.
Scaling web servers is an easy, well known and a common problem to solve. Yes, you have to make sure you have the resources, but this it true of any technology out there.
Instead, I use Lua which is embedded into FreeSWITCH as the XML handler. The Lua reads the info from the database and hands it off to FreeSWITCH. This approach is not dependent on a service that can fail, or that can run out of listeners. "
This is a great approach, but I don't think the logic is sound. Lua (if it's doing anything fancy) will run out of resources that it depends on -- memory, database connections, sockets etc. If one accepts that they'll have to build out to *really* scale something, they'll also come to appreciate the fact that they can move the HTTP stack to another box when needed (or 50 other boxen if required). The Lua (or any other embedded language) is pretty well tied to that same box. In the end, it probably doesn't matter. If you end up scaling to the ends of the Earth, you'll have to rewrite it anyway. Just give thanks that you've found FreeSWITCH and it was flexible enough to give you the amazing configurability needed to build it in anyway you like :)
What do you experts think about this comment above?
There are experts on this list now?! Awesome ;)
Wouldn't Lua reading directly from database still face some of the issues i may be running from using mod_xml_curl, like database crashing, slow reading from database?
Yep, see above.
Unlike using mod_xml_curl whereby i can optimise my code to make use of memcached or radis to reduce some calls to database, can i still do such with mod_lua?
If you want and Lua supports it.
So what do experts think, should i go with Mod_Lua approach just as he said above or should i continue with using Mod_XML_Curl?
Your choice! Happy hacking! Best, Gabe
In my testing from a few months ago mod_xml_curl provided the best performance with FreeSWITCH (in terms of CPS). Additionally, as others have noted, scaling HTTP is a well known problem. There are very few cases where mod_xml_curl and your preferred web technology would not be the ideal solution. On Tue, Jul 17, 2012 at 12:33 PM, Eugene Azuka <eugeneazuka@gmail.com> wrote:
Hi FreeSWITCH experts,
My question is as regards performance and which is the best option.
I am trying to scale and manage multiple nodes of FreeSWITCH centrally from my external web server/site using Mod_XML_Curl, But someone more experience than me says otherwise that Mod_XML_Curl may not be the best option: Here is his statement below:
" The thing I don't like about mod_xml_curl is that to scale it you have to scale the web server with more listeners. If you run out of listeners your ability to answer new calls fails. If the web server crashes your ability to handle calls is gone.
Instead, I use Lua which is embedded into FreeSWITCH as the XML handler. The Lua reads the info from the database and hands it off to FreeSWITCH. This approach is not dependent on a service that can fail, or that can run out of listeners. "
What do you experts think about this comment above?
Wouldn't Lua reading directly from database still face some of the issues i may be running from using mod_xml_curl, like database crashing, slow reading from database?
Unlike using mod_xml_curl whereby i can optimise my code to make use of memcached or radis to reduce some calls to database, can i still do such with mod_lua?
So what do experts think, should i go with Mod_Lua approach just as he said above or should i continue with using Mod_XML_Curl?
You opinion will be appreciated.
Regards
Eugene
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Kristian Kielhofner
participants (5)
-
Eugene Azuka
-
Gabriel Gunderson
-
Kristian Kielhofner
-
Michael Collins
-
Vik Killa