Server getting slow after X hours


They are terrible days to figure out the issue. I could not.

My API needs to received many requests with low latency. About 300K requests/day. After received > 5K requests, my server is getting slow. After 2 or 3 hours, my server cannot receive any request. All are showing pending.

My Server 2GB/2CP ubuntu 14.

I do check CPU and RAM - they show < 30%. My API is on spring mvc, my server is jetty (using jetty - maven plugin)

Some configs before starting server: export MAVEN_OPTS=“-Xmx2048m -Xms1024m” mvn -DhttpPort=80 jetty:run



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Sounds like you’ve got a bit of a mystery. Normally my first guess would be that there is a memory leak somewhere and over time your memory use is increasing but you’ve mentioned that this doesn’t seem to be the case. Are you running any type of http server like apache in front of jetty? I have seen issues with the KeepAlive setting and KeepAliveTimeout in apache causing a wait time on connection while the service waits for an available thread. That can usually be resolved by disabling KeepAlive.

It’s been a while since you initially posted this (sorry for not getting back to you sooner), were you able to find the source of the problem?