Profile Image
junxin zhu

'http-nio-BlockPoller' taken more than 90% cpu

I found a problem that when i start my application,after a while,it will taken more than 90% cpu.And in my thread tracking(I use jstack to find threads information),i found a thread that named 'http-nio-BlockPoller',it taken 90% cpu,and in the thread call,i found it locked for a long time,and it shows the problem begins with 'org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:313)'.Then i checked my codes,but i can not find any problems of my code,so it maybe tomcat's problem?Who can teach me how to fixed this problem?Thank you very much!

 

Report URL - https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDEvMTgvLS10aHJlYWRzcy56aXAtLTYtMjktMzM=

  • http-nio-blockpoller

  • jstack

  • tomcatsproblem

  • tomcatbugs

  • tomcaterrors

Please Sign In or to post your comment or answer

Profile Image

junxin zhu

The report is the newest thread tracking,i restart the application, no problem found now,but i don't know when the problem will happen

Profile Image

Mahesh

Hi Junxin,

 

Do you have an old thread dump report or a stacktrace of thread "http-nio-BlockPoller"?

Profile Image

junxin zhu

yes,i saved it

Profile Image

junxin zhu

https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDEvMTgvLS10aHJlYWRzLnppcC0tNi01Ni0xOQ==&;

Profile Image

sainath

Hi Junxin,

 

This report also looks like the same one you attached in the question. Can you please upload the thread dump which contains "http-nio-BlockPoller" consuming 90% CPU.

Profile Image

junxin zhu

"http-nio-57253-BlockPoller" #16 daemon prio=5 os_prio=0 tid=0x00007fbdf527e800 nid=0x38394 runnable [0x00007fbdcc7ea000]
   java.lang.Thread.State: RUNNABLE
    at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
    at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
    at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
    at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
    - locked <0x00000007011afc68> (a sun.nio.ch.Util$3)
    - locked <0x00000007011afc58> (a java.util.Collections$UnmodifiableSet)
    - locked <0x00000007011afb30> (a sun.nio.ch.EPollSelectorImpl)
    at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
    at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:313)

Profile Image

sainath

Hi Junxin,

 

Are you using log4j in your application for logging?

 

If so most of your HTTP threads are blocked in log4j.

You probably have a log4j level too low (eg trace)

This leads to :

  • contention
  • memory allocations
  • bad performance

Try to set the log4j level to WARN.

This may not correct all your problems, it may help.

Profile Image

junxin zhu

ok,i will try it, thank you! :)

Profile Image

junxin zhu

i use logback for logging, and use a threadpool to output log

Profile Image

junxin zhu

Thank you,this problem maybe fixed, i use your method, and also change the jdk from 8 to 11,tomcat from 9.0.41 to 9.0.56

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • http-nio-blockpoller

  • jstack

  • tomcatsproblem

  • tomcatbugs

  • tomcaterrors