Skip to content

Commit e5ccd02

Browse files
authored
chore: Optimize dev-chain-fast healthcheck (#241)
There was very long interval for the healthcheck of `dev-chain-fast`. That's why the startup of `streamr-docker-dev` chain services was usually very slow. Reduced the interval significantly. Also improved `--wait` arg to log warnings sooner, and reduced the poll interval so that we can exit polling sooner. ## Statistics Before this PR typical chain service startup took about 90s, now it takes about 24s. ``` streamr-docker-dev wipe time streamr-docker-dev start dev-chain-fast deploy-network-subgraphs-fastchain --wait ```
1 parent ce94163 commit e5ccd02

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docker-compose.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ services:
223223
restart: unless-stopped
224224
healthcheck:
225225
test: ["CMD", "curl", "--fail", "--silent", "--show-error", "--max-time", "9", "--header", "Content-Type: application/json", "--data", '[{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1},{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}]', "http://localhost:8545/api/health"]
226-
interval: 1m30s
227-
timeout: 10s
228-
retries: 3
226+
interval: 10s
227+
timeout: 1s
228+
retries: 10
229229
graph-node-fastchain:
230230
container_name: streamr-dev-thegraph-node-fastchain
231231
image: graphprotocol/graph-node:v0.32.0

streamr-docker-dev/bin.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ wait() {
173173
done
174174

175175
if [ ${#waiting_for_services[@]} -gt 0 ]; then
176-
if (( time_waited >= 60 )); then
176+
if (( time_waited >= 30 )); then
177177
echo "***********************************"
178178
echo "Still waiting for the following services:"
179179
for s in "${waiting_for_services[@]}"; do echo "$s"; done
180180
fi
181-
sleep 5
182-
time_waited=$((time_waited+5))
181+
sleep 1s
182+
time_waited=$((time_waited+1))
183183
else
184184
echo "All services up and running."
185185
break

0 commit comments

Comments
 (0)