Skip to content

[BUG] 高并发下SphO.entry(resourceName)方法占用cpu持续飙高,并且固定4秒才返回结果 #3552

@sunwuxiang

Description

@sunwuxiang

版本:1.4.1

配置:
FlowRule paceRule = new FlowRule();
paceRule.setResource(resourceName);
paceRule.setCount(distributeConfig.getQps().doubleValue());
paceRule.setGrade(RuleConstant.FLOW_GRADE_QPS);
paceRule.setLimitApp("default");
paceRule.setControlBehavior(RuleConstant.CONTROL_BEHAVIOR_RATE_LIMITER);
paceRule.setMaxQueueingTimeMs(distributeConfig.getQpsWaittingTime() * 1000);
flowRules.add(paceRule);

使用:
if (SphO.entry(distributeResourceName)) {
//业务逻辑
return XXX;
}
//业务逻辑

现象:
请求量高,大约200多个线程左右并发,限流值:5,在半夜出现CPU持续飙高未打满,4核cpu达到3.18左右,然后就出现SphO.entry(resourceName)方法固定执行4秒钟,同时接口处的另一个SphO.entry方法固定执行2秒钟,的重启服务后恢复

环境:
jdk 8,spring boot 1.5.8,spring 4.3.12,4核cpu3G

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions