question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

netty doesn't use maximum cpu even though it has room and things to do, much waiting at epollWaitNoTimerChange

See original GitHub issue

I’m writing a network intensive WebFlux application. When receiving request, application requests and recieves something with another external server and then reply to original requester. I’m talking about the WebFlux application, and I’m using WebClient when call to external server.

Application’s performance is not that satisfiable. I think it should touch the maximum of CPU resource, maximum TPS at maximum CPU. But it shows low tps, cpu is just at 30 ~ 40%. Can we check why it does not use CPU any more to get more TPS, even though it has more room to execute more requests.

It waits a lot at many threads, like this… { “threadName”: “reactor-http-epoll-3”, “threadId”: 20, “blockedTime”: -1, “blockedCount”: 8, “waitedTime”: -1, “waitedCount”: 0, “lockName”: null, “lockOwnerId”: -1, “lockOwnerName”: null, “inNative”: true, “suspended”: false, “threadState”: “RUNNABLE”, “stackTrace”: [ { “methodName”: “epollWait”, “fileName”: “Native.java”, “lineNumber”: -2, “className”: “io.netty.channel.epoll.Native”, “nativeMethod”: true }, { “methodName”: “epollWait”, “fileName”: “Native.java”, “lineNumber”: 148, “className”: “io.netty.channel.epoll.Native”, “nativeMethod”: false }, { “methodName”: “epollWait”, “fileName”: “Native.java”, “lineNumber”: 141, “className”: “io.netty.channel.epoll.Native”, “nativeMethod”: false }, { “methodName”: “epollWaitNoTimerChange”, “fileName”: “EpollEventLoop.java”, “lineNumber”: 290, “className”: “io.netty.channel.epoll.EpollEventLoop”, “nativeMethod”: false }, { “methodName”: “run”, “fileName”: “EpollEventLoop.java”, “lineNumber”: 347, “className”: “io.netty.channel.epoll.EpollEventLoop”, “nativeMethod”: false }, {…

Expected behavior

CPU reaches 100% and shows good TPS

Actual behavior

CPU just stays at 30~40%, and shows low TPS

Steps to reproduce

reproducing codes : https://github.com/mouse500/perfwebf

/workloadwexcall : workload using external call

external call is implemented with simple nodejs server

jmeter to call above api with more than 200 threads.

Minimal yet complete reproducer code (or URL to code)

Netty version

netty-transport-native-epoll-4.1.52.Final

JVM version (e.g. java -version)

java 1.8.0_292 spring boot 2.3.4.RELEASE, WebFlux, WebClient

OS version (e.g. uname -a)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mouse500commented, Jul 20, 2021

Thank you for all

0reactions
mouse500commented, Jul 20, 2021

@violetagg Ok, Thank you, I will try. Actaully, I already tried with various version of Spring Boot, and JDK version, Linux Distribion. Anway, will try with the latest version.

Now, I think this is about some other issue. I will look around something else more.

Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

io.netty.channel.epoll.Native.epollWait0 high cpu usage #5896
I'm experiencing very high cpu load while using the native transport, the epollWait method is taking as much cpu as a while (true)...
Read more >
WebFlux WebClient performance doesn't touch maximum of ...
Question is, why it does not use CPU any more to get more TPS, even though it has more room to execute more...
Read more >
EPollArrayWrapper.epollWait issue still 100 % CPU load
If the service started in bad state (elevated CPU) - it eventually spike to 100% CPU usage, eventually failing requests. And it never...
Read more >
A Deep Dive Into Spring WebFlux Threading Model
If you are building reactive applications with Spring WebFlux, typically you will use Reactor Netty as a default embedded server.
Read more >
Explain non-blocking I/O like I'm five - codecentric Blog
In this post we were focusing on non-blocking I/O which refers to threads not waiting for I/O operations to finish. However sometimes people ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found