diff --git a/Dockerfile b/Dockerfile index e97eaad..23dd6b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,4 @@ USER appuser EXPOSE 8080 -ENTRYPOINT ["java", "-Duser.timezone=UTC", "-jar", "app.jar"] +ENTRYPOINT ["java", "-Duser.timezone=UTC", "-XX:+UseContainerSupport", "-XX:MaxRAMPercentage=60.0", "-XX:InitialRAMPercentage=60.0", "-XX:MaxMetaspaceSize=150m", "-XX:+ExitOnOutOfMemoryError", "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/app/log/heapdump.hprof", "-jar", "app.jar"] diff --git a/docker-compose.prod.yaml b/docker-compose.prod.yaml index 00718ac..ca903ee 100644 --- a/docker-compose.prod.yaml +++ b/docker-compose.prod.yaml @@ -9,6 +9,10 @@ services: - .env volumes: - /app/log:/app/log + deploy: + resources: + limits: + memory: 600m networks: - observability @@ -30,6 +34,10 @@ services: ports: - "12345:12345" # Alloy UI - "4317:4317" # OTLP gRPC + deploy: + resources: + limits: + memory: 150m networks: - observability @@ -37,6 +45,10 @@ services: image: quay.io/prometheus/node-exporter:latest container_name: node-exporter restart: unless-stopped + deploy: + resources: + limits: + memory: 30m networks: - observability diff --git a/src/main/resources/application-prod.yaml b/src/main/resources/application-prod.yaml index a2fff2a..adca318 100644 --- a/src/main/resources/application-prod.yaml +++ b/src/main/resources/application-prod.yaml @@ -1,4 +1,7 @@ spring: + datasource: + hikari: + leak-detection-threshold: 5000 jpa: properties: hibernate: diff --git a/src/main/resources/db/migration/V20260407_1__add_index_notification_history_status_deadline.sql b/src/main/resources/db/migration/V20260407_1__add_index_notification_history_status_deadline.sql new file mode 100644 index 0000000..0384714 --- /dev/null +++ b/src/main/resources/db/migration/V20260407_1__add_index_notification_history_status_deadline.sql @@ -0,0 +1,2 @@ +CREATE INDEX idx_nh_status_deadline + ON notification_history (status, deadline);