[Freeswitch-users] [Freeswitch-dev] Seeking collaborators for FreeSWITCH/Lua scripting toolkit

Stanislav Sinyagin ssinyagin at gmail.com
Thu Jan 28 00:49:32 MSK 2016


well, maybe I just dislike Lua :)

but the approach that I described is not only about performance, but
also about fault tolerance, and probably also a geographically
distributed scenario. If properly designed, it could give much better
flexibility and scalability.



On Wed, Jan 27, 2016 at 7:13 PM, Chad Phillips <chad at apartmentlines.com> wrote:
> Stanislav,
>
> I'm guessing I could count on one hand the number of times any of my
> production systems have had to process 30 calls in one second, and I've been
> using FreeSWITCH since the earliest releases in a mission critical
> application for my primary telecom business.
>
> I can certainly appreciate that some FreeSWITCH users need to think at giant
> scale and about how they can squeeze every last ounce of performance out of
> their instances, I've just never had to do it. Perhaps this experience
> reflects in my library. :)
>
> Still, I'm not convinced that doing it the way I have costs a lot in
> performance. I think it would be interesting to whip up a few simple load
> testing scenarios, and run one set via dialplan only or dialplan with
> focused Lua scripts, and another set through Jester. Do you have any
> thoughts on what that set of scenarios might look like to effectively gauge
> the performance difference?
>
> Chad
>
> On Mon, Jan 25, 2016 at 4:13 PM, Stanislav Sinyagin <ssinyagin at gmail.com>
> wrote:
>>
>> Chad,
>>
>> if it's a daemon that stays in memory, it doesn't need to be written
>> in C. It just needs to handle concurrent requests efficiently. It
>> could be anything like python, perl, java... or golang which beats
>> them in performance because it's compiled into native code. But the
>> bottleneck would anyway be in I/O or database lookups, so it should
>> simply be the language which you master the best.
>>
>> The nice thing about ESL is that it allows you to build a clusterized
>> environment, with separated functional nodes and easily scalable. Then
>> you may, for example, keep FreeSWITCH on a physical CPU churning its
>> real-time tasks, and the application logic on a set of virtual
>> machines with less-demanding SLA.
>>
>> I know some guys who implement this with Node.js. I'm not sure it's
>> the right choice, but still it shows adequate performance.
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Jan 25, 2016 at 11:20 PM, Chad Phillips <chad at apartmentlines.com>
>> wrote:
>> > Stanislav,
>> >
>> > Back when I originally wrote Jester, we did some basic load testing of
>> > the
>> > Comdian Mail replica profile against Asterisk's actual Comedian Mail
>> > (which
>> > is written in C), and the Jester implementation outperformed it.
>> >
>> > I think you may be overestimating strain of loading Jester once per
>> > call.
>> > Not counting comments, the core module is less than 800 lines of code
>> > (hardly 'huge'), the other modules are all smaller than that, and they
>> > can
>> > be loaded conditionally based upon what you want to accomplish. And for
>> > those looking to squeeze more performance out, there's a supplied script
>> > to
>> > pre-compile core and all modules, which means they wouldn't have to be
>> > re-compiled every time they're loaded.
>> >
>> > I'm clear that there would be more efficient approaches than writing a
>> > Lua
>> > toolkit, and, I doubt that most of them would be as easily accessible as
>> > something written in Lua. Given that Lua is already blazing fast for a
>> > scripting language, I think it's a fair compromise.
>> >
>> > I will add that I've considered rewriting the core functionality in C
>> > for a
>> > number of reasons, performance being one of them, but at this time have
>> > neither the skill nor the time to learn the skill of writing C code at
>> > that
>> > level. Someday, maybe... :)
>> >
>> > Chad
>> >
>> > On Sun, Jan 24, 2016 at 10:54 PM, Stanislav Sinyagin
>> > <ssinyagin at gmail.com>
>> > wrote:
>> >>
>> >> Yes, for relatively small scripts that are concentrated on their jobs.
>> >> But
>> >> this thing is huge.
>> >>
>> >> On 25 Jan 2016 3:36 am, "Michael Jerris" <mike at jerris.com> wrote:
>> >>>
>> >>> Lua is likely to be by far the most efficient of any scripting
>> >>> language
>> >>> used in FreeSWITCH, if there is still really a concern about
>> >>> performance,
>> >>> more pieces can be moved to helpers built out in c code.  If you are
>> >>> looking
>> >>> for dynamic but still optimal performance, lua is likely your best bet
>> >>>
>> >>> On Sunday, January 24, 2016, Stanislav Sinyagin <ssinyagin at gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> why not re-implementing it in Golang and ESL?
>> >>>>
>> >>>> What's happening now with your system, is that FreeSWITCH loads few
>> >>>> thousand lines of Lua code on every call establishment. So, even with
>> >>>> default 30cps limit, you may overload the CPU with unnecessary job.
>> >>>>
>> >>>> if you don't like Go, it could be some other language, but I like the
>> >>>> built-in threads in it.
>> >>>>
>> >>>>
>> >>>>
>> >>>> On Sun, Jan 24, 2016 at 9:47 PM, Chad Phillips
>> >>>> <chad at apartmentlines.com>
>> >>>> wrote:
>> >>>> > Hi Bote,
>> >>>> >
>> >>>> > The difference is (supposed to be) that using Jester takes a lot of
>> >>>> > the
>> >>>> > dirty work out of doing things that you must turn to scripting for.
>> >>>> > The
>> >>>> > original design was to remove almost all scripting complexity, and
>> >>>> > instead
>> >>>> > have users use a more template-based approach to writing their
>> >>>> > advanced
>> >>>> > workflows. You can have a look at
>> >>>> >
>> >>>> >
>> >>>> > http://thehunmonkgroup.github.io/jester/doc/topics/03-Sequences.md.html#Writing_sequences
>> >>>> > to see the basic template style.
>> >>>> >
>> >>>> > And here's an example template that does some fairly advanced
>> >>>> > stuff:
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > http://thehunmonkgroup.github.io/jester/doc/examples/phone_to_post_test.lua.html
>> >>>> >
>> >>>> > To my eyes, what the template accomplishes is quite easy to deduce
>> >>>> > from
>> >>>> > simply reading it, and all of the dirty work for taking those
>> >>>> > actions
>> >>>> > is
>> >>>> > handled by Jester core and the supporting modules.
>> >>>> >
>> >>>> > The current limitation is that you must use the template structure
>> >>>> > to
>> >>>> > gain
>> >>>> > access to Jester's modules. Looking back, this was a design mistake
>> >>>> > that I
>> >>>> > intend to rectify -- it would be much more powerful and flexible to
>> >>>> > use a
>> >>>> > template when it made sense, and still be able to mix pure Lua
>> >>>> > scripting
>> >>>> > with calls to Jester's support modules when that makes more sense.
>> >>>> > And
>> >>>> > what
>> >>>> > I'm hoping to get help with is correcting that design flaw while
>> >>>> > preserving
>> >>>> > 'the good stuff' in the toolkit.
>> >>>> >
>> >>>> > Chad
>> >>>> >
>> >>>> > On Fri, Jan 22, 2016 at 2:16 PM, Bote Man <bote_radio at botecomm.com>
>> >>>> > wrote:
>> >>>> >>
>> >>>> >> Hey Chad, long time no chat J  I saw your update to the Help
>> >>>> >> section
>> >>>> >> of
>> >>>> >> the Confluence page concerning this and glanced at some things
>> >>>> >> there.
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> I guess I don’t even know enough to understand the difference
>> >>>> >> between
>> >>>> >> using your toolkit and just plain writing a Lua script. Would I,
>> >>>> >> for
>> >>>> >> example, write an abbreviated Lua script that calls tested and
>> >>>> >> proven
>> >>>> >> functions in your toolkit, sort of like a library?
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> Anyway it sounds useful, so thanks.
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> ---
>> >>>> >>
>> >>>> >> Bote
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> FreeSWITCH Docs Janitor
>> >>>> >>
>> >>>> >> http://freeswitch.org/confluence
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> From: Chad Phillips
>> >>>> >> Sent: Friday, 22 January, 2016 14:41
>> >>>> >> Subject: [Freeswitch-users] Seeking collaborators for
>> >>>> >> FreeSWITCH/Lua
>> >>>> >> scripting toolkit
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> Looking for folks in the FreeSWITCH community who would be
>> >>>> >> interested
>> >>>> >> in
>> >>>> >> collaborating on an open source scripting toolkit I've written for
>> >>>> >> FreeSWITCH/Lua. The basic idea is to have ready made solutions to
>> >>>> >> common
>> >>>> >> scripting needs, so as not to reinvent the wheel.
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> The original project was written in 2010. A lot of it still works
>> >>>> >> great,
>> >>>> >> and there are some design flaws that I'd like to work out in the
>> >>>> >> next
>> >>>> >> release.
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> Project code is here: https://github.com/thehunmonkgroup/jester
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> Some background and reasoning for the project here:
>> >>>> >>
>> >>>> >>
>> >>>> >> http://xylil.com/2016/01/20/jester-freeswitch-lua-and-my-quest-for-an-awesome-scripting-toolkit/
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> If anyone is interested in helping, please let me know!
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> Chad
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> _________________________________________________________________________
>> >>>> >> Professional FreeSWITCH Consulting Services:
>> >>>> >> consulting at freeswitch.org
>> >>>> >> http://www.freeswitchsolutions.com
>> >>>> >>
>> >>>> >> Official FreeSWITCH Sites
>> >>>> >> http://www.freeswitch.org
>> >>>> >> http://confluence.freeswitch.org
>> >>>> >> http://www.cluecon.com
>> >>>> >>
>> >>>> >> FreeSWITCH-users mailing list
>> >>>> >> FreeSWITCH-users at lists.freeswitch.org
>> >>>> >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >>>> >>
>> >>>> >>
>> >>>> >> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >>>> >> http://www.freeswitch.org
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > _________________________________________________________________________
>> >>>> > Professional FreeSWITCH Consulting Services:
>> >>>> > consulting at freeswitch.org
>> >>>> > http://www.freeswitchsolutions.com
>> >>>> >
>> >>>> > Official FreeSWITCH Sites
>> >>>> > http://www.freeswitch.org
>> >>>> > http://confluence.freeswitch.org
>> >>>> > http://www.cluecon.com
>> >>>> >
>> >>>> > FreeSWITCH-users mailing list
>> >>>> > FreeSWITCH-users at lists.freeswitch.org
>> >>>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >>>> >
>> >>>> >
>> >>>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >>>> > http://www.freeswitch.org
>> >>>>
>> >>>>
>> >>>>
>> >>>> _________________________________________________________________________
>> >>>> Professional FreeSWITCH Consulting Services:
>> >>>> consulting at freeswitch.org
>> >>>> http://www.freeswitchsolutions.com
>> >>>>
>> >>>> Official FreeSWITCH Sites
>> >>>> http://www.freeswitch.org
>> >>>> http://confluence.freeswitch.org
>> >>>> http://www.cluecon.com
>> >>>>
>> >>>> FreeSWITCH-users mailing list
>> >>>> FreeSWITCH-users at lists.freeswitch.org
>> >>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >>>>
>> >>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >>>> http://www.freeswitch.org
>> >>>
>> >>>
>> >>>
>> >>> _________________________________________________________________________
>> >>> Professional FreeSWITCH Consulting Services:
>> >>> consulting at freeswitch.org
>> >>> http://www.freeswitchsolutions.com
>> >>>
>> >>> Official FreeSWITCH Sites
>> >>> http://www.freeswitch.org
>> >>> http://confluence.freeswitch.org
>> >>> http://www.cluecon.com
>> >>>
>> >>> FreeSWITCH-users mailing list
>> >>> FreeSWITCH-users at lists.freeswitch.org
>> >>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >>>
>> >>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >>> http://www.freeswitch.org
>> >>
>> >>
>> >>
>> >> _________________________________________________________________________
>> >> Professional FreeSWITCH Consulting Services:
>> >> consulting at freeswitch.org
>> >> http://www.freeswitchsolutions.com
>> >>
>> >> Official FreeSWITCH Sites
>> >> http://www.freeswitch.org
>> >> http://confluence.freeswitch.org
>> >> http://www.cluecon.com
>> >>
>> >> FreeSWITCH-users mailing list
>> >> FreeSWITCH-users at lists.freeswitch.org
>> >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >>
>> >> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >> http://www.freeswitch.org
>> >
>> >
>> >
>> >
>> > _________________________________________________________________________
>> > Professional FreeSWITCH Consulting Services:
>> > consulting at freeswitch.org
>> > http://www.freeswitchsolutions.com
>> >
>> > Official FreeSWITCH Sites
>> > http://www.freeswitch.org
>> > http://confluence.freeswitch.org
>> > http://www.cluecon.com
>> >
>> > FreeSWITCH-users mailing list
>> > FreeSWITCH-users at lists.freeswitch.org
>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> > http://www.freeswitch.org
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list