synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiranya Jayathilaka <hiranya...@gmail.com>
Subject Re: Concurrent Access to Dynamic Resources
Date Thu, 10 Sep 2009 05:19:32 GMT
On Thu, Sep 10, 2009 at 7:29 AM, Ruwan Linton <ruwan.linton@gmail.com>wrote:

> Hiranya,
>
> We need to introduce synchronization, true. But that has to be done very
> carefully and I don't think synchronizing the getter method is the right
> solution for this, as Supun explained that will be a performance bottleneck
> when Synapse is under a considerable amount of load.
>

Agreed. In fact synchronizing the entire methods could be a bottleneck even
with a small number of messages in the ESB. I guess if we are to introduce
some synchronization we should carefully find the relevant sensitive areas
which lead to contention within the methods.


>
> Will have a look and propose a more scalable solution, in the mean time you
> may investigate into this more as well.
>

Sure thing.

Thanks,
Hiranya


>
> Thanks,
> Ruwan
>
>
> On Wed, Sep 9, 2009 at 7:52 PM, Supun Kamburugamuva <supun06@gmail.com>wrote:
>
>> Hi,
>> I think this is the price that we have to pay for enabling
>> dynamic behavior. If the ESB is under huge load and we synchronize these
>> methods it won't scale anyway.
>>
>> Having two threads load the same resource is tolerable if one thread
>> doesn't access the resource while it is initialized halfway way.
>>
>> One suggestion, I think if we can move the
>>
>> initialized = true; line 166
>>
>> statement in the AbstractEndpoint.java to the bottom of the init method it
>> will be more safer.
>>
>> Thanks,
>> Supun..
>>
>> On Wed, Sep 9, 2009 at 5:48 AM, Hiranya Jayathilaka <hiranya911@gmail.com
>> > wrote:
>>
>>> Hi Devs,
>>> The Axis2MessageContext class uses SynapseConfiguration#getEndpoint and
>>> SynapseConfiguration#getSequence methods to gain access to dynamic endpoints
>>> and sequences when they are not present in the message context's local
>>> store. However these method calls are not synchronized and from the looks of
>>> it I feel that if two message contexts try to access the same dynamic
>>> resource at the same time there is a chance that SynapseConfiguration would
>>> perform two remote registry lookups to fetch the same resource. This won't
>>> really cause any erroneous behavior but if the ESB is under a huge load
>>> where each message is trying to load a particular dynamic resource things
>>> may get out of hands.
>>>
>>> So does it make sense to bring in some synchronization into the picture?
>>> Or have I missed something and the above theory is not applicable?
>>>
>>> Thanks
>>> --
>>> Hiranya Jayathilaka
>>> Software Engineer;
>>> WSO2 Inc.;  http://wso2.org
>>> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
>>> Blog: http://techfeast-hiranya.blogspot.com
>>>
>>
>>
>>
>> --
>> Software Engineer, WSO2 Inc
>> http://wso2.org
>> supunk.blogspot.com
>>
>>
>>
>
>
> --
> Ruwan Linton
> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
> WSO2 Inc.; http://wso2.org
> email: ruwan@wso2.com; cell: +94 77 341 3097
> blog: http://ruwansblog.blogspot.com
>



-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Mime
View raw message