Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Alternative to directory lookup using mod


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
ctalle at voiceway.ca
Guest





PostPosted: Wed Sep 17, 2008 5:53 pm    Post subject: [Freeswitch-users] Alternative to directory lookup using mod Reply with quote

Oh, they are but it's still HDD... I wouldn't like to see the server die
because of too much disk IO
I'm trying to figure out what's the most efficient way to handle changes
in user profiles (and possibly dialplan, etc...) if order handle
thousands of users per server.

Cristian

Brian West wrote:
Quote:
Are those temp files not going away?

/b

On Sep 17, 2008, at 5:43 PM, Cristian Talle wrote:


Quote:
Just wondering...

I noticed that with xml_curl temp files are being created for each
request - this doesn't really help for higher request volumes.
Do you know of any way of updating the FS xml tree (let's say the
directory node for one domain) without curl?

Cristian



_______________________________________________
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




_______________________________________________
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
brian at freeswitch.org
Guest





PostPosted: Wed Sep 17, 2008 5:56 pm    Post subject: [Freeswitch-users] Alternative to directory lookup using mod Reply with quote

If you're that concerned with it.. move the tmp to a ramdisk Wink I
thought modern hard drives could take a lickin and keep on tickin

/b

On Sep 17, 2008, at 5:51 PM, Cristian Talle wrote:

Quote:
Oh, they are but it's still HDD... I wouldn't like to see the server
die
because of too much disk IO
I'm trying to figure out what's the most efficient way to handle
changes
in user profiles (and possibly dialplan, etc...) if order handle
thousands of users per server.

Cristian


_______________________________________________
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
ctalle at voiceway.ca
Guest





PostPosted: Wed Sep 17, 2008 10:17 pm    Post subject: [Freeswitch-users] Alternative to directory lookup using mod Reply with quote

I give up Smile You're right.
I've just started using FS and after reading so many stories about how
other products are not performing under stress I'm trying to think of
what else can slow things down... In any case, so far I'm impressed
with it!


Anthony Minessale wrote:
Quote:
if you say inhale the xml into memory and the sever goes haywire and
sends you 2 gigs out output you are in for a treat.
if you can get enough call volume on one box where the disk i/o of
xml_curl even shows up on the map in relation to all the rtp etc,
we've won.


On Wed, Sep 17, 2008 at 6:00 PM, Cristian Talle <ctalle@voiceway.ca
<mailto:ctalle@voiceway.ca>> wrote:

less tickin keeps you breathin Smile It'd be nice though if you could
just
use xml_rpc to tell FS:

/xml_update <section> <tag> <tag_attr_name> <tag_attr_val>...,/

similar to xml_locate

Cristian

Brian West wrote:
Quote:
If you're that concerned with it.. move the tmp to a ramdisk Wink I
thought modern hard drives could take a lickin and keep on tickin

/b

On Sep 17, 2008, at 5:51 PM, Cristian Talle wrote:


Quote:
Oh, they are but it's still HDD... I wouldn't like to see the
server
Quote:
Quote:
die
because of too much disk IO
I'm trying to figure out what's the most efficient way to handle
changes
in user profiles (and possibly dialplan, etc...) if order handle
thousands of users per server.

Cristian



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
<mailto:Freeswitch-users@lists.freeswitch.org>
Quote:
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users

UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote:
http://www.freeswitch.org




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
<mailto: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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------

_______________________________________________
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



_______________________________________________
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
ctalle at voiceway.ca
Guest





PostPosted: Thu Sep 18, 2008 5:52 pm    Post subject: [Freeswitch-users] Alternative to directory lookup using mod Reply with quote

I gave it a try though... and it works nicely (at least for directory entries for now). I've added 3 more commands to xml_curl: cache_on, cache_off and cache_delete_key.

