forked from mtusi2026/mtusi2026lab3
Lab 3: HAProxy + 2 replicas, idempotency, graceful shutdown, track 1
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# 2026-11-03T09:57:04Z expand-migration demo, new version 3.0.2-expand
|
||||
== 1) new-version container before migrate:
|
||||
Container mtusi-lab3-api-run-b781fee6ea25 Creating
|
||||
Container mtusi-lab3-api-run-b781fee6ea25 Created
|
||||
health/ready inside new container: NOT-READY
|
||||
log: {"ts": "2026-11-03T09:57:05Z", "level": "warning", "logger": "messenger.http", "msg": "schema is behind this code; waiting for migrate", "missing": ["0004_demo_expand"]}
|
||||
== 2) migrate (one-shot):
|
||||
{"applied": ["0004_demo_expand"]}
|
||||
== 3) old replicas after migrate:
|
||||
/mtusi-lab3-api-3 ready=yes version=3.0.1
|
||||
/mtusi-lab3-api-4 ready=yes version=3.0.1
|
||||
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"measured_at": "2026-11-03T09:53:05+00:00",
|
||||
"workers": 8,
|
||||
"client_timeout_s": 2.0,
|
||||
"phases_s": {
|
||||
"before": 5,
|
||||
"after_action": 10
|
||||
},
|
||||
"runs": [
|
||||
{
|
||||
"mode": "stop",
|
||||
"container": "mtusi-lab3-api-1",
|
||||
"instance_id": "api-fd0cdd87",
|
||||
"action_seconds": 3.91,
|
||||
"before": {
|
||||
"seconds": 5.03,
|
||||
"ok": 1331,
|
||||
"errors": 0,
|
||||
"rps_ok": 264.6,
|
||||
"p50_ms": 27.1,
|
||||
"p99_ms": 100.7,
|
||||
"by_instance": {
|
||||
"api-79e08828": 666,
|
||||
"api-fd0cdd87": 665
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"during": {
|
||||
"seconds": 13.91,
|
||||
"ok": 3504,
|
||||
"errors": 0,
|
||||
"rps_ok": 251.9,
|
||||
"p50_ms": 29.8,
|
||||
"p99_ms": 68.3,
|
||||
"by_instance": {
|
||||
"api-79e08828": 3360,
|
||||
"api-fd0cdd87": 144
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"after_restore": {
|
||||
"seconds": 11.32,
|
||||
"ok": 2858,
|
||||
"errors": 0,
|
||||
"rps_ok": 252.5,
|
||||
"p50_ms": 27.0,
|
||||
"p99_ms": 107.7,
|
||||
"by_instance": {
|
||||
"api-4a34d5cd": 1336,
|
||||
"api-79e08828": 1522
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"errors_after_action": 0,
|
||||
"last_error_after_action_s": 0,
|
||||
"target_last_served_after_action_s": 0.95,
|
||||
"max_gap_between_successful_writes_s": 0.12,
|
||||
"replica_healthy_after_start_s": 5.6,
|
||||
"restarted_replica_first_served_s": 1.28,
|
||||
"data": {
|
||||
"confirmed": 1928,
|
||||
"lost_confirmed": 0,
|
||||
"stored": 1928,
|
||||
"duplicate_texts": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"mode": "stop",
|
||||
"container": "mtusi-lab3-api-2",
|
||||
"instance_id": "api-79e08828",
|
||||
"action_seconds": 4.26,
|
||||
"before": {
|
||||
"seconds": 5.04,
|
||||
"ok": 1407,
|
||||
"errors": 0,
|
||||
"rps_ok": 278.9,
|
||||
"p50_ms": 24.8,
|
||||
"p99_ms": 82.5,
|
||||
"by_instance": {
|
||||
"api-4a34d5cd": 701,
|
||||
"api-79e08828": 706
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"during": {
|
||||
"seconds": 14.26,
|
||||
"ok": 3143,
|
||||
"errors": 0,
|
||||
"rps_ok": 220.4,
|
||||
"p50_ms": 33.8,
|
||||
"p99_ms": 88.7,
|
||||
"by_instance": {
|
||||
"api-4a34d5cd": 2931,
|
||||
"api-79e08828": 212
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"after_restore": {
|
||||
"seconds": 11.97,
|
||||
"ok": 2890,
|
||||
"errors": 0,
|
||||
"rps_ok": 241.5,
|
||||
"p50_ms": 29.0,
|
||||
"p99_ms": 103.4,
|
||||
"by_instance": {
|
||||
"api-4a34d5cd": 1579,
|
||||
"api-563af4cd": 1311
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"errors_after_action": 0,
|
||||
"last_error_after_action_s": 0,
|
||||
"target_last_served_after_action_s": 1.53,
|
||||
"max_gap_between_successful_writes_s": 0.18,
|
||||
"replica_healthy_after_start_s": 6.01,
|
||||
"restarted_replica_first_served_s": 1.48,
|
||||
"data": {
|
||||
"confirmed": 1865,
|
||||
"lost_confirmed": 0,
|
||||
"stored": 1865,
|
||||
"duplicate_texts": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"mode": "kill",
|
||||
"container": "mtusi-lab3-api-1",
|
||||
"instance_id": "api-4a34d5cd",
|
||||
"action_seconds": 0.26,
|
||||
"before": {
|
||||
"seconds": 5.04,
|
||||
"ok": 1492,
|
||||
"errors": 0,
|
||||
"rps_ok": 295.8,
|
||||
"p50_ms": 23.1,
|
||||
"p99_ms": 93.0,
|
||||
"by_instance": {
|
||||
"api-4a34d5cd": 747,
|
||||
"api-563af4cd": 745
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"during": {
|
||||
"seconds": 10.26,
|
||||
"ok": 1914,
|
||||
"errors": 5,
|
||||
"rps_ok": 186.6,
|
||||
"p50_ms": 32.8,
|
||||
"p99_ms": 309.9,
|
||||
"by_instance": {
|
||||
"api-4a34d5cd": 6,
|
||||
"api-563af4cd": 1908
|
||||
},
|
||||
"error_codes": {
|
||||
"502": 5
|
||||
}
|
||||
},
|
||||
"after_restore": {
|
||||
"seconds": 11.75,
|
||||
"ok": 2780,
|
||||
"errors": 0,
|
||||
"rps_ok": 236.5,
|
||||
"p50_ms": 30.5,
|
||||
"p99_ms": 92.7,
|
||||
"by_instance": {
|
||||
"api-471b30bc": 1048,
|
||||
"api-563af4cd": 1732
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"errors_after_action": 5,
|
||||
"last_error_after_action_s": 0.08,
|
||||
"target_last_served_after_action_s": 0.04,
|
||||
"max_gap_between_successful_writes_s": 0.32,
|
||||
"replica_healthy_after_start_s": 5.73,
|
||||
"restarted_replica_first_served_s": 3.57,
|
||||
"data": {
|
||||
"confirmed": 1551,
|
||||
"lost_confirmed": 0,
|
||||
"stored": 1551,
|
||||
"duplicate_texts": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"mode": "kill",
|
||||
"container": "mtusi-lab3-api-2",
|
||||
"instance_id": "api-563af4cd",
|
||||
"action_seconds": 0.27,
|
||||
"before": {
|
||||
"seconds": 5.03,
|
||||
"ok": 1408,
|
||||
"errors": 0,
|
||||
"rps_ok": 279.9,
|
||||
"p50_ms": 25.5,
|
||||
"p99_ms": 78.9,
|
||||
"by_instance": {
|
||||
"api-471b30bc": 707,
|
||||
"api-563af4cd": 701
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"during": {
|
||||
"seconds": 10.27,
|
||||
"ok": 2175,
|
||||
"errors": 8,
|
||||
"rps_ok": 211.8,
|
||||
"p50_ms": 31.9,
|
||||
"p99_ms": 307.9,
|
||||
"by_instance": {
|
||||
"api-471b30bc": 2171,
|
||||
"api-563af4cd": 4
|
||||
},
|
||||
"error_codes": {
|
||||
"502": 8
|
||||
}
|
||||
},
|
||||
"after_restore": {
|
||||
"seconds": 11.95,
|
||||
"ok": 2609,
|
||||
"errors": 0,
|
||||
"rps_ok": 218.3,
|
||||
"p50_ms": 33.3,
|
||||
"p99_ms": 112.1,
|
||||
"by_instance": {
|
||||
"api-471b30bc": 1448,
|
||||
"api-50205d38": 1161
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"errors_after_action": 8,
|
||||
"last_error_after_action_s": 0.1,
|
||||
"target_last_served_after_action_s": 0.05,
|
||||
"max_gap_between_successful_writes_s": 0.31,
|
||||
"replica_healthy_after_start_s": 5.73,
|
||||
"restarted_replica_first_served_s": 1.78,
|
||||
"data": {
|
||||
"confirmed": 1552,
|
||||
"lost_confirmed": 0,
|
||||
"stored": 1552,
|
||||
"duplicate_texts": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"measured_at": "2026-11-03T09:56:21+00:00",
|
||||
"workers": 8,
|
||||
"script_exit": 0,
|
||||
"script_seconds": 27.88,
|
||||
"before_replicas": [
|
||||
{
|
||||
"container": "mtusi-lab3-api-1",
|
||||
"instance_id": "api-471b30bc"
|
||||
},
|
||||
{
|
||||
"container": "mtusi-lab3-api-2",
|
||||
"instance_id": "api-50205d38"
|
||||
}
|
||||
],
|
||||
"after_replicas": [
|
||||
{
|
||||
"container": "mtusi-lab3-api-3",
|
||||
"instance_id": "api-730666b6"
|
||||
},
|
||||
{
|
||||
"container": "mtusi-lab3-api-4",
|
||||
"instance_id": "api-87d10eab"
|
||||
}
|
||||
],
|
||||
"images_before": [
|
||||
"sha256:d9d8402d14a0"
|
||||
],
|
||||
"images_after": [
|
||||
"sha256:fb847cbe9916"
|
||||
],
|
||||
"before": {
|
||||
"seconds": 5.04,
|
||||
"ok": 1236,
|
||||
"errors": 0,
|
||||
"rps_ok": 245.0,
|
||||
"p50_ms": 28.1,
|
||||
"p99_ms": 109.7,
|
||||
"by_instance": {
|
||||
"api-471b30bc": 618,
|
||||
"api-50205d38": 618
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"during": {
|
||||
"seconds": 27.88,
|
||||
"ok": 5696,
|
||||
"errors": 0,
|
||||
"rps_ok": 204.3,
|
||||
"p50_ms": 31.4,
|
||||
"p99_ms": 152.4,
|
||||
"by_instance": {
|
||||
"api-471b30bc": 896,
|
||||
"api-50205d38": 2061,
|
||||
"api-730666b6": 1928,
|
||||
"api-87d10eab": 811
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"after": {
|
||||
"seconds": 10.0,
|
||||
"ok": 2821,
|
||||
"errors": 0,
|
||||
"rps_ok": 282.1,
|
||||
"p50_ms": 26.0,
|
||||
"p99_ms": 74.1,
|
||||
"by_instance": {
|
||||
"api-730666b6": 1410,
|
||||
"api-87d10eab": 1411
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"data": {
|
||||
"confirmed": 2444,
|
||||
"lost_confirmed": 0,
|
||||
"stored": 2444,
|
||||
"duplicate_texts": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"measured_at": "2026-11-03T09:58:07+00:00",
|
||||
"workers": 8,
|
||||
"script_exit": 0,
|
||||
"script_seconds": 28.32,
|
||||
"before_replicas": [
|
||||
{
|
||||
"container": "mtusi-lab3-api-3",
|
||||
"instance_id": "api-730666b6"
|
||||
},
|
||||
{
|
||||
"container": "mtusi-lab3-api-4",
|
||||
"instance_id": "api-87d10eab"
|
||||
}
|
||||
],
|
||||
"after_replicas": [
|
||||
{
|
||||
"container": "mtusi-lab3-api-5",
|
||||
"instance_id": "api-ed7bd071"
|
||||
},
|
||||
{
|
||||
"container": "mtusi-lab3-api-6",
|
||||
"instance_id": "api-f4fc385b"
|
||||
}
|
||||
],
|
||||
"images_before": [
|
||||
"sha256:fb847cbe9916"
|
||||
],
|
||||
"images_after": [
|
||||
"sha256:5c115f1efe4d"
|
||||
],
|
||||
"before": {
|
||||
"seconds": 5.04,
|
||||
"ok": 1465,
|
||||
"errors": 0,
|
||||
"rps_ok": 290.7,
|
||||
"p50_ms": 22.7,
|
||||
"p99_ms": 77.3,
|
||||
"by_instance": {
|
||||
"api-730666b6": 730,
|
||||
"api-87d10eab": 735
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"during": {
|
||||
"seconds": 28.32,
|
||||
"ok": 5710,
|
||||
"errors": 0,
|
||||
"rps_ok": 201.6,
|
||||
"p50_ms": 32.6,
|
||||
"p99_ms": 134.9,
|
||||
"by_instance": {
|
||||
"api-730666b6": 998,
|
||||
"api-87d10eab": 2125,
|
||||
"api-ed7bd071": 1910,
|
||||
"api-f4fc385b": 677
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"after": {
|
||||
"seconds": 10.0,
|
||||
"ok": 2450,
|
||||
"errors": 0,
|
||||
"rps_ok": 245.0,
|
||||
"p50_ms": 29.8,
|
||||
"p99_ms": 87.3,
|
||||
"by_instance": {
|
||||
"api-ed7bd071": 1219,
|
||||
"api-f4fc385b": 1231
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"data": {
|
||||
"confirmed": 2412,
|
||||
"lost_confirmed": 0,
|
||||
"stored": 2412,
|
||||
"duplicate_texts": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"measured_at": "2026-11-03T09:58:56+00:00",
|
||||
"workers": 8,
|
||||
"script_exit": 0,
|
||||
"script_seconds": 27.48,
|
||||
"before_replicas": [
|
||||
{
|
||||
"container": "mtusi-lab3-api-5",
|
||||
"instance_id": "api-ed7bd071"
|
||||
},
|
||||
{
|
||||
"container": "mtusi-lab3-api-6",
|
||||
"instance_id": "api-f4fc385b"
|
||||
}
|
||||
],
|
||||
"after_replicas": [
|
||||
{
|
||||
"container": "mtusi-lab3-api-7",
|
||||
"instance_id": "api-8e374d62"
|
||||
},
|
||||
{
|
||||
"container": "mtusi-lab3-api-8",
|
||||
"instance_id": "api-b25f5827"
|
||||
}
|
||||
],
|
||||
"images_before": [
|
||||
"sha256:5c115f1efe4d"
|
||||
],
|
||||
"images_after": [
|
||||
"sha256:d5045137ab03"
|
||||
],
|
||||
"before": {
|
||||
"seconds": 5.03,
|
||||
"ok": 1381,
|
||||
"errors": 0,
|
||||
"rps_ok": 274.4,
|
||||
"p50_ms": 25.7,
|
||||
"p99_ms": 80.7,
|
||||
"by_instance": {
|
||||
"api-ed7bd071": 693,
|
||||
"api-f4fc385b": 688
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"during": {
|
||||
"seconds": 27.48,
|
||||
"ok": 5274,
|
||||
"errors": 0,
|
||||
"rps_ok": 191.9,
|
||||
"p50_ms": 33.8,
|
||||
"p99_ms": 172.5,
|
||||
"by_instance": {
|
||||
"api-8e374d62": 1644,
|
||||
"api-b25f5827": 756,
|
||||
"api-ed7bd071": 972,
|
||||
"api-f4fc385b": 1902
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"after": {
|
||||
"seconds": 10.0,
|
||||
"ok": 2689,
|
||||
"errors": 0,
|
||||
"rps_ok": 268.9,
|
||||
"p50_ms": 27.2,
|
||||
"p99_ms": 86.0,
|
||||
"by_instance": {
|
||||
"api-8e374d62": 1348,
|
||||
"api-b25f5827": 1341
|
||||
},
|
||||
"error_codes": {}
|
||||
},
|
||||
"data": {
|
||||
"confirmed": 2342,
|
||||
"lost_confirmed": 0,
|
||||
"stored": 2342,
|
||||
"duplicate_texts": 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user