forked from mtusi2026/mtusi2026lab3
48 lines
2.1 KiB
Plaintext
48 lines
2.1 KiB
Plaintext
$ api replicas before
|
|
messenger-lab3_api_2 hostname=5a9ffe83734a Up About a minute (healthy)
|
|
messenger-lab3_api_1 hostname=ab01920585fe Up About a minute (healthy)
|
|
|
|
$ python3 tests/load.py --duration 30 --concurrency 4 --output evidence/failover-load-1.json & (background load during the test)
|
|
$ podman stats --no-stream (during load, before failure)
|
|
messenger-lab3_api_1 cpu=3.87% mem=88.06MB / 268.4MB
|
|
messenger-lab3_api_2 cpu=4.17% mem=92.08MB / 268.4MB
|
|
messenger-lab3_lb_1 cpu=2.81% mem=28.44MB / 67.11MB
|
|
messenger-lab3_postgres_1 cpu=12.21% mem=135.6MB / 536.9MB
|
|
messenger-lab3_redis_1 cpu=0.58% mem=6.857MB / 134.2MB
|
|
|
|
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
|
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
{"observed_instances_before": 2, "successful_writes": 131, "failed_attempts": 0, "first_recovery_seconds": 3.339}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
exit=0
|
|
|
|
$ podman stats --no-stream (during load, one replica stopped)
|
|
messenger-lab3_api_2 cpu=5.01% mem=27.76MB / 268.4MB
|
|
messenger-lab3_lb_1 cpu=3.77% mem=29.78MB / 67.11MB
|
|
messenger-lab3_postgres_1 cpu=12.32% mem=133.1MB / 536.9MB
|
|
messenger-lab3_redis_1 cpu=0.59% mem=7.111MB / 134.2MB
|
|
|
|
$ background tests/load.py result
|
|
{
|
|
"lab": 3,
|
|
"workload": "closed-loop POST messages; no automatic retries",
|
|
"requested_duration_seconds": 30.0,
|
|
"elapsed_seconds": 30.008,
|
|
"concurrency": 4,
|
|
"successful_requests": 8712,
|
|
"failed_requests": 0,
|
|
"error_ratio": 0.0,
|
|
"successful_rps": 290.322,
|
|
"successful_latency_ms": {
|
|
"p50": 13.117,
|
|
"p95": 17.627,
|
|
"p99": 23.947
|
|
},
|
|
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
|
}
|
|
|
|
$ api replicas after (stopped one = TARGET_INSTANCE_ID)
|
|
messenger-lab3_api_2 hostname=5a9ffe83734a Up 2 minutes (healthy)
|
|
messenger-lab3_api_1 hostname=ab01920585fe Exited (0) 22 seconds ago (healthy)
|