Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Trying to make sense of slow server response times

I made progress with this. The problem seems to be the CPU scaling governor. For certain Kernel versions (I used 5.10.0 as provided by the Debian 11 distribution) the CPU frequency stays low and thus the array summation becomes slow. For AMD processors there were three different cases (governor=performance/ondemand/schedutil) with schedutil being the default. They exactly correspond to the three different benchmark result cases I was observing. Using the ondemand governor I see a constant overhead added to the expected array summation time and for the schedutil governor the overhead is even proportional to the array size, causing a x2 slow down. The issue goes away when I use the performance governor.

My current hypothesis is this: If you are using an AMD processor (like an AMD Ryzen 7 3700X in my case) and a certain Kernel version (like the one provided by Debian 11, 5.10) your CPU heavy server task might be running x2 slower than when you execute the same task standalone (without Jetty). At least this is exactly what happened in our case. The benchmark I provided demonstrates this. I also reproduced the issue without the benchmark by simply starting a Jetty server and running frequent requests against an endpoint that does some CPU heavy computation. I was even able to control the response time by switching between the different scaling governors in another terminal.

So I don't think this is a Jetty issue, but it is somehow only triggered when I use Jetty. It likely affects other Jetty users as well. I still don't know why this happens and happens only in the context of the Jetty server. Maybe it is because in the server context the requests are handled by different cores and therefore the scaling governor is not triggered to scale up the frequency for any of the cores, while without the server all computation is handled by the same core and thus the frequency is scaled up by the governor in this case.

Back to the top