ЛР 3 — БПИ2302 — Щербацевич — на 5

This commit is contained in:
2026-11-20 19:55:05 +03:00
parent 7aa4ea541b
commit 0bf67b3e84
18 changed files with 1421 additions and 168 deletions
+23
View File
@@ -0,0 +1,23 @@
messages=10000
-- first page
Limit (cost=0.41..13.09 rows=50 width=35) (actual time=0.029..0.055 rows=50 loops=1)
Buffers: shared hit=5
-> Index Scan using ix_messages_history on messages (cost=0.41..2506.71 rows=9889 width=35) (actual time=0.028..0.049 rows=50 loops=1)
Index Cond: (chat_id = 'f075dcf3-bb90-47bb-be38-504b3d26db6a'::uuid)
Buffers: shared hit=5
Planning:
Buffers: shared hit=104
Planning Time: 0.340 ms
Execution Time: 0.079 ms
-- page after row 5000
Limit (cost=0.41..15.86 rows=50 width=35) (actual time=0.031..0.046 rows=50 loops=1)
Buffers: shared hit=4
-> Index Scan using ix_messages_history on messages (cost=0.41..2383.08 rows=7713 width=35) (actual time=0.029..0.039 rows=50 loops=1)
Index Cond: ((chat_id = 'f075dcf3-bb90-47bb-be38-504b3d26db6a'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.005001+00'::timestamp with time zone, '7e995dee-8c7d-4c9b-a7f7-573c0b88b68b'::uuid)))
Buffers: shared hit=4
Planning:
Buffers: shared hit=103
Planning Time: 0.335 ms
Execution Time: 0.085 ms
+8 -8
View File
@@ -1,23 +1,23 @@
{
"date": "2026-10-30T16:04:19Z",
"date": "2026-11-13T09:51:50Z",
"base_url": "http://127.0.0.1:8080",
"instances": {
"unique_instance_ids": [
"46e274e33049",
"f383126bd2be"
"4f9fc3be2925",
"87a318266c19"
],
"samples": 40,
"counts": {
"46e274e33049": 20,
"f383126bd2be": 20
"4f9fc3be2925": 20,
"87a318266c19": 20
}
},
"idempotent_message_id_present": true,
"concurrent_key": {
"message_id": "1e79d3a4-62ee-405a-917e-5d26042f46a2",
"message_id": "1d400e43-801b-47a4-95f2-93d5eaf5f04f",
"instances": [
"46e274e33049",
"f383126bd2be"
"4f9fc3be2925",
"87a318266c19"
],
"successes": 12
}
+40
View File
@@ -0,0 +1,40 @@
{
"date": "2026-11-13T10:47:37Z",
"base_url": "http://127.0.0.1:8080",
"race": {
"created": 1,
"conflict": 15
},
"rollback": {
"chats_before": 34,
"chats_after": 34,
"title_rows": 0
},
"explain": {
"messages": 10000
},
"expiry_and_migrations": {
"users_before": 108,
"users_after": 109,
"migration": "001_initial.sql\n002_idempotency.sql"
},
"redis_restart": {
"pttl_before_ms": 3582575,
"pttl_after_ms": 3581127
},
"dependency_loss": {
"redis_down": {
"live": 200,
"ready": 503,
"anonymous": 401,
"bearer": 503
},
"postgres_down": {
"live": 200,
"ready": 503,
"anonymous": 401,
"bearer": 503
}
},
"messages_after_postgres_restart": 10000
}
+10 -10
View File
@@ -1,18 +1,18 @@
{
"date": "2026-10-30T16:14:24Z",
"date": "2026-11-13T09:54:05Z",
"replaced": [
"9fe46a8ef3ce",
"4d6d0836aa27"
"4f9fc3be2925",
"87a318266c19"
],
"replicas_before": [
"9fe46a8ef3ce",
"4d6d0836aa27"
"4f9fc3be2925",
"87a318266c19"
],
"replicas_after": [
"eb055e557646",
"5ea08fe69111"
"2644ce84e5ea",
"4a0edb995144"
],
"successful_writes": 1980,
"failed_writes": 24,
"error_ratio": 0.011976
"successful_writes": 1212,
"failed_writes": 26,
"error_ratio": 0.021002
}
+345 -113
View File
@@ -1,45 +1,277 @@
{
"date": "2026-10-30T16:17:53Z",
"hypothesis": "При фиксированном суммарном CPU/RAM добавление API-реплик перестаёт помогать (и может снизить RPS), когда узкое место — CPU процессов API: PostgreSQL на этом профиле не насыщается.",
"date": "2026-11-20T16:28:47Z",
"hypothesis": "Горизонтальное масштабирование ускоряет POST, когда каждая новая реплика приносит СВОЙ CPU (как ещё один сервер). Нарезка одного и того же суммарного CPU на больше копий на одном хосте не масштабирование: RPS не растёт. Потолок тогда ищется у БД/LB/пула на серии с ростом суммарного бюджета.",
"profile": {
"duration_seconds": 20.0,
"concurrency": 8,
"warmup_seconds": 5.0,
"workload": "closed-loop POST /messages through HAProxy"
},
"fixed_total_budget": [
"scale_out_own_cpu": [
{
"elapsed_seconds": 20.907,
"elapsed_seconds": 21.282,
"concurrency": 8,
"successful_requests": 2678,
"successful_requests": 670,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 128.093,
"successful_rps": 31.482,
"successful_latency_ms": {
"p50": 51.921,
"p95": 108.599,
"p99": 156.367
"p50": 191.581,
"p95": 404.512,
"p99": 1111.992
},
"docker_stats": [
{
"name": "mtusi-lab3-api-4",
"cpu": "13.84%",
"mem": "89.5MiB / 512MiB"
"name": "mtusi-lab3-api-5",
"cpu": "0.63%",
"mem": "73.35MiB / 256MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.09%",
"mem": "28.19MiB / 64MiB"
"cpu": "0.20%",
"mem": "38.12MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "0.06%",
"mem": "52.93MiB / 512MiB"
"cpu": "8.83%",
"mem": "71.43MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "2.34%",
"mem": "9.738MiB / 128MiB"
"cpu": "4.57%",
"mem": "11.64MiB / 128MiB"
}
],
"label": "scale-1x0.50",
"replicas": 1,
"cpus_each": 0.5,
"memory_mb_each": 256,
"total_cpu": 0.5,
"total_memory_mb": 256
},
{
"elapsed_seconds": 20.999,
"concurrency": 8,
"successful_requests": 1164,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 55.431,
"successful_latency_ms": {
"p50": 108.652,
"p95": 305.824,
"p99": 397.395
},
"docker_stats": [
{
"name": "mtusi-lab3-api-6",
"cpu": "45.65%",
"mem": "82.82MiB / 256MiB"
},
{
"name": "mtusi-lab3-api-5",
"cpu": "40.86%",
"mem": "87.78MiB / 256MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.22%",
"mem": "38.38MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "0.09%",
"mem": "90.45MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "0.56%",
"mem": "11.62MiB / 128MiB"
}
],
"label": "scale-2x0.50",
"replicas": 2,
"cpus_each": 0.5,
"memory_mb_each": 256,
"total_cpu": 1.0,
"total_memory_mb": 512
},
{
"elapsed_seconds": 21.016,
"concurrency": 8,
"successful_requests": 1697,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 80.747,
"successful_latency_ms": {
"p50": 78.142,
"p95": 209.908,
"p99": 302.912
},
"docker_stats": [
{
"name": "mtusi-lab3-api-7",
"cpu": "42.36%",
"mem": "70.76MiB / 256MiB"
},
{
"name": "mtusi-lab3-api-8",
"cpu": "35.28%",
"mem": "79.51MiB / 256MiB"
},
{
"name": "mtusi-lab3-api-6",
"cpu": "37.01%",
"mem": "70.36MiB / 256MiB"
},
{
"name": "mtusi-lab3-api-5",
"cpu": "36.66%",
"mem": "77.76MiB / 256MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.63%",
"mem": "38.64MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "7.77%",
"mem": "122.5MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "0.58%",
"mem": "11.76MiB / 128MiB"
}
],
"label": "scale-4x0.50",
"replicas": 4,
"cpus_each": 0.5,
"memory_mb_each": 256,
"total_cpu": 2.0,
"total_memory_mb": 1024
},
{
"elapsed_seconds": 21.856,
"concurrency": 8,
"successful_requests": 1518,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 69.454,
"successful_latency_ms": {
"p50": 89.322,
"p95": 190.273,
"p99": 205.464
},
"docker_stats": [
{
"name": "mtusi-lab3-api-5",
"cpu": "52.06%",
"mem": "87.58MiB / 512MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "11.02%",
"mem": "39.48MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "0.07%",
"mem": "76.89MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "0.69%",
"mem": "11.71MiB / 128MiB"
}
],
"label": "scale-1x1.00",
"replicas": 1,
"cpus_each": 1.0,
"memory_mb_each": 512,
"total_cpu": 1.0,
"total_memory_mb": 512
},
{
"elapsed_seconds": 21.894,
"concurrency": 8,
"successful_requests": 2110,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 96.372,
"successful_latency_ms": {
"p50": 55.975,
"p95": 185.862,
"p99": 217.461
},
"docker_stats": [
{
"name": "mtusi-lab3-api-6",
"cpu": "34.19%",
"mem": "84.52MiB / 512MiB"
},
{
"name": "mtusi-lab3-api-5",
"cpu": "0.75%",
"mem": "92.05MiB / 512MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.17%",
"mem": "39.99MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "7.84%",
"mem": "97.84MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "0.59%",
"mem": "12.3MiB / 128MiB"
}
],
"label": "scale-2x1.00",
"replicas": 2,
"cpus_each": 1.0,
"memory_mb_each": 512,
"total_cpu": 2.0,
"total_memory_mb": 1024
}
],
"fixed_total_budget": [
{
"elapsed_seconds": 22.063,
"concurrency": 8,
"successful_requests": 1491,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 67.58,
"successful_latency_ms": {
"p50": 92.179,
"p95": 195.608,
"p99": 216.499
},
"docker_stats": [
{
"name": "mtusi-lab3-api-5",
"cpu": "1.16%",
"mem": "93.65MiB / 512MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.14%",
"mem": "40.46MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "0.38%",
"mem": "81.44MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "5.34%",
"mem": "12.53MiB / 128MiB"
}
],
"label": "fixed-1",
@@ -50,42 +282,42 @@
"total_memory_mb": 512
},
{
"elapsed_seconds": 20.894,
"elapsed_seconds": 21.108,
"concurrency": 8,
"successful_requests": 2246,
"successful_requests": 1083,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 107.496,
"successful_rps": 51.308,
"successful_latency_ms": {
"p50": 71.633,
"p95": 189.116,
"p99": 245.528
"p50": 110.223,
"p95": 299.364,
"p99": 463.741
},
"docker_stats": [
{
"name": "mtusi-lab3-api-5",
"cpu": "24.21%",
"mem": "72.12MiB / 256MiB"
"name": "mtusi-lab3-api-6",
"cpu": "30.22%",
"mem": "81.15MiB / 256MiB"
},
{
"name": "mtusi-lab3-api-4",
"cpu": "0.71%",
"mem": "91.05MiB / 256MiB"
"name": "mtusi-lab3-api-5",
"cpu": "0.69%",
"mem": "95.84MiB / 256MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.31%",
"mem": "28.9MiB / 64MiB"
"cpu": "0.21%",
"mem": "40.92MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "4.47%",
"mem": "73.19MiB / 512MiB"
"cpu": "8.16%",
"mem": "103.1MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "0.33%",
"mem": "9.035MiB / 128MiB"
"cpu": "4.19%",
"mem": "12.3MiB / 128MiB"
}
],
"label": "fixed-2",
@@ -96,52 +328,52 @@
"total_memory_mb": 512
},
{
"elapsed_seconds": 21.006,
"elapsed_seconds": 21.199,
"concurrency": 8,
"successful_requests": 1456,
"successful_requests": 786,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 69.315,
"successful_rps": 37.077,
"successful_latency_ms": {
"p50": 94.785,
"p95": 292.96,
"p99": 400.018
"p50": 114.739,
"p95": 532.515,
"p99": 1304.135
},
"docker_stats": [
{
"name": "mtusi-lab3-api-8",
"cpu": "23.90%",
"mem": "79.59MiB / 128MiB"
},
{
"name": "mtusi-lab3-api-7",
"cpu": "16.08%",
"mem": "79.37MiB / 128MiB"
"cpu": "27.10%",
"mem": "77.96MiB / 128MiB"
},
{
"name": "mtusi-lab3-api-6",
"cpu": "11.19%",
"mem": "76.64MiB / 128MiB"
"cpu": "9.06%",
"mem": "69.91MiB / 128MiB"
},
{
"name": "mtusi-lab3-api-5",
"cpu": "8.82%",
"mem": "83.37MiB / 128MiB"
},
{
"name": "mtusi-lab3-api-4",
"cpu": "5.77%",
"mem": "98.27MiB / 128MiB"
"cpu": "11.39%",
"mem": "88.77MiB / 128MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.48%",
"mem": "29.2MiB / 64MiB"
"cpu": "0.39%",
"mem": "41MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "0.05%",
"mem": "94.67MiB / 512MiB"
"cpu": "13.26%",
"mem": "137.6MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "2.17%",
"mem": "8.914MiB / 128MiB"
"cpu": "0.62%",
"mem": "12.09MiB / 128MiB"
}
],
"label": "fixed-4",
@@ -154,42 +386,42 @@
],
"growing_resources": [
{
"elapsed_seconds": 21.009,
"elapsed_seconds": 21.075,
"concurrency": 8,
"successful_requests": 1031,
"successful_requests": 550,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 49.073,
"successful_rps": 26.097,
"successful_latency_ms": {
"p50": 111.033,
"p95": 302.796,
"p99": 399.196
"p50": 277.91,
"p95": 600.586,
"p99": 801.976
},
"docker_stats": [
{
"name": "mtusi-lab3-api-5",
"cpu": "4.23%",
"mem": "76.67MiB / 128MiB"
"name": "mtusi-lab3-api-6",
"cpu": "15.72%",
"mem": "79.91MiB / 128MiB"
},
{
"name": "mtusi-lab3-api-4",
"cpu": "0.43%",
"mem": "89.02MiB / 128MiB"
"name": "mtusi-lab3-api-5",
"cpu": "10.74%",
"mem": "93.98MiB / 128MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "0.13%",
"mem": "29.92MiB / 64MiB"
"cpu": "0.19%",
"mem": "41.1MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "4.40%",
"mem": "76.54MiB / 512MiB"
"cpu": "8.09%",
"mem": "107.4MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "2.30%",
"mem": "9.145MiB / 128MiB"
"cpu": "0.56%",
"mem": "12.26MiB / 128MiB"
}
],
"label": "grow-2x0.25",
@@ -200,42 +432,42 @@
"total_memory_mb": 256
},
{
"elapsed_seconds": 20.917,
"elapsed_seconds": 21.026,
"concurrency": 8,
"successful_requests": 2206,
"successful_requests": 1181,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 105.463,
"successful_rps": 56.169,
"successful_latency_ms": {
"p50": 75.963,
"p95": 184.365,
"p99": 212.521
"p50": 106.044,
"p95": 295.28,
"p99": 314.704
},
"docker_stats": [
{
"name": "mtusi-lab3-api-5",
"cpu": "0.58%",
"mem": "83.3MiB / 256MiB"
"name": "mtusi-lab3-api-6",
"cpu": "15.99%",
"mem": "81.01MiB / 256MiB"
},
{
"name": "mtusi-lab3-api-4",
"cpu": "18.11%",
"mem": "89.97MiB / 256MiB"
"name": "mtusi-lab3-api-5",
"cpu": "4.97%",
"mem": "85.26MiB / 256MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "4.50%",
"mem": "30.62MiB / 64MiB"
"cpu": "0.76%",
"mem": "41.43MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "0.08%",
"mem": "78.58MiB / 512MiB"
"cpu": "9.65%",
"mem": "108.1MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "0.36%",
"mem": "9.082MiB / 128MiB"
"cpu": "0.59%",
"mem": "12.21MiB / 128MiB"
}
],
"label": "grow-2x0.50",
@@ -246,42 +478,42 @@
"total_memory_mb": 512
},
{
"elapsed_seconds": 20.827,
"elapsed_seconds": 20.989,
"concurrency": 8,
"successful_requests": 4602,
"successful_requests": 2498,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 220.96,
"successful_rps": 119.016,
"successful_latency_ms": {
"p50": 29.331,
"p95": 82.961,
"p99": 105.895
"p50": 50.289,
"p95": 126.45,
"p99": 179.556
},
"docker_stats": [
{
"name": "mtusi-lab3-api-5",
"cpu": "1.21%",
"mem": "87.79MiB / 512MiB"
"name": "mtusi-lab3-api-6",
"cpu": "41.05%",
"mem": "93MiB / 512MiB"
},
{
"name": "mtusi-lab3-api-4",
"cpu": "27.65%",
"mem": "90.96MiB / 512MiB"
"name": "mtusi-lab3-api-5",
"cpu": "1.07%",
"mem": "88.75MiB / 512MiB"
},
{
"name": "mtusi-lab3-lb-1",
"cpu": "5.02%",
"mem": "31.52MiB / 64MiB"
"cpu": "0.24%",
"mem": "42.16MiB / 64MiB"
},
{
"name": "mtusi-lab3-postgres-1",
"cpu": "0.18%",
"mem": "82.41MiB / 512MiB"
"cpu": "0.03%",
"mem": "110.3MiB / 512MiB"
},
{
"name": "mtusi-lab3-redis-1",
"cpu": "0.35%",
"mem": "8.906MiB / 128MiB"
"cpu": "5.42%",
"mem": "12.75MiB / 128MiB"
}
],
"label": "grow-2x1.00",
+22 -7
View File
@@ -1,12 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" width="820" height="420" viewBox="0 0 820 420">
<rect width="100%" height="100%" fill="white"/>
<text x="410.0" y="28" text-anchor="middle" font-size="16" font-weight="700" font-family="Segoe UI, Arial">Fixed total 1.0 CPU and 512 MiB for all API replicas</text>
<line x1="70" y1="50.0" x2="790" y2="50.0" stroke="#e2e8f0"/><text x="62" y="54.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">147</text><line x1="70" y1="125.0" x2="790" y2="125.0" stroke="#e2e8f0"/><text x="62" y="129.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">110</text><line x1="70" y1="200.0" x2="790" y2="200.0" stroke="#e2e8f0"/><text x="62" y="204.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">74</text><line x1="70" y1="275.0" x2="790" y2="275.0" stroke="#e2e8f0"/><text x="62" y="279.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">37</text><line x1="70" y1="350.0" x2="790" y2="350.0" stroke="#e2e8f0"/><text x="62" y="354.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">0</text>
<text x="410.0" y="28" text-anchor="middle" font-size="16" font-weight="700" font-family="Segoe UI, Arial">Fixed total 1.0 CPU split across replicas</text>
<line x1="70" y1="350.0" x2="790" y2="350.0" stroke="#e2e8f0"/>
<text x="62" y="354.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">0</text>
<line x1="70" y1="275.0" x2="790" y2="275.0" stroke="#e2e8f0"/>
<text x="62" y="279.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">19</text>
<line x1="70" y1="200.0" x2="790" y2="200.0" stroke="#e2e8f0"/>
<text x="62" y="204.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">39</text>
<line x1="70" y1="125.0" x2="790" y2="125.0" stroke="#e2e8f0"/>
<text x="62" y="129.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">58</text>
<line x1="70" y1="50.0" x2="790" y2="50.0" stroke="#e2e8f0"/>
<text x="62" y="54.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">78</text>
<line x1="70" y1="50" x2="70" y2="350" stroke="#2d3748"/>
<line x1="70" y1="350" x2="790" y2="350" stroke="#2d3748"/>
<rect x="103.6" y="89.1" width="172.8" height="260.9" fill="#2c5282"/><rect x="343.6" y="131.1" width="172.8" height="218.9" fill="#2c5282"/><rect x="583.6" y="208.8" width="172.8" height="141.2" fill="#2c5282"/>
<text x="190.0" y="81.1" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">128.1</text><text x="430.0" y="123.1" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">107.5</text><text x="670.0" y="200.8" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">69.3</text>
<text x="190.0" y="392" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">1 replica</text><text x="430.0" y="392" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">2 replicas</text><text x="670.0" y="392" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">4 replicas</text>
<text x="410.0" y="412" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial">API replicas (same total CPU/RAM)</text>
<text x="16" y="200.0" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial" transform="rotate(-90 16 200.0)">successful RPS</text>
<rect x="132.4" y="89.1" width="115.2" height="260.9" fill="#c53030"/>
<text x="190.0" y="81.1" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">67.6</text>
<text x="190.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">1</text>
<rect x="372.4" y="151.9" width="115.2" height="198.1" fill="#c53030"/>
<text x="430.0" y="143.9" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">51.3</text>
<text x="430.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">2</text>
<rect x="612.4" y="206.9" width="115.2" height="143.1" fill="#c53030"/>
<text x="670.0" y="198.9" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">37.1</text>
<text x="670.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">4</text>
<text x="410.0" y="412" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial">Replica count at the same total CPU</text>
<text x="16" y="200" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial" transform="rotate(-90 16 200)">successful RPS</text>
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

+20 -5
View File
@@ -1,12 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" width="820" height="420" viewBox="0 0 820 420">
<rect width="100%" height="100%" fill="white"/>
<text x="410.0" y="28" text-anchor="middle" font-size="16" font-weight="700" font-family="Segoe UI, Arial">Two API replicas, growing CPU/RAM budget</text>
<line x1="70" y1="50.0" x2="790" y2="50.0" stroke="#e2e8f0"/><text x="62" y="54.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">254</text><line x1="70" y1="125.0" x2="790" y2="125.0" stroke="#e2e8f0"/><text x="62" y="129.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">191</text><line x1="70" y1="200.0" x2="790" y2="200.0" stroke="#e2e8f0"/><text x="62" y="204.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">127</text><line x1="70" y1="275.0" x2="790" y2="275.0" stroke="#e2e8f0"/><text x="62" y="279.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">64</text><line x1="70" y1="350.0" x2="790" y2="350.0" stroke="#e2e8f0"/><text x="62" y="354.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">0</text>
<line x1="70" y1="350.0" x2="790" y2="350.0" stroke="#e2e8f0"/>
<text x="62" y="354.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">0</text>
<line x1="70" y1="275.0" x2="790" y2="275.0" stroke="#e2e8f0"/>
<text x="62" y="279.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">34</text>
<line x1="70" y1="200.0" x2="790" y2="200.0" stroke="#e2e8f0"/>
<text x="62" y="204.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">68</text>
<line x1="70" y1="125.0" x2="790" y2="125.0" stroke="#e2e8f0"/>
<text x="62" y="129.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">103</text>
<line x1="70" y1="50.0" x2="790" y2="50.0" stroke="#e2e8f0"/>
<text x="62" y="54.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">137</text>
<line x1="70" y1="50" x2="70" y2="350" stroke="#2d3748"/>
<line x1="70" y1="350" x2="790" y2="350" stroke="#2d3748"/>
<rect x="103.6" y="292.1" width="172.8" height="57.9" fill="#2c5282"/><rect x="343.6" y="225.5" width="172.8" height="124.5" fill="#2c5282"/><rect x="583.6" y="89.1" width="172.8" height="260.9" fill="#2c5282"/>
<text x="190.0" y="284.1" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">49.1</text><text x="430.0" y="217.5" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">105.5</text><text x="670.0" y="81.1" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">221.0</text>
<text x="190.0" y="392" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">0.50 CPU</text><text x="430.0" y="392" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">1.00 CPU</text><text x="670.0" y="392" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">2.00 CPU</text>
<rect x="132.4" y="292.8" width="115.2" height="57.2" fill="#2c5282"/>
<text x="190.0" y="284.8" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">26.1</text>
<text x="190.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">0,50 CPU</text>
<rect x="372.4" y="226.9" width="115.2" height="123.1" fill="#2c5282"/>
<text x="430.0" y="218.9" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">56.2</text>
<text x="430.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">1,00 CPU</text>
<rect x="612.4" y="89.1" width="115.2" height="260.9" fill="#2c5282"/>
<text x="670.0" y="81.1" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">119.0</text>
<text x="670.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">2,00 CPU</text>
<text x="410.0" y="412" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial">Total CPU for two replicas</text>
<text x="16" y="200.0" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial" transform="rotate(-90 16 200.0)">successful RPS</text>
<text x="16" y="200" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial" transform="rotate(-90 16 200)">successful RPS</text>
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

+27
View File
@@ -0,0 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" width="820" height="420" viewBox="0 0 820 420">
<rect width="100%" height="100%" fill="white"/>
<text x="410.0" y="28" text-anchor="middle" font-size="16" font-weight="700" font-family="Segoe UI, Arial">Each replica keeps 0.50 CPU (like another server)</text>
<line x1="70" y1="350.0" x2="790" y2="350.0" stroke="#e2e8f0"/>
<text x="62" y="354.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">0</text>
<line x1="70" y1="275.0" x2="790" y2="275.0" stroke="#e2e8f0"/>
<text x="62" y="279.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">23</text>
<line x1="70" y1="200.0" x2="790" y2="200.0" stroke="#e2e8f0"/>
<text x="62" y="204.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">46</text>
<line x1="70" y1="125.0" x2="790" y2="125.0" stroke="#e2e8f0"/>
<text x="62" y="129.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">70</text>
<line x1="70" y1="50.0" x2="790" y2="50.0" stroke="#e2e8f0"/>
<text x="62" y="54.0" text-anchor="end" font-size="11" fill="#4a5568" font-family="Segoe UI, Arial">93</text>
<line x1="70" y1="50" x2="70" y2="350" stroke="#2d3748"/>
<line x1="70" y1="350" x2="790" y2="350" stroke="#2d3748"/>
<rect x="132.4" y="248.3" width="115.2" height="101.7" fill="#276749"/>
<text x="190.0" y="240.3" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">31.5</text>
<text x="190.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">1</text>
<rect x="372.4" y="170.9" width="115.2" height="179.1" fill="#276749"/>
<text x="430.0" y="162.9" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">55.4</text>
<text x="430.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">2</text>
<rect x="612.4" y="89.1" width="115.2" height="260.9" fill="#276749"/>
<text x="670.0" y="81.1" text-anchor="middle" font-size="13" font-family="Segoe UI, Arial">80.7</text>
<text x="670.0" y="392" text-anchor="middle" font-size="12" font-family="Segoe UI, Arial">4</text>
<text x="410.0" y="412" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial">Replicas; total CPU grows 0.5 → 1.0 → 2.0</text>
<text x="16" y="200" text-anchor="middle" font-size="12" fill="#4a5568" font-family="Segoe UI, Arial" transform="rotate(-90 16 200)">successful RPS</text>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB