[Freeswitch-users] ReloadXML takes very long time

Yiftach Golan yiftah at choochee.com
Wed Oct 24 00:28:44 MSD 2012


In our method the caching that we made is based on a file when someone
wants to load a file we just run :
> reloadxml "<file_name.xml>"
I am keeping the aggregated XML inside the memory in a pre allocated area,
and before and after each file I put an xml note :
<!-- TENANT_START_FILE_PATH =
/opt/freeswitch/conf/autoload_configs/jingle_profiles/client.xml -->
and in the end
<!-- TENANT_EXIT_FILE_PATH =
/opt/freeswitch/conf/autoload_configs/jingle_profiles/client.xml -->
When the user wants to load
"/opt/freeswitch/conf/autoload_configs/jingle_profiles/client.xml" I just
search for this file in the memory replace the content and then let the
regular xml parser do its work
I will try the other options and if they give a better solution I will just
use them if not I will add our changes to the HEAD
Thanks,
Yiftach.

On Tue, Oct 23, 2012 at 11:01 AM, Anthony Minessale <
anthony.minessale at gmail.com> wrote:

> The philosophy on xml_curl is to leverage the resilience of existing http
> clusters so the complexity is left to that component.
> You have some choices:
>
> 1) Use the xml_curl and DB on the local box itself so you can not worry
> about losing connections to a db.
> 2) Use the xml dp file feature where you set the dialplan to
> XML:/path/to/file.xml which is same format of what xml_curl returns and is
> static.
> 3) Write an XML hook module in C using the same technique as xml_curl that
> takes  the search params and chooses the correct static files to parse.
> 4) Clean up your patch and try to get it into HEAD without breaking
> anything.
>
> I would like to implement caching too but the challenge is you need to
> know which of the 100 input fields are relevant to the results returned so
> you can key the cache on those specific params.
>
> I recommend you make sure you fully understand all of the above choices
> and make some educated decisions about what you want to do before you turn
> to surgery on the core of FS.
>
>
> On Tue, Oct 23, 2012 at 10:53 AM, Yiftach Golan <yiftah at choochee.com>wrote:
>
>> Hi Seven,
>> Thanks for the reply
>> I have two problems with the mod_xml_curl :
>> 1. We want to have some kind of caching mechanism so that if FreeSWITCH
>> crushes and there is no connection to the web server FreeSWITCH still works
>> (we are in a cloud environment)
>> If I understand correctly with mod_xml_curl we cannot achieve that
>> 2. How would it work from the lua script ?
>> Can I reloadxml from lua file by file?
>> 3. We already have a very complicated xml structure to support all of our
>> feature so probably converting the xmls will be pretty hard tasks
>> Any ideas?
>>
>>
>> On Tue, Oct 23, 2012 at 12:17 AM, Seven Du <dujinfang at gmail.com> wrote:
>>
>>>  I don't understand why you don't use mod_xml_curl, can you explain
>>> more?
>>>
>>> you could also try some lua binding which could pull from DB and
>>> generate XML on demand, not sure if it works for you.
>>>
>>> --
>>> Seven Du
>>> Sent with Sparrow <http://www.sparrowmailapp.com/?sig>
>>>
>>> On Tuesday, October 23, 2012 at 8:56 AM, Yiftach Golan wrote:
>>>
>>> Hi FreeSWITCH community,
>>> My name is Yiftah and I am working for ChooChee which is a hosted PBX
>>> solution company
>>> We have been using FreeSWITCH for almost 2 years and we added a lot of
>>> code changes to the core and to the different modules
>>> Lately we have made a decision to get more close to the community so
>>> that we can enjoy the bug fixes and the new feature from the community and
>>> we can contribute our knowledge and bug fixes
>>> I would please like to start with a very basic question :
>>> We are using dialplan xmls in order to load the configuration, we have a
>>> lot of users on each freeswitch (+4k), it took a very long time for the
>>> configuration to load (around 5 minutes) during this time no new calls
>>> could be served by FreeSWITCH
>>> In order to solve this problem we introduce reload xml that accepts file
>>> names and has the ability to load just one file name into the memory (we
>>> achieved 10ms loading time instead of 5 minutes)
>>> The problem is that we had to introduce a lot of code in order to solve
>>> this problem, has anyone else encounter this problem? we do not want to use
>>> mod_xml_curl as we want to take care bringing the file to the machine
>>> Another approach that we thought is that a database might be much better
>>> fit in here, because every xml update includes the entire tenant (business)
>>> and has the potential in harming other users in the same tenant, also DB
>>> has much higher capacities then XMLs, did anyone think of enabling MySQL as
>>> a directory of parameters instead of xml?
>>> Thanks,
>>> Yiftach.
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> 
>>> 
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.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://wiki.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://wiki.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
>>
>>
>
>
> --
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
> Twitter: http://twitter.com/FreeSWITCH_wire
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> googletalk:conf+888 at conference.freeswitch.org
> pstn:+19193869900
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20121023/1603cf8f/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list