Reputation: 1169
I have a Spring
application that has been recently moved from test to production environment. CPU usage is %2-3 most of the time. But sometimes (1 or 2 times per day) it suddenly peaks up to %400 (there are 4 cpus) and then my app crashes. I could not observe any kind of anomalies (e.g. extra traffic) when the problem occurred.
Some information about my app is,
ScheduledTask
s in one of the Service
s. They make some HttpUrlConnection
s.-d64 -Xms6g -Xmx10g -XX:MaxPermSize=512m
sysstat
for logging. I am watching the cpu and ram usage not only for the whole system but also for my app only. I would like to note also that ram usage peaks up to max %60.2017-10-09 06:26:19.393 ERROR 5986 --- [ XNIO-2 task-1] t.o.m.w.rest.errors.ExceptionTranslator : An unexpected error occurred: I/O error while reading input message; nested exception is java.io.InterruptedIOException: XNIO000808: I/O operation was interrupted
2017-10-09 06:26:19.396 ERROR 5986 --- [ XNIO-2 task-25] io.undertow.request : UT005022: Exception generating error page /error
I could not find the reason of the problem. Are there any suggestions? Any kind of help is appreciated.
Upvotes: 3
Views: 2522
Reputation: 1169
As the invaluable comments indicate, this problem does not originate from garbage collection. The reason is something totally different. It took about a week to figure it out, so I am writing it to here in case some other people face with the same problem.
First of all, I did not include in the question (since I did not consider it as important) that I used JHipster, which recently switched to Undertow
as the application server.
After digging into the details, I observed that the threads that consume the CPU are XNIO
threads. I have seen on a few sites that some people using application servers powered by XNIO
also suffer from the same problem. Since Undertow
uses XNIO
, I changed from Undertow
to Tomcat
, and the problem is resolved.
Upvotes: 4