Hi Subash
I tested this with our scenario and it seems to work fine.

Thanks & Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729


On Fri, Jun 13, 2014 at 12:26 PM, Senaka Fernando <[email protected]> wrote:

> Guys,
>
> We have to do a thorough perf test with the WS-API. There can be design
> issues that affect performance to a great extent.
>
> Thanks,
> Senaka.
>
>
> On Fri, Jun 13, 2014 at 6:42 AM, Subash Chaturanga <[email protected]>
> wrote:
>
>> Hi,
>> Here I am attaching the patch which does the check of the content size.
>> And if it is <1MB then we load it to memory and pass a ByteArray data
>> source for the data handler. And if >1MB we proceed as previously.
>>
>> @Danushka,
>> Please use the following patch and verify your scenario.
>>
>>
>>
>> On Tue, Jun 10, 2014 at 8:34 PM, Ajith Vitharana <[email protected]> wrote:
>>
>>> Please find the blog post [1].
>>>
>>> [1]
>>> http://ajithvblogs.blogspot.de/2013/11/jmeter-java-request-to-test.html
>>>
>>> Thanks.
>>> Ajith
>>>
>>>
>>> On Tue, Jun 10, 2014 at 8:28 PM, Subash Chaturanga <[email protected]>
>>> wrote:
>>>
>>>> Hi ,
>>>> This is regarding  issue on WS Registry Service Client in high
>>>> concurrency which seems blocks the AF release.
>>>>
>>>> When reading the content with several threads in AF, i.e two resources
>>>>
>>>> path = /foo/r1 content = 12345
>>>> path = /foo/r2 content =  67
>>>>
>>>> For AF guys, when they retrieve r1 and r2 resources, i.e for
>>>> r1 - returns  12345
>>>> but r2 returns 67*45*
>>>>
>>>> ( r2 returns with some values from old resource content. )
>>>>
>>>> When dig deep with Janaka, found that, in server side
>>>>  org.wso2.carbon.registry.ws.api.WSRegistry maintains single tempFile per
>>>> instance. And it get used to maintain the content to pass to client side
>>>> inside the DataHolder.
>>>>
>>>> Hence obviously we can expect this issue in a but high concurrency. So
>>>> as a solution when  creating the data holder we create a copy of the
>>>> aforementioned file as follows. And then for multiple requests on the same
>>>> ws connection it deals with separate files and issue went away.
>>>>
>>>> But this leads to grow the tmp files in the tmp directory but upon
>>>> server downtime those will get vanished.
>>>>
>>>> With the following fix, since files are growing, one option is to do an
>>>> additional ws call inside ws-client to server side to clean up the
>>>> particular file. But it seems not a best solution.
>>>>
>>>>
>>>> *So @Senaka @Ajith, Any better solution you can see ? *
>>>>
>>>>
>>>>  Index:
>>>> src/main/java/org/wso2/carbon/registry/ws/api/utils/CommonUtil.java
>>>> ===================================================================
>>>> --- src/main/java/org/wso2/carbon/registry/ws/api/utils/CommonUtil.java
>>>>        (revision 204294)
>>>> +++ src/main/java/org/wso2/carbon/registry/ws/api/utils/CommonUtil.java
>>>>        (working copy)
>>>> @@ -193,6 +193,9 @@
>>>>     }
>>>>
>>>>     public static DataHandler makeDataHandler(Resource resource, File
>>>> tempFile) throws IOException, RegistryException{
>>>> +        tempFile = File.createTempFile("wsresource", ".tmp");
>>>> +        tempFile.deleteOnExit();
>>>> +
>>>>         if (resource.getContent() == null) {
>>>>             return null;
>>>>         }
>>>>
>>>>
>>>> --
>>>> Thanks
>>>> /subash
>>>>
>>>> *Subash Chaturanga*
>>>> Senior Software Engineer :Platform TG; WSO2 Inc. http://wso2.com
>>>>
>>>> email: [email protected]
>>>> blog:  http://subashsdm.blogspot.com/
>>>> twitter: @subash89
>>>> phone: +9477 2225922
>>>> Lean . Enterprise . Middleware
>>>>
>>>
>>>
>>>
>>> --
>>> Ajith Vitharana.
>>> WSO2 Inc. - http://wso2.org
>>> Email  :  [email protected]
>>> Mobile : +94772217350
>>>
>>>
>>
>>
>> --
>> Thanks
>> /subash
>>
>> *Subash Chaturanga*
>> Senior Software Engineer & Lead WSO2 Governance Registry
>>  Platform TG; WSO2 Inc. http://wso2.com
>> Contact:
>> email: [email protected]
>> blog:  http://subashsdm.blogspot.com/
>> twitter: @subash89
>> phone: +9477 2225922
>> Lean . Enterprise . Middleware
>>
>
>
>
> --
>
>
> *[image: http://wso2.com] <http://wso2.com> Senaka Fernando*
> Software Architect; WSO2 Inc.; http://wso2.com
>
>
>
> * Member; Apache Software Foundation; http://apache.org
> <http://apache.org>E-mail: senaka AT wso2.com <http://wso2.com>**P: +1
> 408 754 7388 <%2B1%20408%20754%207388>; ext: 51736*;
>
>
> *M: +44 782 741 1966 <%2B44%20782%20741%201966> Linked-In:
> http://linkedin.com/in/senakafernando
> <http://linkedin.com/in/senakafernando>*
> Lean . Enterprise . Middleware
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to