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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