Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Startup performance for JVM based apps #63

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packs/gradle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ ENV PORT 8080
EXPOSE 8080
COPY build/libs/*.jar /opt/app.jar
WORKDIR /opt
CMD ["java", "-jar", "app.jar"]
ENTRYPOINT exec java -Xms256m -Xmx256m -XX:MaxMetaspaceSize=128m $JAVA_OPTS -jar app.jar
Copy link
Contributor Author

@paolocarta paolocarta Aug 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 8 is not docker aware, therefore this is a workaround in order to limit heap expansion.

From my local tests I can see that a simple demo spring boot app requires around 150-200 MB of Heap.

6 changes: 3 additions & 3 deletions packs/gradle/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ service:
fabric8.io/ingress.annotations: "kubernetes.io/ingress.class: nginx"
resources:
limits:
cpu: 500m
memory: 512Mi
cpu: 1800m
memory: 768Mi
requests:
cpu: 400m
cpu: 600m
memory: 512Mi
probePath: /actuator/health
livenessProbe:
Expand Down
3 changes: 2 additions & 1 deletion packs/maven/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ COPY pom.xml target/lib* /opt/lib/
# we could do with a better way to know the name - or to always create an app.jar or something
COPY target/*.jar /opt/app.jar
WORKDIR /opt
CMD ["java", "-jar", "app.jar"]

ENTRYPOINT exec java -Xms256m -Xmx256m -XX:MaxMetaspaceSize=128m $JAVA_OPTS -jar app.jar
6 changes: 3 additions & 3 deletions packs/maven/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ service:
fabric8.io/ingress.annotations: "kubernetes.io/ingress.class: nginx"
resources:
limits:
cpu: 500m
memory: 512Mi
cpu: 1800m
memory: 768Mi
requests:
cpu: 400m
cpu: 600m
memory: 512Mi
probePath: /actuator/health
livenessProbe:
Expand Down