diff --git a/Dockerfile b/Dockerfile index f2c0bb79009e20056d7eb0288b218d8447e200c0..90887863679c34b52f28c6742dede7e182180e33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN mkdir -p /data/logs/gc ENV EXT_JVM_OPTS="${JAVA_OPTS}" -ENV JVM_OPTS="-XX:MaxRAMPercentage=70 -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m\ +ENV JVM_OPTS="-XX:+AlwaysPreTouch -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70 -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m\ -XX:+UseG1GC -XX:G1HeapRegionSize=2m -Xlog:gc*:/data/logs/gc/gc-%t.log:time,uptime\ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/heapdump/heapdump.hprof -XX:OnOutOfMemoryError=/app/dump-file-rollover.sh\ -XX:-OmitStackTraceInFastThrow -XX:+PrintCommandLineFlags" diff --git a/k8s-deploy-template.yaml b/k8s-deploy-template.yaml index 958bccb8cfe6441ffaefe3754caf862253067a25..2228e3f8db437747989691faeee0c524fe24a428 100644 --- a/k8s-deploy-template.yaml +++ b/k8s-deploy-template.yaml @@ -27,7 +27,7 @@ spec: terminationGracePeriodSeconds: 30 initContainers: - name: ${APP_NAME}-init - image: busybox + image: registry-vpc.cn-hangzhou.aliyuncs.com/acs/busybox command: [ 'mkdir', '-p', '/data/logs/gc', '/data/heapdump' ] volumeMounts: - name: ${APP_NAME}-volume @@ -55,7 +55,8 @@ spec: scheme: HTTP path: /actuator/health port: 1024 - failureThreshold: 6 + initialDelaySeconds: 20 + failureThreshold: 4 periodSeconds: 10 livenessProbe: httpGet: