выполнение lab3, track-1

This commit is contained in:
R0flyan
2026-10-23 16:16:50 +03:00
parent 0ab3a341aa
commit f5d79d1886
64 changed files with 35863 additions and 58 deletions
+34
View File
@@ -0,0 +1,34 @@
{
"protected_files_unchanged": 9,
"required_checks_passed": [
"check",
"failures",
"final-containers",
"final-own",
"final-smoke",
"research",
"test",
"test-failover",
"test-own",
"test-persistence",
"test-race",
"validate"
],
"research_runs": 45,
"api_replicas": 2,
"database": {
"users": 73,
"chats": 57,
"messages": 572124,
"idempotency_keys": 572124,
"database_bytes": 370461843,
"fsync": "on",
"synchronous_commit": "on",
"full_page_writes": "on"
},
"pool_tuning_rps": {
"1": 618.7677762820396,
"8": 739.8691144738191
},
"improvement_percent": 19.57
}
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+1
View File
@@ -0,0 +1 @@
29.3.0 12 CPU 3956072448 bytes
+102
View File
@@ -0,0 +1,102 @@
[
{
"scenario": "stop adaa005d3240",
"before": [
{
"instance": "adaa005d3240",
"id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"
},
{
"instance": "50e63551289c",
"id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"
}
],
"after": [
{
"instance": "50e63551289c",
"id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"
}
],
"successful_read_write_cycles": 8,
"failed_cycles": 0,
"elapsed_seconds": 8.429,
"successful_cycles_per_second": 0.949,
"confirmed_pair_http_rps": 1.898,
"first_success_after_action_seconds": 2.087,
"max_success_gap_seconds": 4.069,
"cycle_latency_ms": {
"p50": 4055.938200000128,
"p95": 4072.180400000434
},
"all_confirmations_preserved": true,
"duplicate_messages": 0
},
{
"scenario": "stop 50e63551289c",
"before": [
{
"instance": "adaa005d3240",
"id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"
},
{
"instance": "50e63551289c",
"id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"
}
],
"after": [
{
"instance": "adaa005d3240",
"id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"
}
],
"successful_read_write_cycles": 8,
"failed_cycles": 0,
"elapsed_seconds": 8.358,
"successful_cycles_per_second": 0.957,
"confirmed_pair_http_rps": 1.914,
"first_success_after_action_seconds": 2.043,
"max_success_gap_seconds": 4.053,
"cycle_latency_ms": {
"p50": 4039.179299999887,
"p95": 4047.002899999825
},
"all_confirmations_preserved": true,
"duplicate_messages": 0
},
{
"scenario": "rolling",
"before": [
{
"instance": "adaa005d3240",
"id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"
},
{
"instance": "50e63551289c",
"id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"
}
],
"after": [
{
"instance": "780258ad77d3",
"id": "780258ad77d30bcdcd1ad1a79f241e11a14fe32092d2480fbd953ef2fe60ffe0"
},
{
"instance": "da902e057868",
"id": "da902e0578680ca8714c702d7c5d6e1f2105826248e5fc00011e0fe9db0a9cd2"
}
],
"successful_read_write_cycles": 15,
"failed_cycles": 1,
"elapsed_seconds": 16.549,
"successful_cycles_per_second": 0.906,
"confirmed_pair_http_rps": 1.813,
"first_success_after_action_seconds": 10.202,
"max_success_gap_seconds": 4.063,
"cycle_latency_ms": {
"p50": 4034.967499999766,
"p95": 4060.810599999968
},
"all_confirmations_preserved": true,
"duplicate_messages": 0
}
]
+74
View File
@@ -0,0 +1,74 @@
Flag --time has been deprecated, use --timeout instead
adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a
{"scenario": "stop adaa005d3240", "before": [{"instance": "adaa005d3240", "id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"}, {"instance": "50e63551289c", "id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"}], "after": [{"instance": "50e63551289c", "id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"}], "successful_read_write_cycles": 8, "failed_cycles": 0, "elapsed_seconds": 8.429, "successful_cycles_per_second": 0.949, "confirmed_pair_http_rps": 1.898, "first_success_after_action_seconds": 2.087, "max_success_gap_seconds": 4.069, "cycle_latency_ms": {"p50": 4055.938200000128, "p95": 4072.180400000434}, "all_confirmations_preserved": true, "duplicate_messages": 0}
Container mtusi-lab3-db-1 Waiting
Container mtusi-lab3-db-1 Healthy
Container mtusi-lab3-migrate-1 Starting
Container mtusi-lab3-migrate-1 Started
Container mtusi-lab3-valkey-1 Waiting
Container mtusi-lab3-migrate-1 Waiting
Container mtusi-lab3-db-1 Waiting
Container mtusi-lab3-migrate-1 Exited
Container mtusi-lab3-valkey-1 Healthy
Container mtusi-lab3-db-1 Healthy
Container mtusi-lab3-api-1 Starting
Container mtusi-lab3-api-1 Started
Flag --time has been deprecated, use --timeout instead
50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821
{"scenario": "stop 50e63551289c", "before": [{"instance": "adaa005d3240", "id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"}, {"instance": "50e63551289c", "id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"}], "after": [{"instance": "adaa005d3240", "id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"}], "successful_read_write_cycles": 8, "failed_cycles": 0, "elapsed_seconds": 8.358, "successful_cycles_per_second": 0.957, "confirmed_pair_http_rps": 1.914, "first_success_after_action_seconds": 2.043, "max_success_gap_seconds": 4.053, "cycle_latency_ms": {"p50": 4039.179299999887, "p95": 4047.002899999825}, "all_confirmations_preserved": true, "duplicate_messages": 0}
Container mtusi-lab3-db-1 Waiting
Container mtusi-lab3-db-1 Healthy
Container mtusi-lab3-migrate-1 Starting
Container mtusi-lab3-migrate-1 Started
Container mtusi-lab3-migrate-1 Waiting
Container mtusi-lab3-db-1 Waiting
Container mtusi-lab3-valkey-1 Waiting
Container mtusi-lab3-migrate-1 Exited
Container mtusi-lab3-db-1 Healthy
Container mtusi-lab3-valkey-1 Healthy
Container mtusi-lab3-api-2 Starting
Container mtusi-lab3-api-2 Started
Container mtusi-lab3-api-1 Running
Container mtusi-lab3-api-2 Running
Container mtusi-lab3-api-3 Creating
Container mtusi-lab3-api-3 Created
Container mtusi-lab3-api-3 Starting
Container mtusi-lab3-api-3 Started
Flag --time has been deprecated, use --timeout instead
adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a
adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a
Container mtusi-lab3-api-2 Running
Container mtusi-lab3-api-3 Running
Container mtusi-lab3-api-4 Creating
Container mtusi-lab3-api-4 Created
Container mtusi-lab3-api-4 Starting
Container mtusi-lab3-api-4 Started
Flag --time has been deprecated, use --timeout instead
50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821
50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821
{
"before": [
{
"instance": "adaa005d3240",
"id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"
},
{
"instance": "50e63551289c",
"id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"
}
],
"after": [
{
"instance": "780258ad77d3",
"id": "780258ad77d30bcdcd1ad1a79f241e11a14fe32092d2480fbd953ef2fe60ffe0"
},
{
"instance": "da902e057868",
"id": "da902e0578680ca8714c702d7c5d6e1f2105826248e5fc00011e0fe9db0a9cd2"
}
]
}
{"scenario": "rolling", "before": [{"instance": "adaa005d3240", "id": "adaa005d3240ce595adb462d5ed9d35a2c84b819c91d0536543b033c1700728a"}, {"instance": "50e63551289c", "id": "50e63551289cec0181ab78471bb7c852f17522a370a99f4ff804b34a7db19821"}], "after": [{"instance": "780258ad77d3", "id": "780258ad77d30bcdcd1ad1a79f241e11a14fe32092d2480fbd953ef2fe60ffe0"}, {"instance": "da902e057868", "id": "da902e0578680ca8714c702d7c5d6e1f2105826248e5fc00011e0fe9db0a9cd2"}], "successful_read_write_cycles": 15, "failed_cycles": 1, "elapsed_seconds": 16.549, "successful_cycles_per_second": 0.906, "confirmed_pair_http_rps": 1.813, "first_success_after_action_seconds": 10.202, "max_success_gap_seconds": 4.063, "cycle_latency_ms": {"p50": 4034.967499999766, "p95": 4060.810599999968}, "all_confirmations_preserved": true, "duplicate_messages": 0}
Container mtusi-lab3-api-3 Running
Container mtusi-lab3-api-4 Running
PASS: each replica stopped, real containers verified, rolling replacement preserved sessions/data
+17
View File
@@ -0,0 +1,17 @@
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi-lab3-api-8 mtusi-messenger:lab3 "/messenger" api 8 seconds ago Up 5 seconds (healthy) 8080/tcp
mtusi-lab3-api-9 mtusi-messenger:lab3 "/messenger" api 8 seconds ago Up 6 seconds (healthy) 8080/tcp
mtusi-lab3-db-1 postgres:17.6-bookworm@sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3 "docker-entrypoint.s…" db 24 minutes ago Up 22 minutes (healthy) 5432/tcp
mtusi-lab3-lb-1 haproxy:3.2.6-alpine "docker-entrypoint.s…" lb 24 minutes ago Up 22 minutes (healthy) 127.0.0.1:8080->8080/tcp
mtusi-lab3-migrate-1 mtusi-messenger:lab3 "/messenger migrate" migrate 24 minutes ago Exited (0) 21 minutes ago
mtusi-lab3-valkey-1 valkey/valkey:8.1.3-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571 "docker-entrypoint.s…" valkey 24 minutes ago Up 22 minutes (healthy) 6379/tcp
[
{
"instance": "3fed3866f477",
"id": "3fed3866f4775c4d0475ef770a59b70fcfe95949f80f2f121a746bc45758c982"
},
{
"instance": "7f5ddf72d9b1",
"id": "7f5ddf72d9b1da7b79b165414d42b2e203bab61751631a7d96528bbbf9b4ff7e"
}
]
+2
View File
@@ -0,0 +1,2 @@
{"concurrent_requests": 16, "instances": ["3fed3866f477", "7f5ddf72d9b1"], "identical_result": true, "key_scopes": "user + POST + chat path", "revocation_rechecked": true}
PASS: concurrent replay, Unicode, conflict, key validation, isolation and logout
+1
View File
@@ -0,0 +1 @@
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
+96
View File
@@ -0,0 +1,96 @@
{
"timestamp_utc": "2026-10-23T12:36:44.857341+00:00",
"containers": [
{
"id": "3fed3866f4775c4d0475ef770a59b70fcfe95949f80f2f121a746bc45758c982",
"name": "/mtusi-lab3-api-8",
"instance": "3fed3866f477",
"state": "running",
"started_at": "2026-10-23T12:36:38.213957105Z",
"nano_cpus": 1000000000,
"memory_bytes": 536870912,
"ports": {
"8080/tcp": null
},
"image": "mtusi-messenger:lab3"
},
{
"id": "7f5ddf72d9b1da7b79b165414d42b2e203bab61751631a7d96528bbbf9b4ff7e",
"name": "/mtusi-lab3-api-9",
"instance": "7f5ddf72d9b1",
"state": "running",
"started_at": "2026-10-23T12:36:38.034140943Z",
"nano_cpus": 1000000000,
"memory_bytes": 536870912,
"ports": {
"8080/tcp": null
},
"image": "mtusi-messenger:lab3"
},
{
"id": "16f66e71d6f11ec87802055d002ffdc955cb7e45a4d49d65cbb855d5b9a05ff1",
"name": "/mtusi-lab3-db-1",
"instance": "16f66e71d6f1",
"state": "running",
"started_at": "2026-10-23T12:13:45.663039253Z",
"nano_cpus": 1000000000,
"memory_bytes": 536870912,
"ports": {
"5432/tcp": null
},
"image": "postgres:17.6-bookworm@sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3"
},
{
"id": "3ab85f1808aa04096c15c57985cedade3cf2317f7c04cea78bd891a9523a801a",
"name": "/mtusi-lab3-lb-1",
"instance": "3ab85f1808aa",
"state": "running",
"started_at": "2026-10-23T12:13:45.60706352Z",
"nano_cpus": 500000000,
"memory_bytes": 134217728,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
]
},
"image": "haproxy:3.2.6-alpine"
},
{
"id": "477b5a8721f414b11c79e196cbc914eb54754d17d3100b363cdf377c1525e4f3",
"name": "/mtusi-lab3-migrate-1",
"instance": "477b5a8721f4",
"state": "exited",
"started_at": "2026-10-23T12:15:16.604003267Z",
"nano_cpus": 500000000,
"memory_bytes": 268435456,
"ports": {},
"image": "mtusi-messenger:lab3"
},
{
"id": "d05b4b0c0e14422e029990de042ac54aedba88cd5c2de77b269a105148dea512",
"name": "/mtusi-lab3-valkey-1",
"instance": "d05b4b0c0e14",
"state": "running",
"started_at": "2026-10-23T12:13:45.319020586Z",
"nano_cpus": 500000000,
"memory_bytes": 268435456,
"ports": {
"6379/tcp": null
},
"image": "valkey/valkey:8.1.3-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571"
}
],
"database": {
"users": 73,
"chats": 57,
"messages": 572124,
"idempotency_keys": 572124,
"database_bytes": 370461843,
"fsync": "on",
"synchronous_commit": "on",
"full_page_writes": "on"
}
}
+25
View File
@@ -0,0 +1,25 @@
HTTP 201; X-Instance-Id=3fed3866f477; X-Request-Id=a56a2da8-c92d-4cd7-a69d-bf39e621e49e
HTTP 201; X-Instance-Id=3fed3866f477; X-Request-Id=fbf1422d-ae90-4576-b5b5-f7944dab5274
HTTP 201; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=0d225bff-4171-4d78-8195-c872821921e3
HTTP 201; X-Instance-Id=3fed3866f477; X-Request-Id=57db16cb-30c9-45dc-b3a1-32fc7361d048
HTTP 201; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=b5db9985-3ae1-484c-99bb-efe522267add
HTTP 201; X-Instance-Id=3fed3866f477; X-Request-Id=96b2718b-5b8f-4182-840b-02165ca78777
HTTP 201; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=d6e57bf6-013b-4538-8174-624bd3767c2c
HTTP 201; X-Instance-Id=3fed3866f477; X-Request-Id=6b051cf1-d67e-4909-87b9-d489d347527a
HTTP 201; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=dd82b913-5bbc-4479-981a-e9d35953b7ae
Ready: chat=e2f617ca-fa67-46ea-a693-43dd913330b7; message=e6939269-38b8-4669-9560-ca1363298f99. Session is kept in $Lab; do not print or save its Authorization header.
HTTP 200; X-Instance-Id=3fed3866f477; X-Request-Id=a85a22f1-3f87-46f1-a5b8-fd9238d72718
HTTP 200; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=84e2577a-54b4-4ca4-9005-74f44874a7f7
HTTP 200; X-Instance-Id=3fed3866f477; X-Request-Id=a5fa5d4a-b426-4ade-a64c-1c4c0edc8ba7
HTTP 200; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=7f8139f5-3ef6-4d5c-838c-9ca62ad2dab2
HTTP 200; X-Instance-Id=3fed3866f477; X-Request-Id=70a246c6-c239-47e7-8057-c533b0f50265
HTTP 200; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=431b02c5-6b81-4371-a344-bfe23f0e5718
HTTP 200; X-Instance-Id=3fed3866f477; X-Request-Id=c46a990b-8d39-4b59-abfc-f0b844e55beb
HTTP 200; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=2d54f876-ba25-4488-bccd-73ffa76ac7b3
HTTP 200; X-Instance-Id=3fed3866f477; X-Request-Id=b0451430-12e6-48a8-afda-2721daaa9e65
HTTP 200; X-Instance-Id=7f5ddf72d9b1; X-Request-Id=4b1a473e-8738-48a0-8219-fcdd229574c9
HTTP 201; X-Instance-Id=3fed3866f477; X-Request-Id=48bab8b1-b30d-41bd-9a8e-8a00cf1ff890
PASS: manual conflict returned 409
HTTP 204; X-Instance-Id=3fed3866f477; X-Request-Id=664f9bfa-4802-4290-809e-db35b7ef2b0e
PASS: manual logout returned 204 then 401
PASS: real manual.ps1, two replicas, replay, conflict and logout
+11
View File
@@ -0,0 +1,11 @@
{
"contracts/README.md": "72df27a559f88ffa3fd8c3c79d3c32f6db2c5986a0602677c51994c434a3fc4f",
"contracts/examples.json": "0a71cec72903af556df85f939c7e347fc73a86a1a4ffc39fb9c8ded169b7df45",
"contracts/infrastructure.json": "99320becab20381c3d31983336dd4e0aef4bca992d672538f049b6684714a577",
"contracts/openapi.json": "9c3787e5d08a60c59ae67eeb429e9d75fbf134992a4e1f0954e926db49e111be",
"tests/README.md": "e0bfa7e196797f6a5bf6e44d8ad2ffeb82651927ff5d8484eb1c2dda1ec7dec5",
"tests/client.py": "8d50976fc7c7bbb81e88a152f613c61ab25eaf53dba33c6a9dfab19f868d546d",
"tests/load.py": "6d3511ea719c7a7e841083e73d435c86dcbfd9f4e5c2a07d62eb9614b01d9933",
"tests/resilience.py": "1f96663a174b3978d24eff66f2741f5f8c9b788d3242261d37a972720c52788b",
"tests/smoke.py": "52ac38eb343ff7d43e7543588e1da58ca06c9fce74b2b0d0bf0e4982bc23c1db"
}
+16
View File
@@ -0,0 +1,16 @@
series,replicas,concurrency,pool,rps_median,rps_min,rps_max,p95_ms_median,failed_requests,successful_requests
fixed,1,32,8,886.9461686760884,881.4178866396619,899.3373554288052,80.669,0,40097
fixed,2,32,4,771.2523180982048,716.5367836352365,784.259414417926,90.155,0,34117
fixed,4,32,2,739.8841106280001,682.5050710662169,765.7859737448264,106.102,0,32981
growing,1,32,8,857.0531353180658,823.9402470054877,881.2296440856634,81.755,0,38529
growing,2,32,8,791.1205947157969,661.7999685496053,807.7429139912415,91.095,0,33934
growing,4,32,8,673.03625889995,612.3727267865354,703.1937884909651,96.117,0,29902
pool-overload,2,64,1,613.8354608801379,400.05557214497736,637.0205809658438,136.494,970,24964
pool-overload,2,64,8,786.2380926858069,766.640896558756,788.3564934630954,105.633,5472,35332
pool-tuning,2,32,1,618.7677762820396,567.3583671166701,638.7578278789013,74.209,0,27477
pool-tuning,2,32,8,739.8691144738191,728.491254986141,767.1283378921763,92.695,0,33617
saturation,4,1,8,301.68129598468346,296.02447062816464,327.7593962264186,4.633,0,13884
saturation,4,8,8,716.9622981055238,715.6392517794219,766.7709536056492,58.212,0,33000
saturation,4,32,8,737.7180474082401,725.12070375995,816.0401171115877,92.77,0,34198
saturation,4,64,8,789.5121631221782,651.3516389390559,790.2397086830756,187.653,93,33632
saturation,4,128,8,741.293867201931,689.2117244152156,792.7357194191711,215.681,8970,33776
1 series replicas concurrency pool rps_median rps_min rps_max p95_ms_median failed_requests successful_requests
2 fixed 1 32 8 886.9461686760884 881.4178866396619 899.3373554288052 80.669 0 40097
3 fixed 2 32 4 771.2523180982048 716.5367836352365 784.259414417926 90.155 0 34117
4 fixed 4 32 2 739.8841106280001 682.5050710662169 765.7859737448264 106.102 0 32981
5 growing 1 32 8 857.0531353180658 823.9402470054877 881.2296440856634 81.755 0 38529
6 growing 2 32 8 791.1205947157969 661.7999685496053 807.7429139912415 91.095 0 33934
7 growing 4 32 8 673.03625889995 612.3727267865354 703.1937884909651 96.117 0 29902
8 pool-overload 2 64 1 613.8354608801379 400.05557214497736 637.0205809658438 136.494 970 24964
9 pool-overload 2 64 8 786.2380926858069 766.640896558756 788.3564934630954 105.633 5472 35332
10 pool-tuning 2 32 1 618.7677762820396 567.3583671166701 638.7578278789013 74.209 0 27477
11 pool-tuning 2 32 8 739.8691144738191 728.491254986141 767.1283378921763 92.695 0 33617
12 saturation 4 1 8 301.68129598468346 296.02447062816464 327.7593962264186 4.633 0 13884
13 saturation 4 8 8 716.9622981055238 715.6392517794219 766.7709536056492 58.212 0 33000
14 saturation 4 32 8 737.7180474082401 725.12070375995 816.0401171115877 92.77 0 34198
15 saturation 4 64 8 789.5121631221782 651.3516389390559 790.2397086830756 187.653 93 33632
16 saturation 4 128 8 741.293867201931 689.2117244152156 792.7357194191711 215.681 8970 33776
+32428
View File
File diff suppressed because it is too large Load Diff
+35
View File
@@ -0,0 +1,35 @@
# Измерения трека 1
Fixed: суммарно 2 CPU / 1024 MiB API, суммарный пул 8. Growing: 1 CPU / 512 MiB и пул 8 на каждую API. PostgreSQL 1 CPU / 512 MiB, LB 0.5 CPU / 128 MiB, Valkey 0.5 CPU / 256 MiB, генератор 2 CPU / 256 MiB.
| Серия | API | Клиенты | Пул/реплика | RPS median [min;max] | p95 ms | Ошибки |
|---|---:|---:|---:|---:|---:|---:|
| fixed | 1 | 32 | 8 | 886.9 [881.4; 899.3] | 80.7 | 0 |
| fixed | 2 | 32 | 4 | 771.3 [716.5; 784.3] | 90.2 | 0 |
| fixed | 4 | 32 | 2 | 739.9 [682.5; 765.8] | 106.1 | 0 |
| growing | 1 | 32 | 8 | 857.1 [823.9; 881.2] | 81.8 | 0 |
| growing | 2 | 32 | 8 | 791.1 [661.8; 807.7] | 91.1 | 0 |
| growing | 4 | 32 | 8 | 673.0 [612.4; 703.2] | 96.1 | 0 |
| pool-overload | 2 | 64 | 1 | 613.8 [400.1; 637.0] | 136.5 | 970 |
| pool-overload | 2 | 64 | 8 | 786.2 [766.6; 788.4] | 105.6 | 5472 |
| pool-tuning | 2 | 32 | 1 | 618.8 [567.4; 638.8] | 74.2 | 0 |
| pool-tuning | 2 | 32 | 8 | 739.9 [728.5; 767.1] | 92.7 | 0 |
| saturation | 4 | 1 | 8 | 301.7 [296.0; 327.8] | 4.6 | 0 |
| saturation | 4 | 8 | 8 | 717.0 [715.6; 766.8] | 58.2 | 0 |
| saturation | 4 | 32 | 8 | 737.7 [725.1; 816.0] | 92.8 | 0 |
| saturation | 4 | 64 | 8 | 789.5 [651.4; 790.2] | 187.7 | 93 |
| saturation | 4 | 128 | 8 | 741.3 [689.2; 792.7] | 215.7 | 8970 |
Контролируемая настройка пула 1 → 8 (2 API, 32 клиента): изменение median RPS +19.6%. Критерий подтверждения: >5% без увеличения общего числа ошибок. Подтверждено: True.
Диагностика: research.json содержит CPU/RAM каждого контейнера, активные ожидания PostgreSQL, счётчики ожидания пула и очереди/ошибки HAProxy. Pool-tuning — отдельный намеренно ограниченный сценарий; он не выдаётся за дефект исходного пула 8.
Интерпретация этого прогона: fixed 1/2/4 API дали 886.9/771.3/739.9 median RPS, growing — 857.1/791.1/673.0; в этих сериях ошибок нет. Увеличение числа API и суммарных ресурсов API не повысило throughput. В sweep рост 8 → 32 клиентов дал лишь +2.9% RPS (717.0 → 737.7), одновременно p95 вырос 58.2 → 92.8 ms. При 128 клиентах доля неуспешных попыток 20.98%, p95=215.7 ms. Практическое колено этого профиля — около 8–32 клиентов.
В показательных sweep-запусках средний CPU DB около 87–104% ядра при лимите 1 CPU, память примерно 256–278/512 MiB. CPU LB около 17–27% при лимите 0.5 CPU, генератора 10–18% при лимите 2 CPU; qmax LB=0. Наблюдения согласуются с общим пределом DB/очереди пула; насыщение LB или клиента не видно. Конкретные различия RPS нельзя приписать исключительно CPU DB без отдельного эксперимента с её ресурсами.
Контроль пула 1 → 8 улучшил median throughput на 19.57% (618.8 → 739.9), все шесть запусков без ошибок. Диапазоны RPS не пересекаются: 567.4–638.8 против 728.5–767.1. p50 улучшился 53.0 → 15.1 ms, но p95 ухудшился 74.2 → 92.7 ms, p99 — 91.5 → 99.2 ms. Подтверждено улучшение throughput с ценой в хвосте, не ускорение каждого запроса. Отрицательный pool-overload при 64 клиентах сохранён отдельно и не принят за улучшение из-за роста ошибок 970 → 5472.
Контрольные 32-клиентные серии добавлены после исходных серий. В raw сохранены все 45 завершённых запусков. Порядок, накопление истории и состояние хоста ограничивают точность сравнения; частота/температура CPU не измерялись. Снимок перед дополнительной ручной проверкой содержит 572124 сообщений/ключей и pg_database_size=370461843 bytes.
Ограничения: один Docker Desktop/хост; closed-loop и coordinated omission; p95 только успехов; контейнерные CPU/RAM и PostgreSQL-счётчики включают прогрев; история растёт; дисковый кэш между сериями не сбрасывается; max RPS промышленной системы не заявляется.
+64
View File
@@ -0,0 +1,64 @@
Reusing 39 completed measurements
Container mtusi-lab3-api-8 Recreate
Container mtusi-lab3-api-9 Recreate
Container mtusi-lab3-api-9 Recreated
Container mtusi-lab3-api-8 Recreated
Container mtusi-lab3-api-9 Starting
Container mtusi-lab3-api-9 Started
Container mtusi-lab3-api-8 Starting
Container mtusi-lab3-api-8 Started
Measuring {"series": "pool-tuning", "replicas": 2, "cpu_per_api": 1, "memory_mib_per_api": 512, "pool": 1, "concurrency": 32, "repeat": 1}
Container mtusi-lab3-api-8 Recreate
Container mtusi-lab3-api-9 Recreate
Container mtusi-lab3-api-8 Recreated
Container mtusi-lab3-api-9 Recreated
Container mtusi-lab3-api-9 Starting
Container mtusi-lab3-api-9 Started
Container mtusi-lab3-api-8 Starting
Container mtusi-lab3-api-8 Started
Measuring {"series": "pool-tuning", "replicas": 2, "cpu_per_api": 1, "memory_mib_per_api": 512, "pool": 8, "concurrency": 32, "repeat": 1}
Container mtusi-lab3-api-8 Recreate
Container mtusi-lab3-api-9 Recreate
Container mtusi-lab3-api-8 Recreated
Container mtusi-lab3-api-9 Recreated
Container mtusi-lab3-api-8 Starting
Container mtusi-lab3-api-8 Started
Container mtusi-lab3-api-9 Starting
Container mtusi-lab3-api-9 Started
Measuring {"series": "pool-tuning", "replicas": 2, "cpu_per_api": 1, "memory_mib_per_api": 512, "pool": 8, "concurrency": 32, "repeat": 2}
Container mtusi-lab3-api-9 Recreate
Container mtusi-lab3-api-8 Recreate
Container mtusi-lab3-api-8 Recreated
Container mtusi-lab3-api-9 Recreated
Container mtusi-lab3-api-9 Starting
Container mtusi-lab3-api-9 Started
Container mtusi-lab3-api-8 Starting
Container mtusi-lab3-api-8 Started
Measuring {"series": "pool-tuning", "replicas": 2, "cpu_per_api": 1, "memory_mib_per_api": 512, "pool": 1, "concurrency": 32, "repeat": 2}
Container mtusi-lab3-api-8 Recreate
Container mtusi-lab3-api-9 Recreate
Container mtusi-lab3-api-9 Recreated
Container mtusi-lab3-api-8 Recreated
Container mtusi-lab3-api-9 Starting
Container mtusi-lab3-api-9 Started
Container mtusi-lab3-api-8 Starting
Container mtusi-lab3-api-8 Started
Measuring {"series": "pool-tuning", "replicas": 2, "cpu_per_api": 1, "memory_mib_per_api": 512, "pool": 1, "concurrency": 32, "repeat": 3}
Container mtusi-lab3-api-9 Recreate
Container mtusi-lab3-api-8 Recreate
Container mtusi-lab3-api-9 Recreated
Container mtusi-lab3-api-8 Recreated
Container mtusi-lab3-api-8 Starting
Container mtusi-lab3-api-8 Started
Container mtusi-lab3-api-9 Starting
Container mtusi-lab3-api-9 Started
Measuring {"series": "pool-tuning", "replicas": 2, "cpu_per_api": 1, "memory_mib_per_api": 512, "pool": 8, "concurrency": 32, "repeat": 3}
Container mtusi-lab3-api-9 Recreate
Container mtusi-lab3-api-8 Recreate
Container mtusi-lab3-api-9 Recreated
Container mtusi-lab3-api-8 Recreated
Container mtusi-lab3-api-9 Starting
Container mtusi-lab3-api-9 Started
Container mtusi-lab3-api-8 Starting
Container mtusi-lab3-api-8 Started
PASS: repeated scaling/saturation series and pool improvement measured; see evidence/research.md
+5
View File
@@ -0,0 +1,5 @@
809671ea9e156b63efb0e814356e296f7763b44f6e3a3fd7bb35ae7f8aa6244b api 2026-10-23T12:13:46.830894808Z running
d37b1b1c131fbba70e88871316faf75d5a999c1ebb4a5c44c9a5acd23be5b75a api 2026-10-23T12:13:46.753675356Z running
16f66e71d6f11ec87802055d002ffdc955cb7e45a4d49d65cbb855d5b9a05ff1 db 2026-10-23T12:13:45.663039253Z running
3ab85f1808aa04096c15c57985cedade3cf2317f7c04cea78bd891a9523a801a lb 2026-10-23T12:13:45.60706352Z running
d05b4b0c0e14422e029990de042ac54aedba88cd5c2de77b269a105148dea512 valkey 2026-10-23T12:13:45.319020586Z running
+5
View File
@@ -0,0 +1,5 @@
809671ea9e156b63efb0e814356e296f7763b44f6e3a3fd7bb35ae7f8aa6244b api 2026-10-23T12:12:37.237236606Z running
d37b1b1c131fbba70e88871316faf75d5a999c1ebb4a5c44c9a5acd23be5b75a api 2026-10-23T12:12:37.077670375Z running
16f66e71d6f11ec87802055d002ffdc955cb7e45a4d49d65cbb855d5b9a05ff1 db 2026-10-23T12:12:33.390812174Z running
3ab85f1808aa04096c15c57985cedade3cf2317f7c04cea78bd891a9523a801a lb 2026-10-23T12:12:43.161972189Z running
d05b4b0c0e14422e029990de042ac54aedba88cd5c2de77b269a105148dea512 valkey 2026-10-23T12:12:33.392857899Z running
Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

