A small change in user.core is also needed. The RealmService has to be
published under two interfaces; RealmService & the
org.wso2.carbon.user.api.UserRealmService

On Fri, Oct 5, 2012 at 10:23 AM, Afkham Azeez <[email protected]> wrote:

> Dimuthu,
> Please review the attached patch.
>
>
> On Fri, Oct 5, 2012 at 10:19 AM, Afkham Azeez <[email protected]> wrote:
>
>> The UserRealm can be fetched on demand, and there is no need to set that
>> into the CarbonContext until such time somebody requests for it. I will
>> make this improvement.
>>
>> Azeez
>>
>>
>> On Sat, Sep 29, 2012 at 12:19 AM, Afkham Azeez <[email protected]> wrote:
>>
>>> Dimuthu,
>>> Instead of caching the UserRealm, if we set it as attribute in the
>>> tenant's ConfigContext, we should be saving quite a lot of time in
>>> retrieving the UserRealm.
>>>
>>> Azeez
>>>
>>>
>>> On Thu, Sep 27, 2012 at 10:18 PM, Afkham Azeez <[email protected]> wrote:
>>>
>>>> The UserRealm is taken from the cache, however, retrieving it from the
>>>> cache can itself be further optimized IMO. See attached screenshot. By
>>>> using a more efficient cache key, we may be able to get a considerable
>>>> improvement.
>>>>
>>>> On Thu, Sep 27, 2012 at 4:46 PM, Dimuthu Leelarathne <[email protected]
>>>> > wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> We load the tenant UserRealm on the first call. This profile test must
>>>>> be done for the first call. What is the result for the second call 
>>>>> onwards?
>>>>> Is it the same Reka?
>>>>>
>>>>> thanks,
>>>>> dimuthu
>>>>>
>>>>>
>>>>> On Thu, Sep 27, 2012 at 4:24 PM, Afkham Azeez <[email protected]> wrote:
>>>>>
>>>>>> Dimuthu,
>>>>>> Clearly, there is something wrong with tenant UserRealm caching. For
>>>>>> ST it seems to be cached while for other tenants it is not.
>>>>>>
>>>>>> Azeez
>>>>>>
>>>>>>
>>>>>> On Thu, Sep 27, 2012 at 4:15 PM, Reka Thirunavukkarasu <[email protected]
>>>>>> > wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> I have attached here with the ST and tenant results.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Reka
>>>>>>>
>>>>>>>  On Thu, Sep 27, 2012 at 3:53 PM, Afkham Azeez <[email protected]>wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Sep 27, 2012 at 3:33 PM, Afkham Azeez <[email protected]>wrote:
>>>>>>>>
>>>>>>>>> Dimuthu,
>>>>>>>>> Any idea why DefaultRealmService.getTenantUserRealm is taking
>>>>>>>>> quite a bit overhead?
>>>>>>>>>
>>>>>>>>
>>>>>>>> Shouldn't we be getting the Tenant UserRealm from the cache?
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Azeez
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Sep 27, 2012 at 2:26 PM, Reka Thirunavukkarasu <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> With this improvement, for 10000 requests to a webapp, consumed
>>>>>>>>>> load of getTenatDomain is nealy 1% and getAppName was below 1%. I 
>>>>>>>>>> have
>>>>>>>>>> attached the screen shot here with.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Reka
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, Sep 27, 2012 at 2:13 PM, Reka Thirunavukkarasu <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> Yes. It is fixed in r143911.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Reka
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Sep 27, 2012 at 2:01 PM, Afkham Azeez <[email protected]>wrote:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, Sep 10, 2012 at 3:47 PM, Reka Thirunavukkarasu <
>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Mon, Sep 10, 2012 at 3:18 PM, Afkham Azeez 
>>>>>>>>>>>>> <[email protected]>wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Amani, Reka,
>>>>>>>>>>>>>> Please try to optimize the following code in Utils.
>>>>>>>>>>>>>> request.getServerName is somewhat expensive, so we should be 
>>>>>>>>>>>>>> doing that
>>>>>>>>>>>>>> only if a URL mapped request is coming in. We can check for all 
>>>>>>>>>>>>>> general
>>>>>>>>>>>>>> cases first, and if all of those fail, finally check for URL 
>>>>>>>>>>>>>> mapping;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public static String getTenantDomain(HttpServletRequest
>>>>>>>>>>>>>> request) {
>>>>>>>>>>>>>> String requestURI = request.getRequestURI();
>>>>>>>>>>>>>>  String domain =
>>>>>>>>>>>>>> MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
>>>>>>>>>>>>>> *//if the request is from a url mapping(
>>>>>>>>>>>>>> https://apptest.wso2.com/),*
>>>>>>>>>>>>>> *        // need to get the tenant domain from the map*
>>>>>>>>>>>>>> *        String serverName = request.getServerName();*
>>>>>>>>>>>>>>         String appContext =
>>>>>>>>>>>>>> ApplicationContext.getCurrentApplicationContext().
>>>>>>>>>>>>>>                 getApplicationFromUrlMapping(serverName);
>>>>>>>>>>>>>>         if(appContext != null) {
>>>>>>>>>>>>>>             requestURI = appContext;
>>>>>>>>>>>>>>         }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Mon, Sep 10, 2012 at 3:09 PM, Afkham Azeez <[email protected]
>>>>>>>>>>>>>> > wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Take a look at the attached profiler screenshot. Some inner
>>>>>>>>>>>>>>> classes in CarbonContextHolderBase keep getting instantiated 
>>>>>>>>>>>>>>> several times
>>>>>>>>>>>>>>> during a single flow. I think we should be able to avoid that.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>     sure. Will optimize it accordingly.
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Was this completed?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> *Afkham Azeez*
>>>>>>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>>>>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>>>>>>> * <http://www.apache.org/>**
>>>>>>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>>>>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>>>>>>> twitter: 
>>>>>>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>>>>>>> *
>>>>>>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Lean . Enterprise . Middleware*
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Afkham Azeez*
>>>>>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>>>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>>>>>> * <http://www.apache.org/>**
>>>>>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>>>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>>>>>> twitter: 
>>>>>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>>>>>> *
>>>>>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Lean . Enterprise . Middleware*
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Architecture mailing list
>>>>>>>> [email protected]
>>>>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Afkham Azeez*
>>>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>>>> * <http://www.apache.org/>**
>>>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>>>> twitter: 
>>>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>>>> *
>>>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>>>> *
>>>>>> *
>>>>>> *Lean . Enterprise . Middleware*
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Afkham Azeez*
>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>> * <http://www.apache.org/>**
>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>> twitter: 
>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>> *
>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>> *
>>>> *
>>>> *Lean . Enterprise . Middleware*
>>>>
>>>>
>>>
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * <http://www.apache.org/>**
>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>> *
>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>**
>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>> *
>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>> *
>> *
>> *Lean . Enterprise . Middleware*
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>**
> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>


-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to