VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
brian at freeswitch.org Guest
|
Posted: Thu May 14, 2009 12:02 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
The script has a javascript interpreter allocated sitting there eating up ram for no reason... so to scale better its wise to exit the script and do your conference.
Lua is lighter weight but still having the interpreter hang around when not needed isn't wise.
/b
On May 14, 2009, at 11:32 AM, Mike Fedyk wrote:
Quote: | Why is initiating a conference from a dial plan entry better than
directly from an internal script? Is there a page that details what
is and isn't script abuse?
On 5/5/09, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote: | You should rule out the network problems first, which sound more likely.
you can reduce the overuse of JS if you transfer the call to a regular
extension with a dynamic regex.
session.execute("transfer", "conf-xyz");
then make a regex in your xml dialplan to pick up ^conf-(.*) and execute
conference $1 |
|
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! http://www.cluecon.com |
|
Back to top |
|
|
stevecrozz at gmail.com Guest
|
Posted: Thu May 14, 2009 12:32 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
I keep hearing that lua is lighter weight / more scalable than javascript. I'd love to see some data that shows how big the difference really is. I could port all my scripts from javascript to lua, but it would require a lot of overhead (me learning lua + actually porting the scripts). I want to know how much benefit there really is to that.
--Stephen
On Thu, May 14, 2009 at 10:01 AM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
|
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Thu May 14, 2009 12:32 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
Its obvious if you look at the size of the JS VM vs the lua VM.. it would clearly scale better not needing megs and megs of ram per call vs about 160kb for lua. Lua took about 20 min to learn and about an hour to get the finer points down.
/b
On May 14, 2009, at 12:24 PM, Stephen Crosby wrote:
Quote: | I keep hearing that lua is lighter weight / more scalable than javascript. I'd love to see some data that shows how big the difference really is. I could port all my scripts from javascript to lua, but it would require a lot of overhead (me learning lua + actually porting the scripts). I want to know how much benefit there really is to that.
|
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! http://www.cluecon.com |
|
Back to top |
|
|
niall.crosby at gmail.com Guest
|
Posted: Thu May 14, 2009 12:39 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
How would using the mod_event_socket compare to lua / javascript with
regards performance and scaling? (ignoring the client side of the
socket, just the Freeswitch side). Is there any performance issues to
placing a call into conference using with callflow from the
mod_socket?
N.
2009/5/14 Brian West <brian@freeswitch.org>:
Quote: | Its obvious if you look at the size of the JS VM vs the lua VM.. it would
clearly scale better not needing megs and megs of ram per call vs about
160kb for lua. Lua took about 20 min to learn and about an hour to get the
finer points down.
/b
On May 14, 2009, at 12:24 PM, Stephen Crosby wrote:
I keep hearing that lua is lighter weight / more scalable than javascript.
I'd love to see some data that shows how big the difference really is. I
could port all my scripts from javascript to lua, but it would require a lot
of overhead (me learning lua + actually porting the scripts). I want to know
how much benefit there really is to that.
Brian West
brian@freeswitch.org
-- Meet us at ClueCon! http://www.cluecon.com
_______________________________________________
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
|
--
--
Sremium Ltd.
Reg Number: 451937
Mobile: +353 (0)87 2393174
Web: www.sremium.com
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or
privileged material. Statements and opinions expressed in this e-mail
may not represent those of Sremium. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance
upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact
the sender immediately and delete the material from any computer.
_______________________________________________
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 |
|
Back to top |
|
|
stevecrozz at gmail.com Guest
|
Posted: Thu May 14, 2009 3:43 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
I think its less obvious to a user who'd never heard of lua until recently. I think it would be very helpful if someone had a comparison and could put it on the wiki.
I spent some time poking around on the wiki before I decided to write my scripts in javascript. If I had seen any warnings on scalability/performance, especially with good data to back it up, I probably would have chosen something else.
--Stephen
On Thu, May 14, 2009 at 10:31 AM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
|
|
Back to top |
|
|
pete at privateconnect... Guest
|
Posted: Thu May 14, 2009 4:31 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
I will further confirm Brian's statement. I originally started writing scripts in JS because I was more familar with it. I ran into several problem with scalability and threading issue that prompted me to look at LUA.
LUA took less than a day to get a basic understand and an additional few hours to understand their version of objects. I had migrated all 15 of my JS scripts into functioning LUA script within 5 hours. Including re-creating the object-oriented nature of my JS source.
LUA consumes far less resources and begins execution faster than JS. The only thing I need JS for at this time is cURL-like calls, as the built-in LUA has no equivalent to the JS Socket object. Having said that, the built in LUA can take advantage of LUA libraries that are installed on the OS, and LUA socket libraries do exists, so it is just a matter of me getting the time to install them.
One more handy benefit for LUA, you can configure LUA scripts to run at switch startup to perform tasks (like a cron system) within the switch core.
-pete
|
|
Back to top |
|
|
stevecrozz at gmail.com Guest
|
Posted: Thu May 14, 2009 4:36 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
Thanks Pete,
I've been hanging out on #freeswitch and I started a conversation on this topic. User 'mercutioviz' created this wiki page mercutioviz: http://wiki.freeswitch.org/wiki/Which_scripting_language_should_I_use%3F
which should help new freeswitchers not make the mistake we made and have to rewrite everything. If you have anything to add to this, it would be appreciated I'm sure.
--Stephen
On Thu, May 14, 2009 at 2:22 PM, <pete@privateconnect.com (pete@privateconnect.com)> wrote:
Quote: |
I will further confirm Brian's statement. I originally started writing scripts in JS because I was more familar with it. I ran into several problem with scalability and threading issue that prompted me to look at LUA.
LUA took less than a day to get a basic understand and an additional few hours to understand their version of objects. I had migrated all 15 of my JS scripts into functioning LUA script within 5 hours. Including re-creating the object-oriented nature of my JS source.
LUA consumes far less resources and begins execution faster than JS. The only thing I need JS for at this time is cURL-like calls, as the built-in LUA has no equivalent to the JS Socket object. Having said that, the built in LUA can take advantage of LUA libraries that are installed on the OS, and LUA socket libraries do exists, so it is just a matter of me getting the time to install them.
One more handy benefit for LUA, you can configure LUA scripts to run at switch startup to perform tasks (like a cron system) within the switch core.Â
-pete
-------- Original Message --------
Subject: Re: [Freeswitch-users] help with mod_conference stability
From: Brian West <brian@freeswitch.org (brian@freeswitch.org)>
Date: Thu, May 14, 2009 10:31 am
To: freeswitch-users@lists.freeswitch.org (freeswitch-users@lists.freeswitch.org)
Its obvious if you look at the size of the JS VM vs the lua VM.. it would clearly scale better not needing megs and megs of ram per call vs about 160kb for lua. Â Lua took about 20 min to learn and about an hour to get the finer points down.
/b
On May 14, 2009, at 12:24 PM, Stephen Crosby wrote:
I keep hearing that lua is lighter weight / more scalable than javascript. I'd love to see some data that shows how big the difference really is. I could port all my scripts from javascript to lua, but it would require a lot of overhead (me learning lua + actually porting the scripts). I want to know how much benefit there really is to that.
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! Â http://www.cluecon.com
________________________________
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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
|
|
|
Back to top |
|
|
dave at 3c.co.uk Guest
|
Posted: Thu May 14, 2009 4:56 pm Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
On Thu, 2009-05-14 at 12:31 -0500, Brian West wrote:
Quote: | Its obvious if you look at the size of the JS VM vs the lua VM.. it
would clearly scale better not needing megs and megs of ram per call
vs about 160kb for lua.
|
Isn't this a bit of a non sequitur, given that there ought to be just
one copy of the JS interpreter in RAM which is shared across all of the
calls/threads which need to use it?
--Dave
_______________________________________________
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 |
|
Back to top |
|
|
anthony.minessale at g... Guest
|
Posted: Fri May 15, 2009 8:22 am Post subject: [Freeswitch-users] help with mod_conference stability |
|
|
Unfortunately, no scripting language we have encountered
has ever done proper threading to the point that you could even begin to do that.
Lua is one of the better ones in a threaded env only because they solved the problem by making a tiny VM that
can be easily reproduced thousands of times. You still can't share a lua vm across threads or it will crash because they
use lots of setjmp longjmp calls to travel between their virtual stack and the real one.
As a matter of fact, spidermonkey has code that tries to be threadsafe (but you have to enable it, --with-threadsafe makes me nervous =]) and it shares as much as it can already and we have debated changing it so it creates a whole
JS instance per call just because of all the garbage collection and thread safety issues we have encountered.
you have to call a whole bunch of hidden mutexes marked suspend and resume etc everywhere in the code where you
transition from executing script side code to a blocking FreeSWITCH function.
Really, the only point in my original comment was that if you want to scale up something that uses scripting the first way to save
resources is to not leave the script open while you do something you know will take a long time "playing a 2 hour file, bridging a call, joining a conference" because the script resources are allocated and doing nothing this whole time and they all share a global garbage collector. if you don't need to remain in the script just transfer the call to a static extension and close it. It's just a suggestion really.
On Thu, May 14, 2009 at 4:56 PM, David Knell <dave@3c.co.uk (dave@3c.co.uk)> wrote:
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400 |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|