hi all I have a Java application on bare metal servers with the response time less than 5ms. I have containerized the app with alpine as base image. the response time is about 100ms which is too high compare to 5ms. I use java version 11 and also passed the -Xmx 16G to the java executable so it use 4G (1/4 of total RAM) as the max heap size but it does not use memory and cpu as much as the non containerized one. should I pass any other arguments to the java executable ?
Comment From: wilkinsona
Thanks for the report, but this sounds like an environmental problem rather than something that Spring Boot can control. Perhaps your contains is very heavily CPU constrained?
should I pass any other arguments to the java executable ?
No, there shouldn't be any need to pass any other arguments.
I'd recommend checking the resources that are available to your container vs those that are available to a bare metal deployment. If that doesn't identify the problem profiling your app in a container may help to identify where the 100ms is being spent. If you'd like some further guidance, please come and chat on Gitter or post a question on Stack Overflow.
Comment From: ehsanrocket
thank you @wilkinsona whould you tell me a java profiling app for linux terminal
Comment From: wilkinsona
There are several. A quick Google search for profiling Java on Linux led to this article which may be of interest. As I said above, if you'd like some further guidance, please come and chat on Gitter or post a question on Stack Overflow.