RabbitMQ + transactional outbox, отдельный worker (thumbnail/crop/WebP), lease и heartbeat, retry с backoff+jitter, DLQ и replay, admission control; тесты отказов, трек 1 и отчёт.
24 lines
964 B
Bash
Executable File
24 lines
964 B
Bash
Executable File
#!/bin/sh
|
|
# Track 1 matrix: 3 sizes x 4 worker settings x REPEATS, then the overload/recovery scenario.
|
|
# One worker replica with a 2-CPU limit; offered rates are fixed per size (open loop, 30 s each).
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
REPEATS="${REPEATS:-2}"
|
|
for rep in $(seq 1 "$REPEATS"); do
|
|
for spec in "small 10" "medium 5" "large 3"; do
|
|
set -- $spec
|
|
for cp in "1 1" "2 2" "4 4" "2 16"; do
|
|
c=${cp% *}; p=${cp#* }
|
|
python3 student-tests/queue_load.py run --size "$1" --rate "$2" --duration 30 \
|
|
--concurrency "$c" --prefetch "$p" --label "c$c-p$p-r$rep" | tail -1
|
|
done
|
|
done
|
|
done
|
|
for rep in $(seq 1 "$REPEATS"); do
|
|
python3 student-tests/queue_load.py overload --max-pending 30 --size large --rate 8 --duration 30 \
|
|
--concurrency 2 --prefetch 2 --label "overload-r$rep" | tail -1
|
|
done
|
|
# back to the default topology
|
|
WORKER_REPLICAS=2 docker compose --env-file .env up -d --no-deps --wait worker >/dev/null
|
|
echo MATRIX_DONE
|