Skip to content

Commit

Permalink
compose: reduce startup delays due to healthcheck
Browse files Browse the repository at this point in the history
Use a 30s start_period for nfd and mongodb. During the start period,
health checks are run every 5s (the default start_interval) which
provides faster reaction to restarts.

With this improved mechanism, we can also increase the regular health
check interval for nfd to 1 minute to further reduce the overhead.
  • Loading branch information
Pesa authored and pulsejet committed Nov 11, 2024
1 parent c10131d commit 749ef24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ services:
restart: unless-stopped
healthcheck:
test: [CMD, nfdc, status]
interval: 30s
interval: 1m
start_period: 30s
depends_on:
master: { condition: service_healthy }
logging:
Expand Down Expand Up @@ -130,7 +131,7 @@ services:
restart: unless-stopped
healthcheck:
test: echo 'db.runCommand("ping").ok' | ${MONGO_SH:-mongosh} --quiet
interval: 5s
start_period: 30s
logging:
driver: local
ports:
Expand Down

0 comments on commit 749ef24

Please sign in to comment.