-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
High CPU on Jetty Websocket thread #4537
Comments
@jbfru45 there is not quite enough information to know whats happening. Could you get multiple jstack traces to help figure out what the thread is doing? |
I ran jstack a dozen times and it was always in the method above, so it seems like it was stuck looping in that method. I will grab debug jetty logs the next time it happens which seems to be about once a week for us. |
We had this reproduce in production again this morning. I grabbed multiple jstacks and every one was the same as above. I turned logs for the AbstractWebSocketConnection class to DEBUG for a couple minutes, and it traced these 2 messages several million times on the thread that was spinning:
The discarded buffer is the exact same in every message. If you still need other logs at debug, please let me know exactly which packages/classes you need as I cannot turn all logging to debug in production. We found that was too much load in our scale test environment. |
@jbfru45 Thanks for the extra info, I understand what is happening now. |
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Issue #4537 - fix potential spin when discarding in WebSocketConnection
We are still seeing the high CPU issue with 9.4.27, Hundred's of Jetty (winstone) threads are filing up not getting closed with the method sun.nio.ch.FileDispatcherImpl.preClose0(Native Method) Jetty (winstone)-66537 |
When normal state we are seeing below for winstone thread Jetty (winstone)-14 |
@satyagv557 this stacktrace has nothing to do with websocket, I would suggest opening a new issue if you are having a problem. |
Opened #4717, let me know any information needed. |
Jetty version
9.4.25.v20191220
Java version
OpenJDK 11.0.3
OS type/version
Amazon Linux 2
Description
One of our Spring websocket servers in production reported 100% CPU usage (one core on a 4 core machine). The instance had been running for several days. The CPU spike occurred instantly and remained until the instance was terminated.
top -H
output showed a jetty server thread using 100% CPU. Here is the jstack output for that thread:Please let me know if you need any more information.
The text was updated successfully, but these errors were encountered: