Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] cpu usage 高到40%, 下不来 #686

Open
bbili opened this issue Oct 18, 2024 · 1 comment
Open

[Bug] cpu usage 高到40%, 下不来 #686

bbili opened this issue Oct 18, 2024 · 1 comment

Comments

@bbili
Copy link

bbili commented Oct 18, 2024

Description
开启协程的服务, 出现cpu飙升后, 即使服务摘流了, 也没有看到cpu利用率下来.

JDK version

java -version
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (Alibaba Dragonwell 8.8.8) (build 1.8.0_302-b01)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell 8.8.8) (build 25.302-b01, mixed mode)

Execution environment

  • OS and version:
  • CPU model:
  • Number of CPU cores:
  • Size of physical memory:
  • Inside Linux container?
    • Linux container name (docker, pouch, etc):
    • Linux container version:
[arthas@1065195]$ thread -n 3
"Wisp-Root-Worker-4" Id=8 cpuUsage=41.11% deltaTime=88ms time=45983512ms RUNNABLE
    at sun.misc.Unsafe.unpark0(Native Method)
    at sun.misc.Unsafe.access$100(Unsafe.java:45)
    at sun.misc.Unsafe$1.unpark0(Unsafe.java:60)
    at com.alibaba.wisp.engine.WispScheduler$Worker.doSignalIfNecessary(WispScheduler.java:217)
    at com.alibaba.wisp.engine.WispScheduler$Worker.signal(WispScheduler.java:258)
    at com.alibaba.wisp.engine.WispScheduler.tryPush(WispScheduler.java:322)
    at com.alibaba.wisp.engine.WispScheduler.signalIdleWorkerToHelpSteal(WispScheduler.java:450)
    at com.alibaba.wisp.engine.WispScheduler.access$1600(WispScheduler.java:43)
    at com.alibaba.wisp.engine.WispScheduler$SchedulingPolicy$1.enqueue(WispScheduler.java:415)
    at com.alibaba.wisp.engine.WispScheduler.executeWithWorkerThread(WispScheduler.java:404)
    at com.alibaba.wisp.engine.WispCarrier.wakeupTask(WispCarrier.java:304)
    at com.alibaba.wisp.engine.WispCarrier$1.run(WispCarrier.java:360)
    at com.alibaba.wisp.engine.WispScheduler.doExec(WispScheduler.java:536)
    at com.alibaba.wisp.engine.WispScheduler.access$600(WispScheduler.java:43)
    at com.alibaba.wisp.engine.WispScheduler$Worker.runCarrier(WispScheduler.java:161)
    at com.alibaba.wisp.engine.WispScheduler$Worker.run(WispScheduler.java:137)
    at java.lang.Thread.run(Thread.java:853)


"Wisp-Root-Worker-10" Id=14 cpuUsage=40.76% deltaTime=87ms time=46051964ms RUNNABLE
    at sun.misc.Unsafe.park0(Native Method)
    at sun.misc.Unsafe.access$200(Unsafe.java:45)
    at sun.misc.Unsafe$1.park0(Unsafe.java:65)
    at com.alibaba.wisp.engine.WispScheduler$Worker.doParkOrPolling(WispScheduler.java:188)
    at com.alibaba.wisp.engine.WispScheduler$Worker.runCarrier(WispScheduler.java:170)
    at com.alibaba.wisp.engine.WispScheduler$Worker.run(WispScheduler.java:137)
    at java.lang.Thread.run(Thread.java:853)


"Wisp-Root-Worker-12" Id=16 cpuUsage=40.4% deltaTime=86ms time=46007158ms RUNNABLE
    at sun.misc.Unsafe.park0(Native Method)
    at sun.misc.Unsafe.access$200(Unsafe.java:45)
    at sun.misc.Unsafe$1.park0(Unsafe.java:65)
    at com.alibaba.wisp.engine.WispScheduler$Worker.doParkOrPolling(WispScheduler.java:188)
    at com.alibaba.wisp.engine.WispScheduler$Worker.runCarrier(WispScheduler.java:170)
    at com.alibaba.wisp.engine.WispScheduler$Worker.run(WispScheduler.java:137)
    at java.lang.Thread.run(Thread.java:853)

pofile文件:
profiler_202410181004.html.zip

@jia-wei-tang
Copy link
Collaborator

jia-wei-tang commented Oct 30, 2024

日志里的Wisp-Root-Worker-10/12处于park状态,应该不占用CPU;Wisp-Root-Worker-4处于unpark0调用中,这个唤醒的操作应该不会占用太多资源。如果这个线程一直停止在这个函数的话,希望能够提供以下native c stack信息(可以通过gdb等方式获取)
此外,8.8.8版本是比较旧的dw8版本,建议先升级到最新版本,看看问题是否依旧存在。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants