Java 11 with Docker slow on both direct EC2 deployment and ECS deployment

0

Hi,

I am in the process of migrating our Java and Spring boot based micro-services to newer Java (Open Jdk 11/12) from 8.

When I deployed them via ECS deployment on EC2 instance (m5.xlarge), I see significant performance degradation. For a reference, the method that took 500ms with Java 8 now takes 3 seconds (with both Java 11 and 12 runtime). As a result the entire product runs slow. I also tried directly running docker container by launching it directly on EC2 instance (to rule out ECS restriction) and issue was still present.

When I run microservices locally - outside of docker - on Mac, they are fast.
When I run microservices on Linux server - inside docker same docker image- they are fast.

I tried using following two docker base images and no improvement.
https://github.com/docker-library/openjdk/blob/25c0a52bf0c70eafc6341bdb621580f4f282e1a1/12/jdk/alpine/Dockerfile
https://github.com/docker-library/openjdk/blob/258870647c5a4281c4cc81d0d17b6fd95bcf4141/11/jre/slim/Dockerfile

I tried giving them more memories, CPU shares also ran them unrestricted by launching directly on EC2, they remain slower and no obvious sign of Java related issue in JConsole.

Any help would be appreciated and if more information is needed I can provide as I have the deployment running.

Edited by: cbarad on Jan 29, 2019 7:06 AM

cbarad
已提问 5 年前580 查看次数
1 回答
0

The issue was with Hibernate being slow to execute database queries. Looking into the cause of that.

cbarad
已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则