Manual Calculation of WTPrincipalCache Size
Steps to Calculate the WTPrincipalCache Size Manually
To calculate the WTPrincipalCache size manually, follow the steps as mentioned below:
The cache sizing formula (3*A)+(2*B)+C+(2*D) should be used where:
1. A is the number of active users in the system (disabled=0).
2. B is the number of user-defined groups (status=’public’ and disabled=0).
3. C is the number of system groups (status=’system’ and disabled=0).
4. D is the number of active organizations in the system (disabled=0).
Few points to consider while calculating the WTPrincipalCache size are
Value of WTPrincipalCache should be larger than sum of A, B, C and D to avoid database lookup.
Consider increasing WTPrincipalCache value according to (3*A)+(2*B)+C+(2*D) formula when A+B+C+D is close to current wt.cache.size.WTPrincipalCache setting.
The queries to generate the result are as follows:
1. For Oracle:
select sum(Total) from (
select exp(sum(ln(Total))) as Total from (select 3 as Total from dual union all select count(*) as Total fromWTUserwhere disabled=0) union all
select exp(sum(ln(Total))) as Total from (select 2 as Total from dual union all select count(*) as Total from WTGroup where lower(status)='public' and disabled=0) union all
select count(*) as Total from WTGroup where disabled=0 and lower(status)='system' union all
select exp(sum(ln(Total))) as Total from (select 2 as Total from dual union all select count(*) as Total fromWTOrganizationwheredisabled=0)
);
2. For SQLServer:
select sum(wtp.Total) from (
select exp(sum(log(wtu.Total))) as Total from (select 3 as Total union all select count(*) as Total from WTUser where disabled=0) as wtu
union all
select exp(sum(log(wtg.Total))) as Total from (select 2 as Total union all select count(*) as Total from WTGroup where disabled=0 and lower(status)='public') as wtg
union all
select count(*) as Total from WTGroup where internal=1 and disabled=0 and lower(status)='system'
union all
select exp(sum(log(wto.Total))) as Total from (select 2 as Total union all select count(*) as Total from WTOrganization where disabled=0) as wto
) as wtp;
這是否有幫助?