手动计算 WTPrincipalCache 大小
手动计算 WTPrincipalCache 大小的步骤
要手动计算 WTPrincipalCache 大小,请按如下所述步骤进行操作:
应使用缓存大小计算公式 (3*A)+(2*B)+C+(2*D),其中:
1. A 是系统中活动用户的数目 (disabled=0)。
2. B 是用户定义组的数量 (status='public' 和 disabled=0)。
3. C 是系统组的数量 (status='system' 和 disabled=0)。
4. D 是系统中活动组织的数目 (disabled=0)。
计算 WTPrincipalCache 大小时需要考虑以下几点:
WTPrincipalCache 的值应大于 A、B、C 和 D 的和,以避免数据库查找。
当 A+B+C+D 与当前 wt.cache.size.WTPrincipalCache 设置接近时,请考虑根据 (3*A)+(2*B)+C+(2*D) 公式增加 WTPrincipalCache 值。
生成结果的查询如下所示:
1. 对于 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. 对于 SQL Server:
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;
这对您有帮助吗?