Category: Performance Optimization
1. Prerequisite Java application with docker based on JDK 8 and alpine. This app is a Jhipster application. Dockerfile:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
FROM openjdk:8-jre-alpine ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ JHIPSTER_SLEEP=0 \ JAVA_OPTS="" # Add a jhipster user to run our application so that it doesn't need to run as root RUN adduser -D -s /bin/sh jhipster WORKDIR /home/jhipster ADD entrypoint.sh entrypoint.sh RUN chmod 755 entrypoint.sh && chown jhipster:jhipster entrypoint.sh USER jhipster ENTRYPOINT ["./entrypoint.sh"] EXPOSE 18082 5701/udp ADD *.jar app.jar |
entrypoint.sh
|
#!/bin/sh echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=5005,suspend=n -jar "${HOME}/app.jar" "$@" |
2. Precheck Enter container to check the process. Of course, we...
The customer reported today that one of our services stopped working, the new coming data can not be saved into the database. After checking the logs, there are a lot of “Hazelcast instance is...
1. Introduction Sometimes we need to run multiple web applications with the corresponding virtual hosts in one Tomcat server. Actually, this is not simple to config and there is more than one solution. For example,...
When I help developers or architects analyze and optimize the performance of their Java application it is not about tweaking individual methods to squeeze out another millisecond or two in execution time. While for...