Completed for a grade of four
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# clean copy of the working tree (git ls-files -co --exclude-standard), fresh secrets and volume, COMPOSE_PROJECT_NAME=lab3-clean
|
||||
# 2026-10-23T12:49Z, base commit 92c2fdc + uncommitted lab3 grade-4 changes
|
||||
$ ./scripts/init-secrets.sh && docker compose up -d --build --wait && make check && make test && make test-persistence ACTION_SCRIPT=scripts/restart.sh && make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
created secrets/db_password
|
||||
created secrets/redis_password
|
||||
config ok
|
||||
Container lab3-clean-api-2 Healthy
|
||||
Container lab3-clean-api-1 Healthy
|
||||
Container lab3-clean-lb-1 Healthy
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
{"observed_instances_before": 2, "successful_writes": 125, "failed_attempts": 0, "first_recovery_seconds": 4.859}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
lab3-clean-api-1 running
|
||||
lab3-clean-api-2 exited
|
||||
lab3-clean-lb-1 running
|
||||
lab3-clean-migrate-1 exited
|
||||
lab3-clean-postgres-1 running
|
||||
lab3-clean-redis-1 running
|
||||
+12
-12
@@ -1,24 +1,24 @@
|
||||
# before
|
||||
NAME CONTAINER ID STATE STATUS
|
||||
mtusi-messenger-lab3-api-1 236cb759e825 running Up About a minute (healthy)
|
||||
mtusi-messenger-lab3-api-2 787a253aa6a6 running Up 8 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-1 d1ff13561537 running Up 24 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 ac9723acebaa running Up 24 seconds (healthy)
|
||||
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 119, "failed_attempts": 1, "first_recovery_seconds": 6.508}
|
||||
{"observed_instances_before": 2, "successful_writes": 121, "failed_attempts": 0, "first_recovery_seconds": 5.385}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
|
||||
# after: the stopped container is the replica whose id the test passed as TARGET_INSTANCE_ID
|
||||
NAME CONTAINER ID STATE STATUS
|
||||
mtusi-messenger-lab3-api-1 236cb759e825 exited Exited (143) 8 seconds ago
|
||||
mtusi-messenger-lab3-api-2 787a253aa6a6 running Up 24 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-1 d1ff13561537 exited Exited (143) 9 seconds ago
|
||||
mtusi-messenger-lab3-api-2 ac9723acebaa running Up 40 seconds (healthy)
|
||||
|
||||
# HAProxy log around the failure (non-2xx and state changes)
|
||||
[WARNING] (8) : Server api/api1 was DOWN and now enters maintenance (No IP for server ).
|
||||
Server api/api1 ('api') is UP/READY (resolves again).
|
||||
[WARNING] (8) : Server api/api1 ('api') is UP/READY (resolves again).
|
||||
172.24.0.1:55062 [22/Oct/2026:17:44:22.431] http api/api2 0/0/0/-1/93 502 209 - - SH-- 1/1/0/0/0 0/0 "POST /api/v1/chats/43312e52-5c0b-41af-9981-2379d372b382/messages HTTP/1.1"
|
||||
[WARNING] (8) : Server api/api2 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
||||
Server api/api2 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
||||
Server api/api2 was DOWN and now enters maintenance (No IP for server ).
|
||||
172.24.0.1:57032 [23/Oct/2026:11:37:38.388] http api/api2 0/0/0/97/97 201 500 - - ---- 1/1/0/0/0 0/0 "POST /api/v1/auth/sessions HTTP/1.1"
|
||||
172.24.0.1:58552 [23/Oct/2026:11:37:53.795] http api/api2 0/0/0/86/86 201 504 - - ---- 1/1/0/0/0 0/0 "POST /api/v1/auth/sessions HTTP/1.1"
|
||||
172.24.0.1:58572 [23/Oct/2026:11:37:53.942] http api/api2 0/0/0/78/78 201 500 - - ---- 1/1/0/0/0 0/0 "POST /api/v1/auth/sessions HTTP/1.1"
|
||||
172.24.0.1:58586 [23/Oct/2026:11:37:54.055] http api/api2 0/0/0/81/81 201 500 - - ---- 1/1/0/0/0 0/0 "POST /api/v1/auth/sessions HTTP/1.1"
|
||||
Server api/api2 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 5ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
||||
[WARNING] (8) : Server api/api2 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 5ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
||||
[WARNING] (8) : Server api/api2 was DOWN and now enters maintenance (No IP for server ).
|
||||
Server api/api2 was DOWN and now enters maintenance (No IP for server ).
|
||||
|
||||
+11
-11
@@ -1,24 +1,24 @@
|
||||
# before
|
||||
NAME CONTAINER ID STATE STATUS
|
||||
mtusi-messenger-lab3-api-1 236cb759e825 running Up 8 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 787a253aa6a6 running Up About a minute (healthy)
|
||||
mtusi-messenger-lab3-api-1 d1ff13561537 running Up 8 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 ac9723acebaa running Up About a minute (healthy)
|
||||
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 120, "failed_attempts": 1, "first_recovery_seconds": 6.537}
|
||||
{"observed_instances_before": 2, "successful_writes": 121, "failed_attempts": 0, "first_recovery_seconds": 5.125}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
|
||||
# after: the stopped container is the replica whose id the test passed as TARGET_INSTANCE_ID
|
||||
NAME CONTAINER ID STATE STATUS
|
||||
mtusi-messenger-lab3-api-1 236cb759e825 running Up 24 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 787a253aa6a6 exited Exited (143) 8 seconds ago
|
||||
mtusi-messenger-lab3-api-1 d1ff13561537 running Up 24 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 ac9723acebaa exited Exited (143) 10 seconds ago
|
||||
|
||||
# HAProxy log around the failure (non-2xx and state changes)
|
||||
[WARNING] (8) : Server api/api2 was DOWN and now enters maintenance (No IP for server ).
|
||||
Server api/api2 ('api') is UP/READY (resolves again).
|
||||
[WARNING] (8) : Server api/api2 ('api') is UP/READY (resolves again).
|
||||
172.24.0.1:62054 [22/Oct/2026:17:45:16.133] http api/api1 0/0/0/-1/87 502 209 - - SH-- 1/1/0/0/0 0/0 "POST /api/v1/chats/43529cee-e036-4e88-a744-c3fd0e23ce65/messages HTTP/1.1"
|
||||
Server api/api1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
||||
[WARNING] (8) : Server api/api1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
||||
[WARNING] (8) : Server api/api2 is UP, reason: Layer7 check passed, code: 200, check duration: 9ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
|
||||
172.24.0.1:64862 [23/Oct/2026:11:38:51.915] http api/api1 0/0/0/69/69 201 504 - - ---- 1/1/0/0/0 0/0 "POST /api/v1/auth/sessions HTTP/1.1"
|
||||
172.24.0.1:64886 [23/Oct/2026:11:38:52.074] http api/api1 0/0/0/26/26 201 500 - - ---- 1/1/0/0/0 0/0 "POST /api/v1/auth/sessions HTTP/1.1"
|
||||
172.24.0.1:64892 [23/Oct/2026:11:38:52.179] http api/api1 0/0/0/24/24 201 500 - - ---- 1/1/0/0/0 0/0 "POST /api/v1/auth/sessions HTTP/1.1"
|
||||
[WARNING] (8) : Server api/api1 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 3ms. 1 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.
|
||||
Server api/api1 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 3ms. 1 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.
|
||||
[WARNING] (8) : Server api/api1 was DOWN and now enters maintenance (No IP for server ).
|
||||
Server api/api1 was DOWN and now enters maintenance (No IP for server ).
|
||||
|
||||
+19
-16
@@ -1,7 +1,7 @@
|
||||
# ./gradlew test (Testcontainers: postgres:17.6-alpine3.22, redis:8.4.0-alpine)
|
||||
total: 66 tests, 0 failed
|
||||
total: 68 tests, 0 failed
|
||||
|
||||
infrastructure.controllers.authentication.AuthenticationControllerTest: 9 tests, 0 failed, 7.774 s
|
||||
infrastructure.controllers.authentication.AuthenticationControllerTest: 9 tests, 0 failed, 7.132 s
|
||||
- logout revokes only the current token
|
||||
- Bearer token cannot open a session
|
||||
- password containing a colon and non-ASCII characters works
|
||||
@@ -11,19 +11,19 @@ infrastructure.controllers.authentication.AuthenticationControllerTest: 9 tests,
|
||||
- valid Basic credentials open a session
|
||||
- missing or malformed Basic header returns 401
|
||||
- wrong password and unknown user get the same 401
|
||||
infrastructure.controllers.chat.ChatControllerTest: 6 tests, 0 failed, 2.101 s
|
||||
infrastructure.controllers.chat.ChatControllerTest: 6 tests, 0 failed, 2.173 s
|
||||
- member can read own chat and members keep their order
|
||||
- unknown member is rejected before anything is written
|
||||
- foreign chat returns 404 for non-member
|
||||
- cursor issued to another user is rejected
|
||||
- chat list contains only own chats and is paginated
|
||||
- invalid member lists are rejected with 400
|
||||
infrastructure.controllers.health.HealthControllerTest: 2 tests, 0 failed, 0.134 s
|
||||
infrastructure.controllers.health.HealthControllerTest: 2 tests, 0 failed, 0.127 s
|
||||
- live returns 200
|
||||
- ready returns 200 when database is reachable
|
||||
infrastructure.controllers.message.MessageConcurrencyTest: 1 tests, 0 failed, 0.335 s
|
||||
infrastructure.controllers.message.MessageConcurrencyTest: 1 tests, 0 failed, 0.285 s
|
||||
- parallel senders produce exactly N unique messages
|
||||
infrastructure.controllers.message.MessageControllerTest: 7 tests, 0 failed, 1.946 s
|
||||
infrastructure.controllers.message.MessageControllerTest: 7 tests, 0 failed, 1.826 s
|
||||
- foreign chat returns 404 when sending
|
||||
- last page has null next_cursor
|
||||
- pagination walks all messages exactly once
|
||||
@@ -31,7 +31,7 @@ infrastructure.controllers.message.MessageControllerTest: 7 tests, 0 failed, 1.9
|
||||
- empty text returns 400 invalid_request
|
||||
- history that is an exact multiple of limit ends with null next_cursor
|
||||
- foreign cursor returns 400
|
||||
infrastructure.controllers.message.MessageIdempotencyTest: 7 tests, 0 failed, 3.266 s
|
||||
infrastructure.controllers.message.MessageIdempotencyTest: 7 tests, 0 failed, 3.269 s
|
||||
- expired key can be used for a new message
|
||||
- key scope is user and chat
|
||||
- same key with another body is a conflict
|
||||
@@ -39,7 +39,7 @@ infrastructure.controllers.message.MessageIdempotencyTest: 7 tests, 0 failed, 3.
|
||||
- retry with the same key and body returns the original message
|
||||
- retry by a former outsider is still checked for access
|
||||
- concurrent retries create exactly one message
|
||||
infrastructure.controllers.user.UserControllerTest: 11 tests, 0 failed, 1.638 s
|
||||
infrastructure.controllers.user.UserControllerTest: 11 tests, 0 failed, 1.668 s
|
||||
- password shorter than 12 code points returns 400
|
||||
- concurrent registrations of one username create exactly one user
|
||||
- X-User-Id alone gives no access
|
||||
@@ -51,34 +51,37 @@ infrastructure.controllers.user.UserControllerTest: 11 tests, 0 failed, 1.638 s
|
||||
- Basic credentials are rejected on business endpoints
|
||||
- me returns the session owner
|
||||
- X-User-Id does not override bearer identity
|
||||
infrastructure.repositories.authentication.session.cache.RedisSessionCacheRepositoryTest: 3 tests, 0 failed, 0.102 s
|
||||
infrastructure.repositories.authentication.session.cache.RedisSessionCacheRepositoryTest: 3 tests, 0 failed, 0.091 s
|
||||
- cached session round-trips and expires together with the session
|
||||
- revoke replaces a cached session with a tombstone
|
||||
- late cache fill cannot overwrite a tombstone
|
||||
infrastructure.repositories.chat.ExposedChatRepositoryTest: 2 tests, 0 failed, 0.514 s
|
||||
infrastructure.repositories.chat.ExposedChatRepositoryTest: 2 tests, 0 failed, 0.498 s
|
||||
- chat row is rolled back when inserting members fails
|
||||
- successful creation commits the chat and every member
|
||||
infrastructure.services.authentication.SessionLookupSingleFlightTest: 4 tests, 0 failed, 1.120 s
|
||||
infrastructure.services.authentication.SessionLookupSingleFlightTest: 4 tests, 0 failed, 1.122 s
|
||||
- request arriving after logout does not join a lookup started before it
|
||||
- without single-flight every concurrent miss queries the database
|
||||
- with single-flight concurrent misses share one database lookup
|
||||
- lookup that finished before a request arrived is not reused
|
||||
infrastructure.services.hashing.DefaultHashingServiceTest: 4 tests, 0 failed, 0.421 s
|
||||
infrastructure.services.hashing.DefaultHashingServiceTest: 4 tests, 0 failed, 0.418 s
|
||||
- passwords differing only after 72 bytes are distinguished
|
||||
- validates the right password and rejects a wrong one
|
||||
- malformed hash is rejected instead of throwing
|
||||
- hash is a salted Argon2id PHC string
|
||||
plugins.DatabaseMigrationTest: 1 tests, 0 failed, 0.209 s
|
||||
plugins.CorsTest: 2 tests, 0 failed, 0.119 s
|
||||
- page of the API itself may call it
|
||||
- unknown origin is rejected
|
||||
plugins.DatabaseMigrationTest: 1 tests, 0 failed, 0.188 s
|
||||
- re-running migrations applies nothing and keeps data
|
||||
plugins.DependencyFailureTest: 5 tests, 0 failed, 13.326 s
|
||||
plugins.DependencyFailureTest: 5 tests, 0 failed, 13.637 s
|
||||
- without PostgreSQL requests fail with a bounded 503
|
||||
- logout during a Redis outage survives an API restart
|
||||
- logout during a Redis outage is not undone by a stale cached copy
|
||||
- without Redis requests bypass the cache
|
||||
- hanging Redis costs one command timeout and recovers
|
||||
plugins.InstanceIdTest: 1 tests, 0 failed, 0.231 s
|
||||
plugins.InstanceIdTest: 1 tests, 0 failed, 0.245 s
|
||||
- every response names the replica
|
||||
plugins.SessionCacheTest: 3 tests, 0 failed, 0.928 s
|
||||
plugins.SessionCacheTest: 3 tests, 0 failed, 0.953 s
|
||||
- emptied cache falls back to PostgreSQL
|
||||
- first authenticated request fills the cache
|
||||
- logout leaves a tombstone and the token is rejected
|
||||
|
||||
@@ -6,8 +6,8 @@ $ python3 scripts/idempotency-race.py
|
||||
"201": 640
|
||||
},
|
||||
"requests_per_instance": {
|
||||
"236cb759e825": 320,
|
||||
"787a253aa6a6": 320
|
||||
"ac9723acebaa": 320,
|
||||
"d1ff13561537": 320
|
||||
},
|
||||
"rounds_with_more_than_one_message_id": 0,
|
||||
"messages_in_history": 20,
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
$ docker compose ps -a
|
||||
NAME IMAGE STATE STATUS PORTS
|
||||
mtusi-messenger-lab3-api-1 mtusi-messenger:lab3 running Up 35 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab3-api-2 mtusi-messenger:lab3 running Up 35 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab3-lb-1 haproxy:3.2.4-alpine running Up 29 seconds 127.0.0.1:8080->8080/tcp
|
||||
mtusi-messenger-lab3-migrate-1 mtusi-messenger:lab3 exited Exited (0) 36 seconds ago
|
||||
mtusi-messenger-lab3-postgres-1 postgres:17.6-alpine3.22 running Up 42 seconds (healthy) 5432/tcp
|
||||
mtusi-messenger-lab3-redis-1 redis:8.4.0-alpine running Up 42 seconds (healthy) 6379/tcp
|
||||
mtusi-messenger-lab3-api-1 mtusi-messenger:lab3 running Up 10 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab3-api-2 mtusi-messenger:lab3 running Up 9 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab3-lb-1 haproxy:3.2.4-alpine running Up 7 seconds (healthy) 127.0.0.1:8080->8080/tcp
|
||||
mtusi-messenger-lab3-migrate-1 mtusi-messenger:lab3 exited Exited (0) 10 seconds ago
|
||||
mtusi-messenger-lab3-postgres-1 postgres:17.6-alpine3.22 running Up 20 seconds (healthy) 5432/tcp
|
||||
mtusi-messenger-lab3-redis-1 redis:8.4.0-alpine running Up 20 seconds (healthy) 6379/tcp
|
||||
|
||||
$ for i in 1..6: curl -sD - http://localhost:8080/health/ready | grep X-Instance-Id
|
||||
x-instance-id: 236cb759e825
|
||||
x-instance-id: 787a253aa6a6
|
||||
x-instance-id: 236cb759e825
|
||||
x-instance-id: 787a253aa6a6
|
||||
x-instance-id: 236cb759e825
|
||||
x-instance-id: 787a253aa6a6
|
||||
x-instance-id: ac9723acebaa
|
||||
x-instance-id: d1ff13561537
|
||||
x-instance-id: ac9723acebaa
|
||||
x-instance-id: d1ff13561537
|
||||
x-instance-id: ac9723acebaa
|
||||
x-instance-id: d1ff13561537
|
||||
|
||||
# X-Instance-Id = HOSTNAME = short container id of the replica
|
||||
NAME CONTAINER ID STATE STATUS
|
||||
mtusi-messenger-lab3-api-1 236cb759e825 running Up 35 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 787a253aa6a6 running Up 35 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-1 d1ff13561537 running Up 10 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 ac9723acebaa running Up 10 seconds (healthy)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
$ docker compose ps
|
||||
NAME IMAGE STATUS PORTS
|
||||
mtusi-messenger-lab3-api-1 mtusi-messenger:lab3 Up 57 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab3-api-2 mtusi-messenger:lab3 Up 57 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab3-lb-1 haproxy:3.2.4-alpine Up 54 seconds (healthy) 127.0.0.1:8080->8080/tcp
|
||||
mtusi-messenger-lab3-postgres-1 postgres:17.6-alpine3.22 Up About a minute (healthy) 5432/tcp
|
||||
mtusi-messenger-lab3-redis-1 redis:8.4.0-alpine Up About a minute (healthy) 6379/tcp
|
||||
|
||||
# limits (NanoCpus / Memory) from docker inspect
|
||||
/mtusi-messenger-lab3-api-1 cpus=1000000000 memory=536870912 restart=unless-stopped
|
||||
/mtusi-messenger-lab3-api-2 cpus=1000000000 memory=536870912 restart=unless-stopped
|
||||
/mtusi-messenger-lab3-lb-1 cpus=500000000 memory=134217728 restart=unless-stopped
|
||||
/mtusi-messenger-lab3-postgres-1 cpus=1000000000 memory=1073741824 restart=unless-stopped
|
||||
/mtusi-messenger-lab3-redis-1 cpus=500000000 memory=134217728 restart=unless-stopped
|
||||
|
||||
$ docker stats --no-stream
|
||||
NAME CPU % MEM USAGE / LIMIT
|
||||
mtusi-messenger-lab3-lb-1 0.21% 13.65MiB / 128MiB
|
||||
mtusi-messenger-lab3-api-1 2.36% 183.7MiB / 512MiB
|
||||
mtusi-messenger-lab3-api-2 1.42% 184.4MiB / 512MiB
|
||||
mtusi-messenger-lab3-postgres-1 0.13% 67.29MiB / 1GiB
|
||||
mtusi-messenger-lab3-redis-1 0.26% 12.44MiB / 128MiB
|
||||
|
||||
# published ports: only the balancer
|
||||
mtusi-messenger-lab3-api-1 [{ 8080 0 tcp}]
|
||||
mtusi-messenger-lab3-api-2 [{ 8080 0 tcp}]
|
||||
mtusi-messenger-lab3-lb-1 [{127.0.0.1 8080 8080 tcp}]
|
||||
mtusi-messenger-lab3-postgres-1 [{ 5432 0 tcp}]
|
||||
mtusi-messenger-lab3-redis-1 [{ 6379 0 tcp}]
|
||||
|
||||
# secrets per service
|
||||
api ['db_password', 'redis_password']
|
||||
lb []
|
||||
migrate ['db_password']
|
||||
postgres ['db_password']
|
||||
redis ['redis_password']
|
||||
|
||||
# HAProxy backend table
|
||||
# pxname,svname,status,check_status
|
||||
api,api1,UP,L7OK
|
||||
api,api2,UP,L7OK
|
||||
api,api3,MAINT (resolution),
|
||||
api,api4,MAINT (resolution),
|
||||
api,BACKEND,UP,
|
||||
@@ -0,0 +1,20 @@
|
||||
# Нагрузочные прогоны
|
||||
|
||||
Дата: 2026-10-23. Код: commit 92c2fdc + незакоммиченные изменения уровня 4 (тот же код, что в PR).
|
||||
|
||||
Стенд: Apple M4 (10 ядер), 16 ГБ, macOS 27; Docker Desktop 28.4 (VM 10 CPU, 8 ГБ), Compose 2.39; k6 2.3 на той же машине.
|
||||
Лимиты контейнеров — как в `compose.yaml`: api 1 CPU / 512 МБ ×2, postgres 1 CPU / 1 ГБ, redis 0.5 CPU / 128 МБ, lb 0.5 CPU / 128 МБ.
|
||||
|
||||
Профиль (`scripts/load/mixed.js`): открытая модель, 150 запросов/с через `localhost:8080`, 10 пользователей, один общий чат.
|
||||
70 % `GET /api/v1/users/me`, 30 % `POST /api/v1/chats/{id}/messages` с уникальным `Idempotency-Key`. Таймаут запроса 5 с, повторов нет.
|
||||
Ошибка — любой ответ не 2xx, включая status 0 (обрыв, таймаут).
|
||||
|
||||
| Каталог | Команда | Что происходит |
|
||||
| --- | --- | --- |
|
||||
| `failover-stop-api-1`, `failover-stop-api-2` | `MODE=stop TARGET=api-N scripts/load/failover-under-load.sh` | 45 с нагрузки, на 10-й с `docker stop` реплики (SIGTERM), на 25-й `docker start` |
|
||||
| `failover-kill-api-1`, `failover-kill-api-2` | `MODE=kill TARGET=api-N scripts/load/failover-under-load.sh` | то же, но `docker kill` (SIGKILL, падение процесса) |
|
||||
| `rolling-update` | `scripts/load/rolling-under-load.sh` | 70 с нагрузки, с 10-й с `scripts/rolling-update.sh` |
|
||||
|
||||
В каждом каталоге: `k6.txt` (итог k6), `events.json` (моменты действий, epoch ms), `haproxy.log` (смены состояния backend и ответы 5xx),
|
||||
`per-second.csv` (по секундам: успешные, ошибки, p99, max, сколько ответила каждая реплика), `summary.json` (итог, считает `scripts/load/summarize.py`).
|
||||
Сырые данные по каждому запросу в Git не кладутся; `KEEP_RAW=1` оставляет `requests.csv` локально.
|
||||
@@ -0,0 +1,2 @@
|
||||
{"mode": "kill", "target": "api-1", "target_instance": "7b89cf61597b", "restored_instance": "7b89cf61597b",
|
||||
"load_start": 1792755242253, "fault": 1792755252286, "fault_done": 1792755252443, "restore_begin": 1792755267305, "restore_healthy": 1792755269813}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
█ TOTAL RESULTS
|
||||
|
||||
CUSTOM
|
||||
served_by......................: 6726 146.724721/s
|
||||
|
||||
HTTP
|
||||
http_req_duration..............: avg=24.62ms med=1.73ms p(95)=6.23ms p(99)=1s max=1.01s
|
||||
{ expected_response:true }...: avg=24.62ms med=1.73ms p(95)=6.23ms p(99)=1s max=1.01s
|
||||
http_req_failed................: 0.00% 0 out of 6747
|
||||
http_reqs......................: 6747 147.182826/s
|
||||
|
||||
EXECUTION
|
||||
dropped_iterations.............: 25 0.545364/s
|
||||
iteration_duration.............: avg=24.77ms med=1.92ms p(95)=6.16ms p(99)=1s max=1.01s
|
||||
iterations.....................: 6726 146.724721/s
|
||||
vus............................: 0 min=0 max=66
|
||||
vus_max........................: 75 min=50 max=75
|
||||
|
||||
NETWORK
|
||||
data_received..................: 2.6 MB 57 kB/s
|
||||
data_sent......................: 1.3 MB 29 kB/s
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
second,ok,errors,p99_ms,max_ms,4fa49e9e1a53,7b89cf61597b
|
||||
0,151,0,11.9,12.3,75,76
|
||||
1,149,0,5.9,6.7,75,74
|
||||
2,150,0,9.8,10.5,75,75
|
||||
3,150,0,6.4,7.3,75,75
|
||||
4,150,0,7.0,7.9,75,75
|
||||
5,151,0,5.8,7.8,75,76
|
||||
6,150,0,3.9,7.1,75,75
|
||||
7,149,0,6.2,6.5,75,74
|
||||
8,150,0,6.2,6.4,75,75
|
||||
9,151,0,6.1,7.3,75,76
|
||||
10,97,0,7.6,7.6,77,20
|
||||
11,104,0,1007.5,1009.4,104,0
|
||||
12,224,0,1006.6,1011.5,224,0
|
||||
13,150,0,7.1,15.8,150,0
|
||||
14,150,0,8.9,22.4,150,0
|
||||
15,150,0,4.3,5.1,150,0
|
||||
16,150,0,6.2,7.4,150,0
|
||||
17,150,0,5.2,6.2,150,0
|
||||
18,149,0,5.1,5.9,149,0
|
||||
19,151,0,5.4,6.8,151,0
|
||||
20,150,0,5.7,5.8,150,0
|
||||
21,150,0,5.6,5.7,150,0
|
||||
22,150,0,11.5,14.7,150,0
|
||||
23,150,0,5.7,6.0,150,0
|
||||
24,150,0,5.5,6.2,150,0
|
||||
25,150,0,34.2,43.0,150,0
|
||||
26,150,0,4.1,4.4,150,0
|
||||
27,149,0,5.9,6.1,149,0
|
||||
28,136,0,7.4,8.0,136,0
|
||||
29,164,0,714.7,777.3,75,89
|
||||
30,151,0,8.4,20.8,75,76
|
||||
31,149,0,32.0,41.6,74,75
|
||||
32,151,0,12.8,15.2,76,75
|
||||
33,150,0,5.6,5.8,75,75
|
||||
34,150,0,5.4,5.5,75,75
|
||||
35,150,0,10.5,12.2,75,75
|
||||
36,150,0,5.7,6.5,75,75
|
||||
37,150,0,5.5,5.9,75,75
|
||||
38,150,0,5.4,6.6,75,75
|
||||
39,150,0,6.4,6.5,75,75
|
||||
40,150,0,5.7,6.2,75,75
|
||||
41,149,0,5.2,5.5,74,75
|
||||
42,150,0,26.9,29.4,75,75
|
||||
43,151,0,6.9,7.1,76,75
|
||||
44,150,0,17.8,18.8,75,75
|
||||
|
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"requests": 6726,
|
||||
"ok": 6726,
|
||||
"errors": 0,
|
||||
"error_codes": {},
|
||||
"ok_rps": 149.5,
|
||||
"p50_ms": 1.7,
|
||||
"p95_ms": 5.9,
|
||||
"p99_ms": 1003.5,
|
||||
"max_ms": 1011.5,
|
||||
"requests_per_instance": {
|
||||
"7b89cf61597b": 1986,
|
||||
"4fa49e9e1a53": 4740
|
||||
},
|
||||
"event_load_start_s": 0.22,
|
||||
"event_fault_s": 10.26,
|
||||
"event_fault_done_s": 10.41,
|
||||
"event_restore_begin_s": 25.27,
|
||||
"event_restore_healthy_s": 27.78,
|
||||
"errors_after_fault": 0,
|
||||
"last_error_after_fault_s": null,
|
||||
"target_last_response_after_fault_s": 0.01,
|
||||
"restored_replica_first_response_after_start_s": 3.85,
|
||||
"lb_marked_down_after_fault_s": 1.74,
|
||||
"lb_marked_up_after_start_s": 3.52
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{"mode": "kill", "target": "api-2", "target_instance": "4fa49e9e1a53", "restored_instance": "4fa49e9e1a53",
|
||||
"load_start": 1792755292111, "fault": 1792755302165, "fault_done": 1792755302329, "restore_begin": 1792755317163, "restore_healthy": 1792755319645}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
█ TOTAL RESULTS
|
||||
|
||||
CUSTOM
|
||||
served_by......................: 6722 146.537002/s
|
||||
|
||||
HTTP
|
||||
http_req_duration..............: avg=25.2ms med=1.69ms p(95)=5.68ms p(99)=1s max=1.01s
|
||||
{ expected_response:true }...: avg=25.2ms med=1.69ms p(95)=5.68ms p(99)=1s max=1.01s
|
||||
http_req_failed................: 0.00% 0 out of 6743
|
||||
http_reqs......................: 6743 146.994794/s
|
||||
|
||||
EXECUTION
|
||||
dropped_iterations.............: 29 0.632189/s
|
||||
iteration_duration.............: avg=25.35ms med=1.88ms p(95)=5.77ms p(99)=1s max=1.01s
|
||||
iterations.....................: 6722 146.537002/s
|
||||
vus............................: 1 min=0 max=78
|
||||
vus_max........................: 79 min=50 max=79
|
||||
|
||||
NETWORK
|
||||
data_received..................: 2.6 MB 57 kB/s
|
||||
data_sent......................: 1.3 MB 29 kB/s
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
second,ok,errors,p99_ms,max_ms,4fa49e9e1a53,7b89cf61597b
|
||||
0,151,0,4.9,6.7,76,75
|
||||
1,150,0,6.1,6.7,75,75
|
||||
2,150,0,8.3,9.0,75,75
|
||||
3,150,0,5.8,6.2,75,75
|
||||
4,150,0,5.5,6.4,75,75
|
||||
5,150,0,5.4,5.7,75,75
|
||||
6,150,0,5.4,6.1,75,75
|
||||
7,150,0,5.5,6.1,75,75
|
||||
8,150,0,6.8,7.2,75,75
|
||||
9,150,0,7.0,7.8,75,75
|
||||
10,96,0,9.1,9.1,19,77
|
||||
11,104,0,1010.4,1012.0,0,104
|
||||
12,209,0,1006.0,1006.3,0,209
|
||||
13,162,0,1004.9,1005.5,0,162
|
||||
14,149,0,5.8,6.0,0,149
|
||||
15,151,0,3.7,3.8,0,151
|
||||
16,150,0,4.6,6.1,0,150
|
||||
17,150,0,5.4,6.2,0,150
|
||||
18,150,0,5.5,7.0,0,150
|
||||
19,150,0,6.0,7.1,0,150
|
||||
20,149,0,5.8,7.3,0,149
|
||||
21,151,0,6.5,6.9,0,151
|
||||
22,150,0,5.5,5.7,0,150
|
||||
23,149,0,6.4,6.6,0,149
|
||||
24,151,0,11.2,13.3,0,151
|
||||
25,150,0,11.7,14.0,0,150
|
||||
26,150,0,4.3,5.2,0,150
|
||||
27,150,0,6.2,6.2,0,150
|
||||
28,133,0,6.0,7.3,0,133
|
||||
29,167,0,694.4,717.1,92,75
|
||||
30,150,0,5.9,7.7,75,75
|
||||
31,148,0,8.0,33.2,74,74
|
||||
32,152,0,6.2,23.0,76,76
|
||||
33,150,0,5.5,6.5,75,75
|
||||
34,150,0,29.7,35.8,75,75
|
||||
35,150,0,4.9,6.4,75,75
|
||||
36,150,0,5.1,5.2,75,75
|
||||
37,150,0,4.9,5.2,75,75
|
||||
38,150,0,4.9,5.7,75,75
|
||||
39,149,0,5.3,5.7,75,74
|
||||
40,151,0,5.9,6.7,75,76
|
||||
41,149,0,4.4,4.4,75,74
|
||||
42,151,0,9.9,10.7,75,76
|
||||
43,150,0,8.5,8.9,75,75
|
||||
44,150,0,5.5,6.2,75,75
|
||||
|
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"requests": 6722,
|
||||
"ok": 6722,
|
||||
"errors": 0,
|
||||
"error_codes": {},
|
||||
"ok_rps": 149.4,
|
||||
"p50_ms": 1.7,
|
||||
"p95_ms": 5.4,
|
||||
"p99_ms": 1003.5,
|
||||
"max_ms": 1012.0,
|
||||
"requests_per_instance": {
|
||||
"4fa49e9e1a53": 1987,
|
||||
"7b89cf61597b": 4735
|
||||
},
|
||||
"event_load_start_s": 0.18,
|
||||
"event_fault_s": 10.23,
|
||||
"event_fault_done_s": 10.4,
|
||||
"event_restore_begin_s": 25.23,
|
||||
"event_restore_healthy_s": 27.71,
|
||||
"errors_after_fault": 0,
|
||||
"last_error_after_fault_s": null,
|
||||
"target_last_response_after_fault_s": 0.02,
|
||||
"restored_replica_first_response_after_start_s": 3.86,
|
||||
"lb_marked_down_after_fault_s": 1.92,
|
||||
"lb_marked_up_after_start_s": 3.54
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{"mode": "stop", "target": "api-1", "target_instance": "7b89cf61597b", "restored_instance": "7b89cf61597b",
|
||||
"load_start": 1792755143191, "fault": 1792755153238, "fault_done": 1792755158479, "restore_begin": 1792755168242, "restore_healthy": 1792755170683}
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
█ TOTAL RESULTS
|
||||
|
||||
CUSTOM
|
||||
served_by......................: 6750 143.513142/s
|
||||
|
||||
HTTP
|
||||
http_req_duration..............: avg=5.21ms med=2.03ms p(95)=5.28ms p(99)=66.29ms max=608.68ms
|
||||
{ expected_response:true }...: avg=5.21ms med=2.03ms p(95)=5.28ms p(99)=66.29ms max=608.68ms
|
||||
http_req_failed................: 0.00% 0 out of 6771
|
||||
http_reqs......................: 6771 143.959628/s
|
||||
|
||||
EXECUTION
|
||||
iteration_duration.............: avg=5.13ms med=2.21ms p(95)=5.47ms p(99)=48.43ms max=608.87ms
|
||||
iterations.....................: 6750 143.513142/s
|
||||
vus............................: 2 min=0 max=26
|
||||
vus_max........................: 50 min=50 max=50
|
||||
|
||||
NETWORK
|
||||
data_received..................: 2.6 MB 56 kB/s
|
||||
data_sent......................: 1.4 MB 29 kB/s
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
second,ok,errors,p99_ms,max_ms,4fa49e9e1a53,7b89cf61597b
|
||||
0,153,0,205.2,220.8,77,76
|
||||
1,150,0,7.0,7.7,75,75
|
||||
2,150,0,7.3,16.6,75,75
|
||||
3,150,0,5.6,6.1,75,75
|
||||
4,150,0,6.3,6.6,75,75
|
||||
5,150,0,30.2,41.5,75,75
|
||||
6,150,0,7.4,7.8,75,75
|
||||
7,150,0,7.0,7.3,75,75
|
||||
8,150,0,58.5,73.3,75,75
|
||||
9,150,0,5.7,7.0,75,75
|
||||
10,150,0,5.7,7.6,75,75
|
||||
11,150,0,5.8,6.1,75,75
|
||||
12,150,0,25.5,29.9,134,16
|
||||
13,150,0,5.8,6.6,150,0
|
||||
14,150,0,4.9,5.5,150,0
|
||||
15,150,0,4.6,5.3,150,0
|
||||
16,150,0,11.3,14.1,150,0
|
||||
17,150,0,4.4,5.2,150,0
|
||||
18,150,0,5.0,6.8,150,0
|
||||
19,150,0,6.2,7.2,150,0
|
||||
20,150,0,6.6,6.9,150,0
|
||||
21,150,0,6.7,8.5,150,0
|
||||
22,151,0,7.8,12.3,151,0
|
||||
23,150,0,5.0,11.3,150,0
|
||||
24,149,0,20.5,27.7,149,0
|
||||
25,150,0,5.7,6.3,150,0
|
||||
26,150,0,7.8,8.4,150,0
|
||||
27,150,0,6.6,10.4,150,0
|
||||
28,151,0,4.4,8.2,151,0
|
||||
29,120,0,543.2,554.2,103,17
|
||||
30,180,0,602.9,608.7,75,105
|
||||
31,149,0,5.9,8.8,74,75
|
||||
32,150,0,18.6,31.4,75,75
|
||||
33,150,0,5.2,5.6,75,75
|
||||
34,150,0,5.9,6.0,75,75
|
||||
35,150,0,7.6,9.4,75,75
|
||||
36,150,0,4.6,4.7,75,75
|
||||
37,150,0,4.0,5.1,75,75
|
||||
38,150,0,5.5,7.1,75,75
|
||||
39,151,0,4.9,5.0,76,75
|
||||
40,149,0,7.3,7.6,74,75
|
||||
41,150,0,7.4,16.1,75,75
|
||||
42,150,0,6.8,13.7,75,75
|
||||
43,150,0,5.7,9.3,75,75
|
||||
44,147,0,45.7,53.5,74,73
|
||||
|
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"requests": 6750,
|
||||
"ok": 6750,
|
||||
"errors": 0,
|
||||
"error_codes": {},
|
||||
"ok_rps": 150.0,
|
||||
"p50_ms": 2.0,
|
||||
"p95_ms": 5.2,
|
||||
"p99_ms": 48.3,
|
||||
"max_ms": 608.7,
|
||||
"requests_per_instance": {
|
||||
"7b89cf61597b": 2087,
|
||||
"4fa49e9e1a53": 4663
|
||||
},
|
||||
"event_load_start_s": 1.08,
|
||||
"event_fault_s": 11.13,
|
||||
"event_fault_done_s": 16.37,
|
||||
"event_restore_begin_s": 26.13,
|
||||
"event_restore_healthy_s": 28.57,
|
||||
"errors_after_fault": 0,
|
||||
"last_error_after_fault_s": null,
|
||||
"target_last_response_after_fault_s": 1.07,
|
||||
"restored_replica_first_response_after_start_s": 3.8,
|
||||
"lb_marked_down_after_fault_s": 1.08,
|
||||
"lb_marked_up_after_start_s": 3.24
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{"mode": "stop", "target": "api-2", "target_instance": "4fa49e9e1a53", "restored_instance": "4fa49e9e1a53",
|
||||
"load_start": 1792755193214, "fault": 1792755203249, "fault_done": 1792755207464, "restore_begin": 1792755218279, "restore_healthy": 1792755220771}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
█ TOTAL RESULTS
|
||||
|
||||
CUSTOM
|
||||
served_by......................: 6743 145.744963/s
|
||||
|
||||
HTTP
|
||||
http_req_duration..............: avg=8.51ms med=1.69ms p(95)=5.01ms p(99)=161.63ms max=1.04s
|
||||
{ expected_response:true }...: avg=8.51ms med=1.69ms p(95)=5.01ms p(99)=161.63ms max=1.04s
|
||||
http_req_failed................: 0.00% 0 out of 6764
|
||||
http_reqs......................: 6764 146.198862/s
|
||||
|
||||
EXECUTION
|
||||
dropped_iterations.............: 8 0.172914/s
|
||||
iteration_duration.............: avg=8.54ms med=1.88ms p(95)=5.16ms p(99)=156.59ms max=1.04s
|
||||
iterations.....................: 6743 145.744963/s
|
||||
vus............................: 0 min=0 max=28
|
||||
vus_max........................: 58 min=50 max=58
|
||||
|
||||
NETWORK
|
||||
data_received..................: 2.6 MB 56 kB/s
|
||||
data_sent......................: 1.4 MB 29 kB/s
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
second,ok,errors,p99_ms,max_ms,4fa49e9e1a53,7b89cf61597b
|
||||
0,151,0,5.3,5.3,76,75
|
||||
1,150,0,5.6,6.0,75,75
|
||||
2,150,0,10.9,11.6,75,75
|
||||
3,150,0,9.9,10.0,75,75
|
||||
4,150,0,10.2,12.3,75,75
|
||||
5,150,0,6.3,7.4,75,75
|
||||
6,150,0,5.7,6.3,75,75
|
||||
7,150,0,8.4,16.2,75,75
|
||||
8,149,0,6.0,7.9,74,75
|
||||
9,151,0,4.2,5.4,76,75
|
||||
10,150,0,4.3,4.4,75,75
|
||||
11,150,0,8.1,12.1,75,75
|
||||
12,150,0,6.8,10.4,44,106
|
||||
13,150,0,5.7,5.9,0,150
|
||||
14,150,0,5.6,6.2,0,150
|
||||
15,150,0,4.9,5.9,0,150
|
||||
16,150,0,4.4,4.9,0,150
|
||||
17,150,0,4.4,4.8,0,150
|
||||
18,150,0,5.9,6.1,0,150
|
||||
19,150,0,5.7,10.8,0,150
|
||||
20,150,0,5.8,5.8,0,150
|
||||
21,149,0,6.2,7.7,0,149
|
||||
22,150,0,8.5,11.4,0,150
|
||||
23,151,0,5.0,5.4,0,151
|
||||
24,150,0,5.1,5.1,0,150
|
||||
25,150,0,6.0,8.8,0,150
|
||||
26,150,0,4.9,6.9,0,150
|
||||
27,119,0,4.0,5.5,0,119
|
||||
28,172,0,1038.9,1043.4,101,71
|
||||
29,151,0,53.1,64.8,76,75
|
||||
30,150,0,6.5,7.6,75,75
|
||||
31,150,0,6.1,7.2,75,75
|
||||
32,150,0,7.6,8.6,75,75
|
||||
33,150,0,5.7,11.9,75,75
|
||||
34,150,0,6.1,8.2,75,75
|
||||
35,150,0,7.8,10.4,75,75
|
||||
36,150,0,5.1,5.1,75,75
|
||||
37,150,0,5.0,6.6,75,75
|
||||
38,150,0,7.3,8.7,75,75
|
||||
39,150,0,5.8,5.8,75,75
|
||||
40,150,0,5.3,5.5,75,75
|
||||
41,150,0,4.2,4.6,75,75
|
||||
42,150,0,10.8,11.4,75,75
|
||||
43,150,0,5.5,5.6,75,75
|
||||
44,150,0,7.1,8.6,75,75
|
||||
|
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"requests": 6743,
|
||||
"ok": 6743,
|
||||
"errors": 0,
|
||||
"error_codes": {},
|
||||
"ok_rps": 149.8,
|
||||
"p50_ms": 1.7,
|
||||
"p95_ms": 4.9,
|
||||
"p99_ms": 161.6,
|
||||
"max_ms": 1043.4,
|
||||
"requests_per_instance": {
|
||||
"4fa49e9e1a53": 2247,
|
||||
"7b89cf61597b": 4496
|
||||
},
|
||||
"event_load_start_s": 0.87,
|
||||
"event_fault_s": 10.9,
|
||||
"event_fault_done_s": 15.12,
|
||||
"event_restore_begin_s": 25.93,
|
||||
"event_restore_healthy_s": 28.43,
|
||||
"errors_after_fault": 0,
|
||||
"last_error_after_fault_s": null,
|
||||
"target_last_response_after_fault_s": 1.68,
|
||||
"restored_replica_first_response_after_start_s": 2.41,
|
||||
"lb_marked_down_after_fault_s": 1.69,
|
||||
"lb_marked_up_after_start_s": null
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"load_start": 1792755359464, "rolling_begin": 1792755369523, "rolling_end": 1792755395558}
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
█ TOTAL RESULTS
|
||||
|
||||
CUSTOM
|
||||
served_by......................: 10501 148.101961/s
|
||||
|
||||
HTTP
|
||||
http_req_duration..............: avg=3.73ms med=1.88ms p(95)=4.77ms p(99)=14.85ms max=625.43ms
|
||||
{ expected_response:true }...: avg=3.73ms med=1.88ms p(95)=4.77ms p(99)=14.85ms max=625.43ms
|
||||
http_req_failed................: 0.00% 0 out of 10522
|
||||
http_reqs......................: 10522 148.398137/s
|
||||
|
||||
EXECUTION
|
||||
iteration_duration.............: avg=3.84ms med=2.06ms p(95)=4.98ms p(99)=12ms max=625.53ms
|
||||
iterations.....................: 10501 148.101961/s
|
||||
vus............................: 0 min=0 max=27
|
||||
vus_max........................: 50 min=50 max=50
|
||||
|
||||
NETWORK
|
||||
data_received..................: 4.1 MB 57 kB/s
|
||||
data_sent......................: 2.1 MB 30 kB/s
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
second,ok,errors,p99_ms,max_ms,1239a2b734c0,4fa49e9e1a53,7b89cf61597b,d23287559687
|
||||
0,151,0,5.5,9.0,0,75,76,0
|
||||
1,150,0,5.1,7.0,0,75,75,0
|
||||
2,150,0,9.8,10.3,0,75,75,0
|
||||
3,150,0,5.7,6.4,0,75,75,0
|
||||
4,150,0,6.9,7.0,0,75,75,0
|
||||
5,150,0,6.3,9.4,0,75,75,0
|
||||
6,150,0,4.6,6.8,0,75,75,0
|
||||
7,150,0,5.6,6.0,0,75,75,0
|
||||
8,150,0,17.0,22.8,0,75,75,0
|
||||
9,150,0,7.7,9.3,0,75,75,0
|
||||
10,150,0,4.6,5.3,0,75,75,0
|
||||
11,150,0,4.5,6.2,0,75,75,0
|
||||
12,150,0,4.3,4.4,0,75,75,0
|
||||
13,150,0,6.1,10.7,0,75,75,0
|
||||
14,150,0,17.3,25.9,0,75,75,0
|
||||
15,150,0,9.2,16.0,0,75,75,0
|
||||
16,150,0,4.2,4.5,0,75,75,0
|
||||
17,149,0,13.0,21.3,0,75,74,0
|
||||
18,151,0,13.5,13.8,0,75,76,0
|
||||
19,150,0,4.6,4.6,0,75,75,0
|
||||
20,149,0,6.1,11.1,0,75,74,0
|
||||
21,129,0,8.7,11.5,0,64,65,0
|
||||
22,172,0,586.0,625.4,0,50,50,72
|
||||
23,150,0,8.1,10.9,0,68,14,68
|
||||
24,150,0,5.0,5.4,0,75,0,75
|
||||
25,150,0,7.6,12.0,0,75,0,75
|
||||
26,150,0,9.6,10.2,0,75,0,75
|
||||
27,150,0,20.6,22.0,0,75,0,75
|
||||
28,150,0,5.1,7.4,0,75,0,75
|
||||
29,150,0,24.8,27.6,0,75,0,75
|
||||
30,149,0,354.8,406.4,28,61,0,60
|
||||
31,151,0,6.2,6.3,51,50,0,50
|
||||
32,150,0,6.2,7.9,74,1,0,75
|
||||
33,150,0,5.6,6.0,75,0,0,75
|
||||
34,150,0,6.7,7.1,75,0,0,75
|
||||
35,150,0,11.7,13.0,75,0,0,75
|
||||
36,150,0,20.0,28.9,75,0,0,75
|
||||
37,150,0,5.5,6.0,75,0,0,75
|
||||
38,150,0,6.0,6.4,75,0,0,75
|
||||
39,150,0,5.5,5.8,75,0,0,75
|
||||
40,150,0,5.1,5.3,75,0,0,75
|
||||
41,150,0,24.6,37.4,75,0,0,75
|
||||
42,150,0,4.6,7.6,75,0,0,75
|
||||
43,150,0,5.0,6.1,75,0,0,75
|
||||
44,150,0,6.6,7.5,75,0,0,75
|
||||
45,150,0,7.7,11.6,75,0,0,75
|
||||
46,150,0,5.8,5.9,75,0,0,75
|
||||
47,150,0,34.1,39.4,75,0,0,75
|
||||
48,150,0,5.3,5.5,75,0,0,75
|
||||
49,150,0,5.2,6.0,75,0,0,75
|
||||
50,150,0,5.3,5.5,75,0,0,75
|
||||
51,150,0,5.7,6.7,75,0,0,75
|
||||
52,150,0,5.8,5.9,75,0,0,75
|
||||
53,150,0,5.7,6.7,75,0,0,75
|
||||
54,150,0,5.5,7.1,75,0,0,75
|
||||
55,150,0,6.5,6.7,75,0,0,75
|
||||
56,149,0,6.7,6.9,75,0,0,74
|
||||
57,151,0,8.0,11.5,75,0,0,76
|
||||
58,150,0,5.3,5.4,75,0,0,75
|
||||
59,150,0,5.6,5.7,75,0,0,75
|
||||
60,150,0,4.3,4.6,75,0,0,75
|
||||
61,150,0,5.9,6.2,75,0,0,75
|
||||
62,150,0,6.1,7.5,75,0,0,75
|
||||
63,150,0,4.5,4.8,75,0,0,75
|
||||
64,150,0,5.5,6.9,75,0,0,75
|
||||
65,150,0,7.2,7.7,75,0,0,75
|
||||
66,150,0,5.0,5.2,75,0,0,75
|
||||
67,150,0,4.2,4.9,75,0,0,75
|
||||
68,150,0,8.6,8.9,75,0,0,75
|
||||
69,150,0,5.8,7.4,75,0,0,75
|
||||
|
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"requests": 10501,
|
||||
"ok": 10501,
|
||||
"errors": 0,
|
||||
"error_codes": {},
|
||||
"ok_rps": 150.0,
|
||||
"p50_ms": 1.9,
|
||||
"p95_ms": 4.7,
|
||||
"p99_ms": 11.7,
|
||||
"max_ms": 625.4,
|
||||
"requests_per_instance": {
|
||||
"7b89cf61597b": 1704,
|
||||
"4fa49e9e1a53": 2319,
|
||||
"d23287559687": 3550,
|
||||
"1239a2b734c0": 2928
|
||||
},
|
||||
"event_load_start_s": 0.33,
|
||||
"event_rolling_begin_s": 10.38,
|
||||
"event_rolling_end_s": 36.42
|
||||
}
|
||||
+14
-14
@@ -1,24 +1,24 @@
|
||||
# before
|
||||
NAME STATE STATUS
|
||||
mtusi-messenger-lab3-api-1 running Up 35 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 running Up 8 seconds (healthy)
|
||||
mtusi-messenger-lab3-lb-1 running Up 2 minutes
|
||||
mtusi-messenger-lab3-migrate-1 exited Exited (0) 7 seconds ago
|
||||
mtusi-messenger-lab3-api-1 running Up 37 seconds (healthy)
|
||||
mtusi-messenger-lab3-api-2 running Up 7 seconds (healthy)
|
||||
mtusi-messenger-lab3-lb-1 running Up About a minute (healthy)
|
||||
mtusi-messenger-lab3-migrate-1 exited Exited (0) 4 seconds ago
|
||||
mtusi-messenger-lab3-postgres-1 running Up 2 minutes (healthy)
|
||||
mtusi-messenger-lab3-redis-1 running Up 2 minutes (healthy)
|
||||
/mtusi-messenger-lab3-api-1 StartedAt=2026-10-22T17:45:06.396826175Z
|
||||
/mtusi-messenger-lab3-api-2 StartedAt=2026-10-22T17:45:33.184696798Z
|
||||
/mtusi-messenger-lab3-lb-1 StartedAt=2026-10-22T17:43:17.31840918Z
|
||||
/mtusi-messenger-lab3-postgres-1 StartedAt=2026-10-22T17:43:04.928814758Z
|
||||
/mtusi-messenger-lab3-redis-1 StartedAt=2026-10-22T17:43:04.927049216Z
|
||||
/mtusi-messenger-lab3-api-1 StartedAt=2026-10-23T11:38:43.02725971Z
|
||||
/mtusi-messenger-lab3-api-2 StartedAt=2026-10-23T11:39:12.251618502Z
|
||||
/mtusi-messenger-lab3-lb-1 StartedAt=2026-10-23T11:37:31.902111428Z
|
||||
/mtusi-messenger-lab3-postgres-1 StartedAt=2026-10-23T11:37:18.99589288Z
|
||||
/mtusi-messenger-lab3-redis-1 StartedAt=2026-10-23T11:37:18.995508005Z
|
||||
|
||||
$ make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
|
||||
# after: every container has a new StartedAt, volume postgres-data is kept
|
||||
/mtusi-messenger-lab3-api-1 StartedAt=2026-10-22T17:45:53.47890296Z
|
||||
/mtusi-messenger-lab3-api-2 StartedAt=2026-10-22T17:45:53.585460419Z
|
||||
/mtusi-messenger-lab3-lb-1 StartedAt=2026-10-22T17:45:59.18815863Z
|
||||
/mtusi-messenger-lab3-postgres-1 StartedAt=2026-10-22T17:45:46.762570055Z
|
||||
/mtusi-messenger-lab3-redis-1 StartedAt=2026-10-22T17:45:46.760974013Z
|
||||
/mtusi-messenger-lab3-api-1 StartedAt=2026-10-23T11:39:37.089275763Z
|
||||
/mtusi-messenger-lab3-api-2 StartedAt=2026-10-23T11:39:37.18606118Z
|
||||
/mtusi-messenger-lab3-lb-1 StartedAt=2026-10-23T11:39:39.805556042Z
|
||||
/mtusi-messenger-lab3-postgres-1 StartedAt=2026-10-23T11:39:26.389951592Z
|
||||
/mtusi-messenger-lab3-redis-1 StartedAt=2026-10-23T11:39:26.38860105Z
|
||||
mtusi-messenger-lab3_postgres-data
|
||||
|
||||
Reference in New Issue
Block a user