Lab3 baseline: HAProxy, replicated stateless API, shared PostgreSQL/Valkey, idempotent messages

This commit is contained in:
Ivan Melnikov
2026-12-02 18:22:57 +03:00
parent 0ab3a341aa
commit e9bf138053
474 changed files with 206416 additions and 16 deletions
+510
View File
@@ -0,0 +1,510 @@
{
"started_at": "2026-12-02T15:20:47.632397Z",
"base_url": "http://127.0.0.1:8083",
"image": "mtusi-messenger-lab3-melnikov:local",
"profile": {
"api_replicas": 2,
"api_cpu_limit": "0.4",
"api_mem_limit": "256M"
},
"containers_before": [
{
"container_id": "286d4623fa1976ac75919bae70692ff23a995b73c91e1f2e9c1e29c8e9c28d14",
"name": "mtusi-lab3-melnikov-api-1",
"hostname": "286d4623fa19",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T15:20:47.115851522Z",
"finished_at": "0001-01-01T00:00:00Z",
"exit_code": 0
},
{
"container_id": "1b3b710ee8b716806b7e304d83406d544ba186810d8e407fbe90cc1916695c8b",
"name": "mtusi-lab3-melnikov-api-2",
"hostname": "1b3b710ee8b7",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T15:20:47.198184541Z",
"finished_at": "0001-01-01T00:00:00Z",
"exit_code": 0
}
],
"results": [
{
"target_instance": "286d4623fa19",
"target_container": {
"container_id": "286d4623fa1976ac75919bae70692ff23a995b73c91e1f2e9c1e29c8e9c28d14",
"name": "mtusi-lab3-melnikov-api-1",
"image": "mtusi-messenger-lab3-melnikov:local",
"started_at_before": "2026-12-02T15:20:47.115851522Z",
"finished_at_after_stop": "2026-12-02T15:20:56.984367056Z",
"exit_code_after_stop": 0
},
"probe_elapsed_seconds": 18.877,
"loadgen": {
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T15:20:50.488268Z",
"finished_at": "2026-12-02T15:21:06.489711Z",
"measured_seconds": 16.002,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 40360,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2522.234,
"offered_rps": 2522.234,
"successful_latency_ms": {
"p50": 1.897,
"p95": 5.411,
"p99": 51.351,
"max": 87.701,
"mean": 3.169
},
"status_counts": {
"200": 20000,
"201": 20360
},
"instances": {
"1b3b710ee8b7": 34486,
"286d4623fa19": 5874
},
"app_versions": {
"1.0.0": 40360
},
"kinds": {
"read": 20000,
"write": 20360
},
"series": [
{
"second": 1796224850,
"success": 1167,
"errors": 0,
"p50_ms": 2.905,
"p95_ms": 5.862,
"p99_ms": 20.031
},
{
"second": 1796224851,
"success": 2717,
"errors": 0,
"p50_ms": 2.25,
"p95_ms": 4.53,
"p99_ms": 23.012
},
{
"second": 1796224852,
"success": 2847,
"errors": 0,
"p50_ms": 1.234,
"p95_ms": 2.082,
"p99_ms": 57.141
},
{
"second": 1796224853,
"success": 2148,
"errors": 0,
"p50_ms": 3.042,
"p95_ms": 7.324,
"p99_ms": 20.46
},
{
"second": 1796224854,
"success": 2440,
"errors": 0,
"p50_ms": 2.739,
"p95_ms": 5.608,
"p99_ms": 21.487
},
{
"second": 1796224855,
"success": 2770,
"errors": 0,
"p50_ms": 1.183,
"p95_ms": 2.281,
"p99_ms": 60.519
},
{
"second": 1796224856,
"success": 2620,
"errors": 0,
"p50_ms": 2.354,
"p95_ms": 4.623,
"p99_ms": 25.295
},
{
"second": 1796224857,
"success": 2529,
"errors": 0,
"p50_ms": 2.463,
"p95_ms": 4.315,
"p99_ms": 27.288
},
{
"second": 1796224858,
"success": 2422,
"errors": 0,
"p50_ms": 1.162,
"p95_ms": 2.529,
"p99_ms": 67.87
},
{
"second": 1796224859,
"success": 2284,
"errors": 0,
"p50_ms": 1.783,
"p95_ms": 9.091,
"p99_ms": 51.09
},
{
"second": 1796224860,
"success": 2267,
"errors": 0,
"p50_ms": 2.893,
"p95_ms": 5.58,
"p99_ms": 19.855
},
{
"second": 1796224861,
"success": 3075,
"errors": 0,
"p50_ms": 1.182,
"p95_ms": 3.787,
"p99_ms": 57.88
},
{
"second": 1796224862,
"success": 2663,
"errors": 0,
"p50_ms": 1.373,
"p95_ms": 3.77,
"p99_ms": 55.762
},
{
"second": 1796224863,
"success": 1780,
"errors": 0,
"p50_ms": 3.17,
"p95_ms": 11.969,
"p99_ms": 25.463
},
{
"second": 1796224864,
"success": 2574,
"errors": 0,
"p50_ms": 1.596,
"p95_ms": 6.574,
"p99_ms": 39.102
},
{
"second": 1796224865,
"success": 2877,
"errors": 0,
"p50_ms": 1.13,
"p95_ms": 3.197,
"p99_ms": 59.883
},
{
"second": 1796224866,
"success": 1180,
"errors": 0,
"p50_ms": 2.631,
"p95_ms": 4.819,
"p99_ms": 22.043
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target 286d4623fa19; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "286d4623fa19",
"stop_started_at": "2026-12-02T15:20:53.488355Z",
"stop_finished_at": "2026-12-02T15:20:56.775656Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.287,
"first_success_after_stop_seconds": 0.005,
"first_write_after_stop_seconds": 0.005,
"successes_after_stop": 32440,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T15:20:55.126081Z"
}
},
"checks": {
"stop_script_exit_zero": true,
"target_container_exited": true,
"target_not_answering_after_stop": true,
"first_success_within_10s": true,
"first_write_within_10s": true,
"no_idempotency_violations": true,
"other_replica_still_running": true
},
"restore_seconds_until_lb_serves_target": 0.838,
"containers_after_stop": [
{
"container_id": "286d4623fa1976ac75919bae70692ff23a995b73c91e1f2e9c1e29c8e9c28d14",
"name": "mtusi-lab3-melnikov-api-1",
"hostname": "286d4623fa19",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "exited",
"started_at": "2026-12-02T15:20:47.115851522Z",
"finished_at": "2026-12-02T15:20:56.984367056Z",
"exit_code": 0
},
{
"container_id": "1b3b710ee8b716806b7e304d83406d544ba186810d8e407fbe90cc1916695c8b",
"name": "mtusi-lab3-melnikov-api-2",
"hostname": "1b3b710ee8b7",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T15:20:47.198184541Z",
"finished_at": "0001-01-01T00:00:00Z",
"exit_code": 0
}
]
},
{
"target_instance": "1b3b710ee8b7",
"target_container": {
"container_id": "1b3b710ee8b716806b7e304d83406d544ba186810d8e407fbe90cc1916695c8b",
"name": "mtusi-lab3-melnikov-api-2",
"image": "mtusi-messenger-lab3-melnikov:local",
"started_at_before": "2026-12-02T15:20:47.198184541Z",
"finished_at_after_stop": "2026-12-02T15:21:16.040602824Z",
"exit_code_after_stop": 0
},
"probe_elapsed_seconds": 18.157,
"loadgen": {
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T15:21:09.519285Z",
"finished_at": "2026-12-02T15:21:25.524239Z",
"measured_seconds": 16.005,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 40771,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2547.359,
"offered_rps": 2547.359,
"successful_latency_ms": {
"p50": 1.923,
"p95": 4.865,
"p99": 47.339,
"max": 88.058,
"mean": 3.137
},
"status_counts": {
"200": 20000,
"201": 20771
},
"instances": {
"1b3b710ee8b7": 4524,
"286d4623fa19": 36247
},
"app_versions": {
"1.0.0": 40771
},
"kinds": {
"read": 20000,
"write": 20771
},
"series": [
{
"second": 1796224869,
"success": 1144,
"errors": 0,
"p50_ms": 2.856,
"p95_ms": 4.969,
"p99_ms": 18.281
},
{
"second": 1796224870,
"success": 1869,
"errors": 0,
"p50_ms": 3.441,
"p95_ms": 13.169,
"p99_ms": 21.36
},
{
"second": 1796224871,
"success": 2844,
"errors": 0,
"p50_ms": 1.249,
"p95_ms": 2.215,
"p99_ms": 55.604
},
{
"second": 1796224872,
"success": 2511,
"errors": 0,
"p50_ms": 2.392,
"p95_ms": 5.072,
"p99_ms": 28.992
},
{
"second": 1796224873,
"success": 2044,
"errors": 0,
"p50_ms": 2.836,
"p95_ms": 11.984,
"p99_ms": 26.677
},
{
"second": 1796224874,
"success": 2928,
"errors": 0,
"p50_ms": 1.178,
"p95_ms": 2.993,
"p99_ms": 58.086
},
{
"second": 1796224875,
"success": 2589,
"errors": 0,
"p50_ms": 1.824,
"p95_ms": 4.502,
"p99_ms": 48.765
},
{
"second": 1796224876,
"success": 2275,
"errors": 0,
"p50_ms": 2.69,
"p95_ms": 4.965,
"p99_ms": 27.491
},
{
"second": 1796224877,
"success": 2570,
"errors": 0,
"p50_ms": 1.25,
"p95_ms": 3.48,
"p99_ms": 60.57
},
{
"second": 1796224878,
"success": 2821,
"errors": 0,
"p50_ms": 1.352,
"p95_ms": 3.465,
"p99_ms": 45.405
},
{
"second": 1796224879,
"success": 2310,
"errors": 0,
"p50_ms": 2.661,
"p95_ms": 5.478,
"p99_ms": 26.679
},
{
"second": 1796224880,
"success": 2757,
"errors": 0,
"p50_ms": 1.313,
"p95_ms": 3.807,
"p99_ms": 55.155
},
{
"second": 1796224881,
"success": 3015,
"errors": 0,
"p50_ms": 1.297,
"p95_ms": 3.332,
"p99_ms": 56.109
},
{
"second": 1796224882,
"success": 2368,
"errors": 0,
"p50_ms": 2.605,
"p95_ms": 4.63,
"p99_ms": 23.228
},
{
"second": 1796224883,
"success": 2651,
"errors": 0,
"p50_ms": 1.298,
"p95_ms": 4.5,
"p99_ms": 58.57
},
{
"second": 1796224884,
"success": 2959,
"errors": 0,
"p50_ms": 1.264,
"p95_ms": 3.888,
"p99_ms": 56.6
},
{
"second": 1796224885,
"success": 1116,
"errors": 0,
"p50_ms": 2.687,
"p95_ms": 4.913,
"p99_ms": 27.491
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target 1b3b710ee8b7; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "1b3b710ee8b7",
"stop_started_at": "2026-12-02T15:21:12.521297Z",
"stop_finished_at": "2026-12-02T15:21:15.837741Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.316,
"first_success_after_stop_seconds": 0.004,
"first_write_after_stop_seconds": 0.004,
"successes_after_stop": 33494,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T15:21:13.345522Z"
}
},
"checks": {
"stop_script_exit_zero": true,
"target_container_exited": true,
"target_not_answering_after_stop": true,
"first_success_within_10s": true,
"first_write_within_10s": true,
"no_idempotency_violations": true,
"other_replica_still_running": true
},
"restore_seconds_until_lb_serves_target": 0.608,
"containers_after_stop": [
{
"container_id": "286d4623fa1976ac75919bae70692ff23a995b73c91e1f2e9c1e29c8e9c28d14",
"name": "mtusi-lab3-melnikov-api-1",
"hostname": "286d4623fa19",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T15:21:06.876638057Z",
"finished_at": "2026-12-02T15:20:56.984367056Z",
"exit_code": 0
},
{
"container_id": "1b3b710ee8b716806b7e304d83406d544ba186810d8e407fbe90cc1916695c8b",
"name": "mtusi-lab3-melnikov-api-2",
"hostname": "1b3b710ee8b7",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "exited",
"started_at": "2026-12-02T15:20:47.198184541Z",
"finished_at": "2026-12-02T15:21:16.040602824Z",
"exit_code": 0
}
]
}
],
"finished_at": "2026-12-02T15:21:26.194211Z",
"all_checks_passed": true
}