forked from mtusi2026/mtusi2026lab5
ЛР5: брокер RabbitMQ, outbox, worker, варианты изображений, отказоустойчивость, исследование очереди
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
$ python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
$ python3 tests/smoke.py (upload -> 202 queued -> ready, thumbnail 256x160)
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
# контейнеры до перезапуска:
|
||||
/mtusi-lab5-api-1 StartedAt=2026-10-02T23:58:35.341793495Z
|
||||
/mtusi-lab5-api-2 StartedAt=2026-10-02T23:58:35.523444484Z
|
||||
/mtusi-lab5-worker-1 StartedAt=2026-10-02T23:58:48.76269165Z
|
||||
/mtusi-lab5-rabbitmq-1 StartedAt=2026-10-02T23:53:22.014370477Z
|
||||
/mtusi-lab5-seaweedfs-1 StartedAt=2026-10-02T23:46:39.837097835Z
|
||||
/mtusi-lab5-postgres-1 StartedAt=2026-10-02T23:46:39.850517882Z
|
||||
/mtusi-lab5-valkey-1 StartedAt=2026-10-02T23:46:39.827928529Z
|
||||
$ python3 tests/resilience.py --mode persistence --action-script scripts/restart.sh (Windows: restart.cmd)
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
# контейнеры после перезапуска:
|
||||
/mtusi-lab5-api-1 StartedAt=2026-10-02T23:59:33.742707516Z
|
||||
/mtusi-lab5-api-2 StartedAt=2026-10-02T23:59:32.383092893Z
|
||||
/mtusi-lab5-worker-1 StartedAt=2026-10-02T23:59:28.718812327Z
|
||||
/mtusi-lab5-rabbitmq-1 StartedAt=2026-10-02T23:59:29.238592291Z
|
||||
/mtusi-lab5-seaweedfs-1 StartedAt=2026-10-02T23:59:29.413843719Z
|
||||
/mtusi-lab5-postgres-1 StartedAt=2026-10-02T23:59:28.458564542Z
|
||||
/mtusi-lab5-valkey-1 StartedAt=2026-10-02T23:59:29.099168068Z
|
||||
$ python3 tests/resilience.py --mode failover --action-script scripts/stop-one.sh (1-я реплика)
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 113, "failed_attempts": 0, "first_recovery_seconds": 2.328}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
(2-я реплика)
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 108, "failed_attempts": 0, "first_recovery_seconds": 2.328}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
$ python -m unittest test_api.py
|
||||
Ran 12 tests in 2.390s
|
||||
OK
|
||||
$ python -m unittest test_idempotency.py
|
||||
Ran 9 tests in 1.971s
|
||||
OK
|
||||
$ python -m unittest test_attachments.py
|
||||
Ran 11 tests in 5.686s
|
||||
OK
|
||||
$ python student-tests/test_pipeline.py (интерпретатор с Pillow: пиксельные проверки alpha -> белый фон)
|
||||
Ran 9 tests in 10.648s
|
||||
OK
|
||||
$ python student-tests/test_topology.py
|
||||
Ran 6 tests in 1.514s
|
||||
OK
|
||||
$ python student-tests/test_resilience5.py (окна отказа: worker/брокер/outbox/lease/retry/replay)
|
||||
Ran 7 tests in 139.354s
|
||||
OK
|
||||
@@ -0,0 +1,254 @@
|
||||
{
|
||||
"date": "2026-10-03 02:55:33",
|
||||
"args": {
|
||||
"out": "evidence",
|
||||
"concurrency": [
|
||||
1,
|
||||
2,
|
||||
4
|
||||
],
|
||||
"n_small": 80,
|
||||
"n_medium": 24,
|
||||
"n_large": 12,
|
||||
"limit": 30,
|
||||
"burst": 200,
|
||||
"b_medium": false
|
||||
},
|
||||
"worker_limits": {
|
||||
"cpus": 1.0,
|
||||
"memory": "768m"
|
||||
},
|
||||
"image_kib": {
|
||||
"small": 109,
|
||||
"medium": 1961,
|
||||
"large": 3100
|
||||
},
|
||||
"matrix": [
|
||||
{
|
||||
"concurrency": 1,
|
||||
"image": "small",
|
||||
"image_kib": 109,
|
||||
"uploads": 80,
|
||||
"accepted": 80,
|
||||
"accepted_in_s": 0.3,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 66,
|
||||
"peak_oldest_age_s": 2.2,
|
||||
"worker_peak_rss_mib": 74.7,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 80,
|
||||
"failed": 0,
|
||||
"p50_s": 1.33,
|
||||
"p95_s": 2.46,
|
||||
"max_s": 2.55,
|
||||
"throughput_per_s": 28.9,
|
||||
"span_s": 2.8
|
||||
},
|
||||
{
|
||||
"concurrency": 1,
|
||||
"image": "medium",
|
||||
"image_kib": 1961,
|
||||
"uploads": 24,
|
||||
"accepted": 24,
|
||||
"accepted_in_s": 0.5,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 22,
|
||||
"peak_oldest_age_s": 4.8,
|
||||
"worker_peak_rss_mib": 135.6,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 24,
|
||||
"failed": 0,
|
||||
"p50_s": 2.9,
|
||||
"p95_s": 5.05,
|
||||
"max_s": 5.29,
|
||||
"throughput_per_s": 4.21,
|
||||
"span_s": 5.7
|
||||
},
|
||||
{
|
||||
"concurrency": 1,
|
||||
"image": "large",
|
||||
"image_kib": 3100,
|
||||
"uploads": 12,
|
||||
"accepted": 12,
|
||||
"accepted_in_s": 0.4,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 11,
|
||||
"peak_oldest_age_s": 3.3,
|
||||
"worker_peak_rss_mib": 161.2,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 12,
|
||||
"failed": 0,
|
||||
"p50_s": 2.03,
|
||||
"p95_s": 3.37,
|
||||
"max_s": 3.37,
|
||||
"throughput_per_s": 3.34,
|
||||
"span_s": 3.6
|
||||
},
|
||||
{
|
||||
"concurrency": 2,
|
||||
"image": "small",
|
||||
"image_kib": 109,
|
||||
"uploads": 80,
|
||||
"accepted": 80,
|
||||
"accepted_in_s": 0.2,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 53,
|
||||
"peak_oldest_age_s": 1.2,
|
||||
"worker_peak_rss_mib": 76.3,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 80,
|
||||
"failed": 0,
|
||||
"p50_s": 0.86,
|
||||
"p95_s": 1.6,
|
||||
"max_s": 1.64,
|
||||
"throughput_per_s": 43.67,
|
||||
"span_s": 1.8
|
||||
},
|
||||
{
|
||||
"concurrency": 2,
|
||||
"image": "medium",
|
||||
"image_kib": 1961,
|
||||
"uploads": 24,
|
||||
"accepted": 24,
|
||||
"accepted_in_s": 0.5,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 22,
|
||||
"peak_oldest_age_s": 4.2,
|
||||
"worker_peak_rss_mib": 194.1,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 24,
|
||||
"failed": 0,
|
||||
"p50_s": 2.8,
|
||||
"p95_s": 4.69,
|
||||
"max_s": 4.7,
|
||||
"throughput_per_s": 4.71,
|
||||
"span_s": 5.1
|
||||
},
|
||||
{
|
||||
"concurrency": 2,
|
||||
"image": "large",
|
||||
"image_kib": 3100,
|
||||
"uploads": 12,
|
||||
"accepted": 12,
|
||||
"accepted_in_s": 0.4,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 12,
|
||||
"peak_oldest_age_s": 2.7,
|
||||
"worker_peak_rss_mib": 253.8,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 12,
|
||||
"failed": 0,
|
||||
"p50_s": 2.03,
|
||||
"p95_s": 2.96,
|
||||
"max_s": 2.96,
|
||||
"throughput_per_s": 3.77,
|
||||
"span_s": 3.2
|
||||
},
|
||||
{
|
||||
"concurrency": 4,
|
||||
"image": "small",
|
||||
"image_kib": 109,
|
||||
"uploads": 80,
|
||||
"accepted": 80,
|
||||
"accepted_in_s": 0.3,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 52,
|
||||
"peak_oldest_age_s": 1.1,
|
||||
"worker_peak_rss_mib": 80.3,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 80,
|
||||
"failed": 0,
|
||||
"p50_s": 0.77,
|
||||
"p95_s": 1.26,
|
||||
"max_s": 1.3,
|
||||
"throughput_per_s": 51.79,
|
||||
"span_s": 1.5
|
||||
},
|
||||
{
|
||||
"concurrency": 4,
|
||||
"image": "medium",
|
||||
"image_kib": 1961,
|
||||
"uploads": 24,
|
||||
"accepted": 24,
|
||||
"accepted_in_s": 0.8,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 24,
|
||||
"peak_oldest_age_s": 4.9,
|
||||
"worker_peak_rss_mib": 321.7,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 24,
|
||||
"failed": 0,
|
||||
"p50_s": 3.81,
|
||||
"p95_s": 5.4,
|
||||
"max_s": 5.4,
|
||||
"throughput_per_s": 3.97,
|
||||
"span_s": 6.1
|
||||
},
|
||||
{
|
||||
"concurrency": 4,
|
||||
"image": "large",
|
||||
"image_kib": 3100,
|
||||
"uploads": 12,
|
||||
"accepted": 12,
|
||||
"accepted_in_s": 0.4,
|
||||
"all_finished": true,
|
||||
"peak_queue_depth": 12,
|
||||
"peak_oldest_age_s": 2.7,
|
||||
"worker_peak_rss_mib": 430.2,
|
||||
"worker_oom_killed": "false",
|
||||
"ready": 12,
|
||||
"failed": 0,
|
||||
"p50_s": 2.11,
|
||||
"p95_s": 3.12,
|
||||
"max_s": 3.12,
|
||||
"throughput_per_s": 3.6,
|
||||
"span_s": 3.3
|
||||
}
|
||||
],
|
||||
"backpressure": {
|
||||
"MAX_QUEUED_JOBS": 30,
|
||||
"burst": 200,
|
||||
"attempt_statuses": {
|
||||
"202": 57,
|
||||
"503": 143
|
||||
},
|
||||
"accepted": 57,
|
||||
"peak_queue_depth": 48,
|
||||
"all_accepted_finished": true,
|
||||
"accepted_in_s": 0.5,
|
||||
"drained_after_s": 2.6,
|
||||
"retry_after_header_seen": true,
|
||||
"recovered_new_uploads_accepted": true,
|
||||
"no_accepted_job_lost": true,
|
||||
"ready": 57,
|
||||
"failed": 0,
|
||||
"p95_s": 1.89
|
||||
},
|
||||
"backpressure_queue_samples": [
|
||||
[
|
||||
0.2,
|
||||
0,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
0.7,
|
||||
48,
|
||||
0.5
|
||||
],
|
||||
[
|
||||
1.3,
|
||||
31,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.9,
|
||||
16,
|
||||
1.6
|
||||
],
|
||||
[
|
||||
2.4,
|
||||
0,
|
||||
0.0
|
||||
]
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
Reference in New Issue
Block a user