- X-Instance-Id в каждом ответе; обязательный Idempotency-Key, таблица idempotency_keys (миграция 0002, одна транзакция, конкурентные повторы через уникальный индекс) - graceful shutdown: SIGTERM -> ready=503 -> drain 3 с -> закрытие порта - compose: lb (HAProxy) + api x2 без портов + разовый migrate + postgres, лимиты CPU/RAM - хуки stop-one/restart/restore-replicas, scripts/experiments.py (failover, idempotency, rolling) - свои тесты: 44 (13 новых); evidence: smoke, pytest, persistence, failover, эксперименты
701 lines
13 KiB
JSON
701 lines
13 KiB
JSON
{
|
|
"method": "closed loop 8 workers: POST message (retry same Idempotency-Key on error) + GET page; client timeout 2s; each replica stopped with docker stop -t 8, restored, then the next",
|
|
"replicas": [
|
|
"bb53391a07f1",
|
|
"e51c99b5436b"
|
|
],
|
|
"warmup_seconds": 5,
|
|
"seconds_down": 15,
|
|
"runs": [
|
|
{
|
|
"stopped_replica": "bb53391a07f1",
|
|
"baseline_before_stop": {
|
|
"seconds": 7.62,
|
|
"successful_requests": 366,
|
|
"failed_requests": 0,
|
|
"error_reasons": {},
|
|
"error_ratio": 0.0,
|
|
"successful_rps": 48.0,
|
|
"latency_ms": {
|
|
"p50": 131.3,
|
|
"p95": 390.6,
|
|
"p99": 501.0
|
|
}
|
|
},
|
|
"stop_to_restore": {
|
|
"seconds": 19.67,
|
|
"successful_requests": 526,
|
|
"failed_requests": 6,
|
|
"error_reasons": {
|
|
"read: connection/TLS failure (RemoteDisconnected)": 1,
|
|
"write: connection/TLS failure (RemoteDisconnected)": 5
|
|
},
|
|
"error_ratio": 0.0113,
|
|
"successful_rps": 26.7,
|
|
"latency_ms": {
|
|
"p50": 276.3,
|
|
"p95": 573.1,
|
|
"p99": 693.5
|
|
}
|
|
},
|
|
"after_restore": {
|
|
"seconds": 27.91,
|
|
"successful_requests": 913,
|
|
"failed_requests": 0,
|
|
"error_reasons": {},
|
|
"error_ratio": 0.0,
|
|
"successful_rps": 32.7,
|
|
"latency_ms": {
|
|
"p50": 239.9,
|
|
"p95": 516.6,
|
|
"p99": 684.7
|
|
}
|
|
},
|
|
"docker_stop_seconds": 4.67,
|
|
"last_error_seconds_after_stop": 1.55,
|
|
"first_success_on_other_replica_seconds": 0.0,
|
|
"requests_served_by_stopped_replica_after_stop_returned": 0,
|
|
"seconds_until_replica_back_in_rotation": 19.5,
|
|
"instances_seen": [
|
|
"bb53391a07f1",
|
|
"e51c99b5436b"
|
|
],
|
|
"resource_snapshot_under_load": [
|
|
"mtusi-lab3-api-1: cpu 39.24%, mem 80.89MiB / 512MiB",
|
|
"mtusi-lab3-api-2: cpu 102.77%, mem 83.61MiB / 512MiB",
|
|
"mtusi-lab3-lb-1: cpu 9.63%, mem 14.8MiB / 128MiB",
|
|
"mtusi-lab3-postgres-1: cpu 36.60%, mem 55.37MiB / 512MiB"
|
|
],
|
|
"timeline_per_second": [
|
|
{
|
|
"t": 0,
|
|
"ok": 37,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 1,
|
|
"ok": 57,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 2,
|
|
"ok": 57,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 3,
|
|
"ok": 54,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 4,
|
|
"ok": 38,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 5,
|
|
"ok": 31,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 6,
|
|
"ok": 51,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 7,
|
|
"ok": 63,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 8,
|
|
"ok": 60,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 9,
|
|
"ok": 30,
|
|
"errors": 6
|
|
},
|
|
{
|
|
"t": 10,
|
|
"ok": 25,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 11,
|
|
"ok": 15,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 12,
|
|
"ok": 22,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 13,
|
|
"ok": 32,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 14,
|
|
"ok": 26,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 15,
|
|
"ok": 31,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 16,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 17,
|
|
"ok": 22,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 18,
|
|
"ok": 16,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 19,
|
|
"ok": 15,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 20,
|
|
"ok": 30,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 21,
|
|
"ok": 30,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 22,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 23,
|
|
"ok": 28,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 24,
|
|
"ok": 26,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 25,
|
|
"ok": 17,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 26,
|
|
"ok": 16,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 27,
|
|
"ok": 23,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 28,
|
|
"ok": 26,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 29,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 30,
|
|
"ok": 27,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 31,
|
|
"ok": 28,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 32,
|
|
"ok": 20,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 33,
|
|
"ok": 15,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 34,
|
|
"ok": 23,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 35,
|
|
"ok": 21,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 36,
|
|
"ok": 31,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 37,
|
|
"ok": 21,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 38,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 39,
|
|
"ok": 18,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 40,
|
|
"ok": 17,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 41,
|
|
"ok": 20,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 42,
|
|
"ok": 27,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 43,
|
|
"ok": 26,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 44,
|
|
"ok": 54,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 45,
|
|
"ok": 47,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 46,
|
|
"ok": 53,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 47,
|
|
"ok": 33,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 48,
|
|
"ok": 37,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 49,
|
|
"ok": 43,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 50,
|
|
"ok": 32,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 51,
|
|
"ok": 58,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 52,
|
|
"ok": 60,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 53,
|
|
"ok": 62,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 54,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 55,
|
|
"ok": 9,
|
|
"errors": 0
|
|
}
|
|
],
|
|
"acked_messages": 903,
|
|
"messages_in_history": 903,
|
|
"lost_acked_messages": 0,
|
|
"duplicate_messages": 0
|
|
},
|
|
{
|
|
"stopped_replica": "e51c99b5436b",
|
|
"baseline_before_stop": {
|
|
"seconds": 7.7,
|
|
"successful_requests": 320,
|
|
"failed_requests": 0,
|
|
"error_reasons": {},
|
|
"error_ratio": 0.0,
|
|
"successful_rps": 41.6,
|
|
"latency_ms": {
|
|
"p50": 140.9,
|
|
"p95": 485.4,
|
|
"p99": 605.6
|
|
}
|
|
},
|
|
"stop_to_restore": {
|
|
"seconds": 19.39,
|
|
"successful_requests": 510,
|
|
"failed_requests": 0,
|
|
"error_reasons": {},
|
|
"error_ratio": 0.0,
|
|
"successful_rps": 26.3,
|
|
"latency_ms": {
|
|
"p50": 289.3,
|
|
"p95": 540.3,
|
|
"p99": 666.9
|
|
}
|
|
},
|
|
"after_restore": {
|
|
"seconds": 27.92,
|
|
"successful_requests": 976,
|
|
"failed_requests": 0,
|
|
"error_reasons": {},
|
|
"error_ratio": 0.0,
|
|
"successful_rps": 35.0,
|
|
"latency_ms": {
|
|
"p50": 228.7,
|
|
"p95": 493.7,
|
|
"p99": 661.6
|
|
}
|
|
},
|
|
"docker_stop_seconds": 4.39,
|
|
"last_error_seconds_after_stop": 0.0,
|
|
"first_success_on_other_replica_seconds": 0.09,
|
|
"requests_served_by_stopped_replica_after_stop_returned": 0,
|
|
"seconds_until_replica_back_in_rotation": 19.75,
|
|
"instances_seen": [
|
|
"bb53391a07f1",
|
|
"e51c99b5436b"
|
|
],
|
|
"resource_snapshot_under_load": [
|
|
"mtusi-lab3-api-1: cpu 71.15%, mem 83.38MiB / 512MiB",
|
|
"mtusi-lab3-api-2: cpu 35.64%, mem 81.46MiB / 512MiB",
|
|
"mtusi-lab3-lb-1: cpu 9.00%, mem 15.11MiB / 128MiB",
|
|
"mtusi-lab3-postgres-1: cpu 46.72%, mem 56.47MiB / 512MiB"
|
|
],
|
|
"timeline_per_second": [
|
|
{
|
|
"t": 0,
|
|
"ok": 18,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 1,
|
|
"ok": 43,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 2,
|
|
"ok": 60,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 3,
|
|
"ok": 59,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 4,
|
|
"ok": 47,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 5,
|
|
"ok": 30,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 6,
|
|
"ok": 38,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 7,
|
|
"ok": 35,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 8,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 9,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 10,
|
|
"ok": 30,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 11,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 12,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 13,
|
|
"ok": 23,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 14,
|
|
"ok": 16,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 15,
|
|
"ok": 13,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 16,
|
|
"ok": 30,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 17,
|
|
"ok": 31,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 18,
|
|
"ok": 30,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 19,
|
|
"ok": 26,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 20,
|
|
"ok": 28,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 21,
|
|
"ok": 18,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 22,
|
|
"ok": 17,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 23,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 24,
|
|
"ok": 31,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 25,
|
|
"ok": 30,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 26,
|
|
"ok": 28,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 27,
|
|
"ok": 25,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 28,
|
|
"ok": 16,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 29,
|
|
"ok": 16,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 30,
|
|
"ok": 27,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 31,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 32,
|
|
"ok": 32,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 33,
|
|
"ok": 27,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 34,
|
|
"ok": 27,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 35,
|
|
"ok": 22,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 36,
|
|
"ok": 14,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 37,
|
|
"ok": 25,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 38,
|
|
"ok": 27,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 39,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 40,
|
|
"ok": 31,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 41,
|
|
"ok": 27,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 42,
|
|
"ok": 21,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 43,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 44,
|
|
"ok": 40,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 45,
|
|
"ok": 53,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 46,
|
|
"ok": 57,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 47,
|
|
"ok": 58,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 48,
|
|
"ok": 51,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 49,
|
|
"ok": 29,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 50,
|
|
"ok": 38,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 51,
|
|
"ok": 57,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 52,
|
|
"ok": 54,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 53,
|
|
"ok": 58,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 54,
|
|
"ok": 60,
|
|
"errors": 0
|
|
},
|
|
{
|
|
"t": 55,
|
|
"ok": 1,
|
|
"errors": 0
|
|
}
|
|
],
|
|
"acked_messages": 903,
|
|
"messages_in_history": 1806,
|
|
"lost_acked_messages": 0,
|
|
"duplicate_messages": 0
|
|
}
|
|
]
|
|
}
|