+36
View File
@@ -0,0 +1,36 @@
{
"auth.go": "d46cc3640891c1c0249352e297df8bd1daa4ef89ba86b968db40b6ec0bf4b139",
"auth_test.go": "172e59bd8413744d0448b57f168c5a6b3b1abc2cd3f47fb0cca3a8f418582665",
"compose.yaml": "2d623732093f0e522df660b12fb8815ee5c7b10aa6ec4cae1f4e3a34c64a186f",
"Dockerfile": "04bd53ca10e5e4ad9a8fa6eceb92044eec9523bfda397596fd16a6f3082ec65c",
"Dockerfile.tests": "2e56bd135892d2d12ba85ba5194bbb4ee29ddc08e87067865d1f668f6d5d2325",
"go.mod": "62ea9165ef562a8767ee94cabcefd2386e30657bea4f953fc92fbd12d69edf5f",
"go.sum": "c8c6aeb5caa7db83ebde4b4eb9643ae9b9e0c942806f44da4eb3389c3640f928",
"idempotency.go": "2bda0d19736f1be2208684df2243e7ec6db6e3ccce0b6c4957fdb813e79d50d1",
"main.go": "d527399f424d0b52d059bf170dedbb6aa16856376058a7f3f1da93c22726bbcd",
"protocol.go": "ee4464b917b138455a710a553b901642a914bc0479ccf764bf8494729508a905",
"store.go": "9a28caff699f25555bf9303b81b59a62ca1a62e42794d72a15395f947e4f3067",
"infra/haproxy.cfg": "28e14266088d438ad687a3f87066df9a94adfd9361fa2f3461d9cab625c01939",
"migrations/001_initial.sql": "00bed85481a6fa28e9469dee045d0c1da00ea93e67a834a57fc9e0b681f5af5a",
"migrations/002_unicode_storage.sql": "fb9abffe9f0937b55a44039f4e4f90a035c66284121560deb0c89568ec66a7f1",
"migrations/003_idempotency.sql": "ab5b28929d16fc0ae14605e95a0b6542a04c834bf928e79c95db2fca883c240c",
"scripts/bootstrap.py": "c1c827478574d3997fa731f33718fc1fb8d8b6d57ea8368d5febca71ca48bbbf",
"scripts/check_contract.py": "61e300fe5c1074360418e24b4653b12f96808247a2beaf2a64859aa360f81493",
"scripts/linux_tests.py": "06b74d5e4c08f0a52e701916d5f15404f1597896885af452703ba9de1c538890",
"scripts/manage.py": "0aa8425c2941a379a2fe6803cadb702f46150764a159f5658de3ad85e0fda27b",
"scripts/manual.ps1": "c65612a4a64595287aaa4a51b10cc310b883a8659a3b4a346b6b45e53614712e",
"scripts/research.py": "7d09a0f19e4b9e25ef753163e603d87dc95aa5c46c1f6ce8b10f6e90ec8698cf",
"scripts/restart.example.sh": "7cbfc7f518b975ee3ca37a645359ff734ab0686789b795a9ac845789eb46fbd9",
"scripts/restart.sh": "1b6b768bfe3afdff7a965626b846cc8e1d2a31a3856922e12fd6ff0988a1efe8",
"scripts/stop-one.example.sh": "6467c6e1515dee72982f85bced3f3862601ae0dbfafd4fd4818ef420f1dea040",
"scripts/stop-one.sh": "853660e83760e87659807f5064c0c3658634ce4c1a9572e786b0e82c933cd18d",
"scripts/validate_openapi.py": "cd7a33221b1860c5d2330e52afa6cb222d375db671ae9ab379ba51a0d3a77946",
"scripts/verify.py": "2d7cc020b5ebe8f3dde4b9c9f69568db96c00e49223e263640c781d433c41d3d",
"student-tests/acceptance.py": "0855dfe766185213db528d33dc08fab6e698bc815f509de79f35b26391453e2f",
"student-tests/failures.py": "8d074519f2ce3150c452de793443e531a3e4b1233ae6d6022eb67459ef15ae3c",
"tests/client.py": "b318084e2a4c380db91a55d082190bf33979fa556a4c4ca87e01f46ae275775c",
"tests/load.py": "9a9aff05e109630e243c3b092d7bd564344e4872b29e38b6618647a08460a72e",
"tests/resilience.py": "4ba30b9c81a0664127ddab2b0bea5e76aa2087be8bb25aa13cd5a8e69be23fdd",
"tests/smoke.py": "354e168e1e644145c3ff50bbbe189fd217cce5659aa125f588098025ffab0fdf",
"cmd/load/main.go": "59d98b803ac77763ba84582be755bf2b94e5197de844cacd7ace0b5cbdfb4836"
}
+1
View File
@@ -0,0 +1 @@
809671ea9e156b63efb0e814356e296f7763b44f6e3a3fd7bb35ae7f8aa6244b exited 2026-10-23T12:13:52.154097487Z 0
+1
View File
@@ -0,0 +1 @@
809671ea9e156b63efb0e814356e296f7763b44f6e3a3fd7bb35ae7f8aa6244b running 2026-10-23T12:13:46.830894808Z
+4
View File
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://lb:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 137, "failed_attempts": 4, "first_recovery_seconds": 2.024}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+3
View File
@@ -0,0 +1,3 @@
python3 student-tests/acceptance.py --base-url "http://lb:8080"
{"concurrent_requests": 16, "instances": ["809671ea9e15", "d37b1b1c131f"], "identical_result": true, "key_scopes": "user + POST + chat path", "revocation_rechecked": true}
PASS: concurrent replay, Unicode, conflict, key validation, isolation and logout
+3
View File
@@ -0,0 +1,3 @@
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://lb:8080"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
+14
View File
@@ -0,0 +1,14 @@
go test -race ./...
go: downloading github.com/jackc/pgx/v5 v5.7.6
go: downloading github.com/redis/go-redis/v9 v9.12.1
go: downloading golang.org/x/crypto v0.43.0
go: downloading github.com/jackc/puddle/v2 v2.2.2
go: downloading golang.org/x/text v0.30.0
go: downloading github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761
go: downloading github.com/jackc/pgpassfile v1.0.0
go: downloading golang.org/x/sync v0.17.0
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
go: downloading golang.org/x/sys v0.37.0
ok mtusi-messenger 2.155s
? mtusi-messenger/cmd/load [no test files]
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "http://lb:8080"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/validate_openapi.py
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
+233
View File
@@ -0,0 +1,233 @@
{
"timestamp_utc": "2026-10-23T12:36:44.872473+00:00",
"complete": true,
"levels_3_4_passed": true,
"track_5_measured": true,
"checks": [
{
"check": "bootstrap",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/bootstrap.py"
]
},
{
"check": "docker-info",
"exit_code": 0,
"command": [
"docker",
"info",
"--format",
"{{.ServerVersion}} {{.NCPU}} CPU {{.MemTotal}} bytes"
]
},
{
"check": "compose-check",
"exit_code": 0,
"command": [
"docker",
"compose",
"config",
"--quiet"
]
},
{
"check": "build-start",
"exit_code": 0,
"command": [
"docker",
"compose",
"up",
"-d",
"--build",
"--wait"
]
},
{
"check": "build-tests",
"exit_code": 0,
"command": [
"docker",
"build",
"-f",
"Dockerfile.tests",
"-t",
"mtusi-messenger:lab3-tests",
"."
]
},
{
"check": "check",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/linux_tests.py",
"check"
]
},
{
"check": "validate",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/linux_tests.py",
"validate"
]
},
{
"check": "test",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/linux_tests.py",
"test"
]
},
{
"check": "test-own",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/linux_tests.py",
"test-own"
]
},
{
"check": "test-race",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/linux_tests.py",
"test-race"
]
},
{
"check": "test-persistence",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/linux_tests.py",
"test-persistence"
]
},
{
"check": "test-failover",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/linux_tests.py",
"test-failover"
]
},
{
"check": "restore",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/manage.py",
"restore"
]
},
{
"check": "failures",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"student-tests/failures.py"
]
},
{
"check": "build-load",
"exit_code": 0,
"command": [
"docker",
"build",
"--target",
"load",
"-t",
"mtusi-messenger:lab3-load",
"."
]
},
{
"check": "research-dependencies",
"exit_code": 0,
"command": [
"C:\\Users\\maxsi\\HLAlab3\\mtusi2026lab3-fork\\.venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"--disable-pip-version-check",
"-r",
"requirements-research.txt"
]
},
{
"check": "research",
"exit_code": 0,
"command": [
"C:\\Users\\maxsi\\HLAlab3\\mtusi2026lab3-fork\\.venv\\Scripts\\python.exe",
"-X",
"utf8",
"scripts/research.py",
"--resume"
]
},
{
"check": "final-smoke",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"tests/smoke.py",
"--base-url",
"http://127.0.0.1:8080"
]
},
{
"check": "final-own",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"student-tests/acceptance.py",
"--base-url",
"http://127.0.0.1:8080"
]
},
{
"check": "final-containers",
"exit_code": 0,
"command": [
"C:\\Python314\\python.exe",
"-X",
"utf8",
"scripts/manage.py",
"status"
]
}
]
}