- cache_on - enables caching: it will store in a switch_hash_t structure all xml strings returned by curl, using <username>@<realm> as a key (since we're talking directory only in this example). The same key is looked up every time the xml is requested for that user/realm and the code returns an xml structure created using switch_parse_xml_from_str().

- cache_off - switches back to the original behavior and clears the hash.

- cache_delete_key <key> - will invalidate the cache entry so that next time it is reloaded by curl.

considering a 500 bytes - 1K string for each profile, you can cache 10000 user profiles in ~10M (considering we're storing the char* s)
please see a sample console output,with a terminal registering every 25 seconds

============================================================================
freeswitch@localhost.localdomain (freeswitch@localhost.localdomain)> 2008-09-18 18:26:19 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML response is in /tmp/d0c586a8-85d0-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain (freeswitch@localhost.localdomain)> xml_curl cache_on
API CALL [xml_curl(cache_on)] output:
OK

freeswitch@localhost.localdomain (freeswitch@localhost.localdomain)> 2008-09-18 18:26:44 [CONSOLE] mod_xml_curl.c:245 xml_url_fetch() Key is not in cache [1039@192.168.1.225 (1039@192.168.1.225)].
2008-09-18 18:26:45 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML response is in /tmp/e00c7ae0-85d0-11dd-838c-5148f6e85b7b.tmp.xml

2008-09-18 18:27:10 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch() Using xml from cache: 1039@192.168.1.225 (1039@192.168.1.225)
2008-09-18 18:27:35 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch() Using xml from cache: 1039@192.168.1.225 (1039@192.168.1.225)

freeswitch@localhost.localdomain (freeswitch@localhost.localdomain)> xml_curl cache_delete_key 1039@192.168.1.225 (1039@192.168.1.225)
2008-09-18 18:27:42 [NOTICE] mod_xml_curl.c:128 xml_curl_function() Removing value for [1039@192.168.1.225 (1039@192.168.1.225)]
API CALL [xml_curl(cache_delete_key 1039@192.168.1.225 (1039@192.168.1.225))] output:
OK

2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:245 xml_url_fetch() Key is not in cache [1039@192.168.1.225 (1039@192.168.1.225)].
2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML response is in /tmp/0d729f00-85d1-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain (freeswitch@localhost.localdomain)> xml_curl cache_off
2008-09-18 18:28:07 [NOTICE] mod_xml_curl.c:102 xml_curl_function() cleaning up directory cache
API CALL [xml_curl(cache_off)] output:
OK
========================================================================


cristian

Anthony Minessale wrote:
Quote:
if you say inhale the xml into memory and the sever goes haywire and sends you 2 gigs out output you are in for a treat.
if you can get enough call volume on one box where the disk i/o of xml_curl even shows up on the map in relation to all the rtp etc, we've won.


On Wed, Sep 17, 2008 at 6:00 PM, Cristian Talle <ctalle@voiceway.ca (ctalle@voiceway.ca)> wrote:
Quote:
less tickin keeps you breathin Smile It'd be nice though if you could just
use xml_rpc to tell FS:

/xml_update <section> <tag> <tag_attr_name> <tag_attr_val>...,/

similar to xml_locate

Cristian

Brian West wrote:
Quote:
If you're that concerned with it.. move the tmp to a ramdisk Wink I
thought modern hard drives could take a lickin and keep on tickin

/b

On Sep 17, 2008, at 5:51 PM, Cristian Talle wrote:


Quote:
Oh, they are but it's still HDD... I wouldn't like to see the server
die
because of too much disk IO
I'm trying to figure out what's the most efficient way to handle
changes
in user profiles (and possibly dialplan, etc...) if order handle
thousands of users per server.

Cristian



_______________________________________________
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





--
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

Quote:


_______________________________________________
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
ctalle at voiceway.ca
Guest





PostPosted: Thu Sep 18, 2008 5:55 pm    Post subject: [Freeswitch-users] Alternative to directory lookup using mod Reply with quote

I gave it a try though... and it works nicely (at least for directory
entries for now). I've added 3 more commands to xml_curl: cache_on,
cache_off and cache_delete_key.

- cache_on - enables caching: it will store in a switch_hash_t structure
all xml strings returned by curl, using <username>@<realm> as a key
(since we're talking directory only in this example). The same key is
looked up every time the xml is requested for that user/realm and the
code returns an xml structure created using switch_parse_xml_from_str().

- cache_off - switches back to the original behavior and clears the hash.

- cache_delete_key <key> - will invalidate the cache entry so that next
time it is reloaded by curl.

considering a 500 bytes - 1K string for each profile, you can cache
10000 user profiles in ~10M (considering we're storing the char* s)
please see a sample console output,with a terminal registering every 25
seconds

============================================================================
freeswitch@localhost.localdomain> 2008-09-18 18:26:19 [CONSOLE]
mod_xml_curl.c:363 xml_url_fetch() XML response is in
/tmp/d0c586a8-85d0-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain> xml_curl cache_on
API CALL [xml_curl(cache_on)] output:
OK

freeswitch@localhost.localdomain> 2008-09-18 18:26:44 [CONSOLE]
mod_xml_curl.c:245 xml_url_fetch() Key is not in cache [1039@192.168.1.225].
2008-09-18 18:26:45 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML
response is in /tmp/e00c7ae0-85d0-11dd-838c-5148f6e85b7b.tmp.xml

2008-09-18 18:27:10 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch() Using
xml from cache: 1039@192.168.1.225
2008-09-18 18:27:35 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch() Using
xml from cache: 1039@192.168.1.225

freeswitch@localhost.localdomain> xml_curl cache_delete_key
1039@192.168.1.225
2008-09-18 18:27:42 [NOTICE] mod_xml_curl.c:128 xml_curl_function()
Removing value for [1039@192.168.1.225]
API CALL [xml_curl(cache_delete_key 1039@192.168.1.225)] output:
OK

2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:245 xml_url_fetch() Key is
not in cache [1039@192.168.1.225].
2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML
response is in /tmp/0d729f00-85d1-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain> xml_curl cache_off
2008-09-18 18:28:07 [NOTICE] mod_xml_curl.c:102 xml_curl_function()
cleaning up directory cache
API CALL [xml_curl(cache_off)] output:
OK
========================================================================


cristian

Anthony Minessale wrote:
Quote:
if you say inhale the xml into memory and the sever goes haywire and
sends you 2 gigs out output you are in for a treat.
if you can get enough call volume on one box where the disk i/o of
xml_curl even shows up on the map in relation to all the rtp etc,
we've won.


On Wed, Sep 17, 2008 at 6:00 PM, Cristian Talle <ctalle@voiceway.ca
<mailto:ctalle@voiceway.ca>> wrote:

less tickin keeps you breathin Smile It'd be nice though if you could
just
use xml_rpc to tell FS:

/xml_update <section> <tag> <tag_attr_name> <tag_attr_val>...,/

similar to xml_locate

Cristian

Brian West wrote:
Quote:
If you're that concerned with it.. move the tmp to a ramdisk Wink I
thought modern hard drives could take a lickin and keep on tickin

/b

On Sep 17, 2008, at 5:51 PM, Cristian Talle wrote:


Quote:
Oh, they are but it's still HDD... I wouldn't like to see the
server
Quote:
Quote:
die
because of too much disk IO
I'm trying to figure out what's the most efficient way to handle
changes
in user profiles (and possibly dialplan, etc...) if order handle
thousands of users per server.

Cristian



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
<mailto:Freeswitch-users@lists.freeswitch.org>
Quote:
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users

UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote:
http://www.freeswitch.org




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
<mailto: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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------

_______________________________________________
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



_______________________________________________
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
ctalle at voiceway.ca
Guest





PostPosted: Thu Sep 18, 2008 6:00 pm    Post subject: [Freeswitch-users] Alternative to directory lookup using mod Reply with quote

sorry, I meant switch_xml_parse_str() not switch_parse_xml_from_str()

Cristian Talle wrote:
Quote:
I gave it a try though... and it works nicely (at least for directory
entries for now). I've added 3 more commands to xml_curl: cache_on,
cache_off and cache_delete_key.

- cache_on - enables caching: it will store in a switch_hash_t
structure all xml strings returned by curl, using <username>@<realm>
as a key (since we're talking directory only in this example). The
same key is looked up every time the xml is requested for that
user/realm and the code returns an xml structure created using
switch_parse_xml_from_str().

- cache_off - switches back to the original behavior and clears the hash.

- cache_delete_key <key> - will invalidate the cache entry so that
next time it is reloaded by curl.

considering a 500 bytes - 1K string for each profile, you can cache
10000 user profiles in ~10M (considering we're storing the char* s)
please see a sample console output,with a terminal registering every
25 seconds

============================================================================

freeswitch@localhost.localdomain> 2008-09-18 18:26:19 [CONSOLE]
mod_xml_curl.c:363 xml_url_fetch() XML response is in
/tmp/d0c586a8-85d0-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain> xml_curl cache_on
API CALL [xml_curl(cache_on)] output:
OK

freeswitch@localhost.localdomain> 2008-09-18 18:26:44 [CONSOLE]
mod_xml_curl.c:245 xml_url_fetch() Key is not in cache
[1039@192.168.1.225].
2008-09-18 18:26:45 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML
response is in /tmp/e00c7ae0-85d0-11dd-838c-5148f6e85b7b.tmp.xml

2008-09-18 18:27:10 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch() Using
xml from cache: 1039@192.168.1.225
2008-09-18 18:27:35 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch() Using
xml from cache: 1039@192.168.1.225

freeswitch@localhost.localdomain> xml_curl cache_delete_key
1039@192.168.1.225
2008-09-18 18:27:42 [NOTICE] mod_xml_curl.c:128 xml_curl_function()
Removing value for [1039@192.168.1.225]
API CALL [xml_curl(cache_delete_key 1039@192.168.1.225)] output:
OK

2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:245 xml_url_fetch() Key
is not in cache [1039@192.168.1.225].
2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML
response is in /tmp/0d729f00-85d1-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain> xml_curl cache_off
2008-09-18 18:28:07 [NOTICE] mod_xml_curl.c:102 xml_curl_function()
cleaning up directory cache
API CALL [xml_curl(cache_off)] output:
OK
========================================================================


cristian

Anthony Minessale wrote:
Quote:
if you say inhale the xml into memory and the sever goes haywire and
sends you 2 gigs out output you are in for a treat.
if you can get enough call volume on one box where the disk i/o of
xml_curl even shows up on the map in relation to all the rtp etc,
we've won.


On Wed, Sep 17, 2008 at 6:00 PM, Cristian Talle <ctalle@voiceway.ca
<mailto:ctalle@voiceway.ca>> wrote:

less tickin keeps you breathin Smile It'd be nice though if you could
just
use xml_rpc to tell FS:

/xml_update <section> <tag> <tag_attr_name> <tag_attr_val>...,/

similar to xml_locate

Cristian

Brian West wrote:
Quote:
If you're that concerned with it.. move the tmp to a ramdisk Wink I
thought modern hard drives could take a lickin and keep on tickin

/b

On Sep 17, 2008, at 5:51 PM, Cristian Talle wrote:


Quote:
Oh, they are but it's still HDD... I wouldn't like to see the
server
Quote:
Quote:
die
because of too much disk IO
I'm trying to figure out what's the most efficient way to handle
changes
in user profiles (and possibly dialplan, etc...) if order handle
thousands of users per server.

Cristian



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
<mailto:Freeswitch-users@lists.freeswitch.org>
Quote:
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users


UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote:
http://www.freeswitch.org




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
<mailto: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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------

_______________________________________________
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





_______________________________________________
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
ctalle at voiceway.ca
Guest





PostPosted: Thu Sep 18, 2008 6:12 pm    Post subject: [Freeswitch-users] Alternative to directory lookup using mod Reply with quote

Not yet, I'm still getting familiar with it - I haven't covered the
dialplan yet but I really like the voicemail module.
I will set up a real server some time this week-end and I'll try
stressing it.

cristian

Michael Jerris wrote:
Quote:
Do you have any performance tests to show the difference?

Mike


On Sep 18, 2008, at 6:50 PM, Cristian Talle wrote:

Quote:
I gave it a try though... and it works nicely (at least for directory
entries for now). I've added 3 more commands to xml_curl: cache_on,
cache_off and cache_delete_key.

- cache_on - enables caching: it will store in a switch_hash_t
structure all xml strings returned by curl, using <username>@<realm>
as a key (since we're talking directory only in this example). The
same key is looked up every time the xml is requested for that
user/realm and the code returns an xml structure created using
switch_parse_xml_from_str().

- cache_off - switches back to the original behavior and clears the hash.

- cache_delete_key <key> - will invalidate the cache entry so that
next time it is reloaded by curl.

considering a 500 bytes - 1K string for each profile, you can cache
10000 user profiles in ~10M (considering we're storing the char* s)
please see a sample console output,with a terminal registering every
25 seconds

============================================================================
freeswitch@localhost.localdomain> 2008-09-18 18:26:19 [CONSOLE]
mod_xml_curl.c:363 xml_url_fetch() XML response is in
/tmp/d0c586a8-85d0-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain> xml_curl cache_on
API CALL [xml_curl(cache_on)] output:
OK

freeswitch@localhost.localdomain> 2008-09-18 18:26:44 [CONSOLE]
mod_xml_curl.c:245 xml_url_fetch() Key is not in cache
[1039@192.168.1.225].
2008-09-18 18:26:45 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML
response is in /tmp/e00c7ae0-85d0-11dd-838c-5148f6e85b7b.tmp.xml

2008-09-18 18:27:10 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch()
Using xml from cache: 1039@192.168.1.225
2008-09-18 18:27:35 [CONSOLE] mod_xml_curl.c:231 xml_url_fetch()
Using xml from cache: 1039@192.168.1.225

freeswitch@localhost.localdomain> xml_curl cache_delete_key
1039@192.168.1.225
2008-09-18 18:27:42 [NOTICE] mod_xml_curl.c:128 xml_curl_function()
Removing value for [1039@192.168.1.225]
API CALL [xml_curl(cache_delete_key 1039@192.168.1.225)] output:
OK

2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:245 xml_url_fetch() Key
is not in cache [1039@192.168.1.225].
2008-09-18 18:28:01 [CONSOLE] mod_xml_curl.c:363 xml_url_fetch() XML
response is in /tmp/0d729f00-85d1-11dd-838c-5148f6e85b7b.tmp.xml

freeswitch@localhost.localdomain> xml_curl cache_off
2008-09-18 18:28:07 [NOTICE] mod_xml_curl.c:102 xml_curl_function()
cleaning up directory cache
API CALL [xml_curl(cache_off)] output:
OK
========================================================================

------------------------------------------------------------------------

_______________________________________________
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



_______________________________________________
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
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

VoiceMeUp - Corporate & Wholesale VoIP Services