New Commit

This commit is contained in:
Артём Осипов
2026-11-24 17:37:25 +03:00
parent 0ab3a341aa
commit 6ba974b9ed
117 changed files with 2374 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
FROM python:3.12-slim
WORKDIR /app
ENV PYTHONPATH=/app
RUN apt-get update && apt-get install -y --no-install-recommends \
make \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
COPY requirements.txt requirements-dev.txt ./
RUN pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
COPY src/ ./src/
COPY alembic.ini ./
COPY alembic/ ./alembic/
COPY tests/ ./tests/
COPY scripts/ ./scripts/
COPY contracts/ ./contracts/
COPY Makefile lab.json ./
RUN chown -R appuser:appgroup /app
USER appuser
# Exec-форма: uvicorn получает SIGTERM, перестаёт принимать новые соединения
# и ждёт завершения текущих запросов до 10 секунд. Один воркер на контейнер.
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8080", \
"--workers", "1", "--timeout-graceful-shutdown", "10"]
+149
View File
@@ -0,0 +1,149 @@
# A generic, single database configuration.
[alembic]
# path to migration scripts.
# this is typically a path given in POSIX (e.g. forward slashes)
# format, relative to the token %(here)s which refers to the location of this
# ini file
script_location = %(here)s/alembic
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
# Uncomment the line below if you want the files to be prepended with date and time
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
# for all available tokens
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
# Or organize into date-based subdirectories (requires recursive_version_locations = true)
# file_template = %%(year)d/%%(month).2d/%%(day).2d_%%(hour).2d%%(minute).2d_%%(second).2d_%%(rev)s_%%(slug)s
# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory. for multiple paths, the path separator
# is defined by "path_separator" below.
prepend_sys_path = .
# timezone to use when rendering the date within the migration file
# as well as the filename.
# If specified, requires the tzdata library which can be installed by adding
# `alembic[tz]` to the pip requirements.
# string value is passed to ZoneInfo()
# leave blank for localtime
# timezone =
# max length of characters to apply to the "slug" field
# truncate_slug_length = 40
# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false
# set to 'true' to allow .pyc and .pyo files without
# a source .py file to be detected as revisions in the
# versions/ directory
# sourceless = false
# version location specification; This defaults
# to <script_location>/versions. When using multiple version
# directories, initial revisions must be specified with --version-path.
# The path separator used here should be the separator specified by "path_separator"
# below.
# version_locations = %(here)s/bar:%(here)s/bat:%(here)s/alembic/versions
# path_separator; This indicates what character is used to split lists of file
# paths, including version_locations and prepend_sys_path within configparser
# files such as alembic.ini.
# The default rendered in new alembic.ini files is "os", which uses os.pathsep
# to provide os-dependent path splitting.
#
# Note that in order to support legacy alembic.ini files, this default does NOT
# take place if path_separator is not present in alembic.ini. If this
# option is omitted entirely, fallback logic is as follows:
#
# 1. Parsing of the version_locations option falls back to using the legacy
# "version_path_separator" key, which if absent then falls back to the legacy
# behavior of splitting on spaces and/or commas.
# 2. Parsing of the prepend_sys_path option falls back to the legacy
# behavior of splitting on spaces, commas, or colons.
#
# Valid values for path_separator are:
#
# path_separator = :
# path_separator = ;
# path_separator = space
# path_separator = newline
#
# Use os.pathsep. Default configuration used for new projects.
path_separator = os
# set to 'true' to search source files recursively
# in each "version_locations" directory
# new in Alembic version 1.10
# recursive_version_locations = false
# the output encoding used when revision files
# are written from script.py.mako
# output_encoding = utf-8
# database URL. This is consumed by the user-maintained env.py script only.
# other means of configuring database URLs may be customized within the env.py
# file.
sqlalchemy.url = postgresql+asyncpg://app_user:secure_password_123@localhost:5432/messenger_db
[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
# on newly generated revision scripts. See the documentation for further
# detail and examples
# format using "black" - use the console_scripts runner, against the "black" entrypoint
# hooks = black
# black.type = console_scripts
# black.entrypoint = black
# black.options = -l 79 REVISION_SCRIPT_FILENAME
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
# hooks = ruff
# ruff.type = module
# ruff.module = ruff
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
# Alternatively, use the exec runner to execute a binary found on your PATH
# hooks = ruff
# ruff.type = exec
# ruff.executable = ruff
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
# Logging configuration. This is also consumed by the user-maintained
# env.py script only.
[loggers]
keys = root,sqlalchemy,alembic
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARNING
handlers = console
qualname =
[logger_sqlalchemy]
level = WARNING
handlers =
qualname = sqlalchemy.engine
[logger_alembic]
level = INFO
handlers =
qualname = alembic
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
+1
View File
@@ -0,0 +1 @@
Generic single-database configuration.
+61
View File
@@ -0,0 +1,61 @@
import asyncio
from logging.config import fileConfig
from sqlalchemy import pool
from sqlalchemy.engine import Connection
from sqlalchemy.ext.asyncio import async_engine_from_config
from alembic import context
# DATABASE_URL берётся из окружения (см. src/database.py)
from src.database import DATABASE_URL, Base
from src import models # noqa: F401 нужно, чтобы Alembic "увидел" таблицы
config = context.config
if config.config_file_name is not None:
fileConfig(config.config_file_name)
target_metadata = Base.metadata
# % экранируем, иначе configparser воспримет его как интерполяцию
config.set_main_option("sqlalchemy.url", DATABASE_URL.replace("%", "%%"))
def run_migrations_offline() -> None:
url = config.get_main_option("sqlalchemy.url")
context.configure(
url=url,
target_metadata=target_metadata,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
)
with context.begin_transaction():
context.run_migrations()
def do_run_migrations(connection: Connection) -> None:
context.configure(connection=connection, target_metadata=target_metadata)
with context.begin_transaction():
context.run_migrations()
async def run_async_migrations() -> None:
connectable = async_engine_from_config(
config.get_section(config.config_ini_section, {}),
prefix="sqlalchemy.",
poolclass=pool.NullPool,
)
async with connectable.connect() as connection:
await connection.run_sync(do_run_migrations)
await connectable.dispose()
def run_migrations_online() -> None:
asyncio.run(run_async_migrations())
if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()
+28
View File
@@ -0,0 +1,28 @@
"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
# revision identifiers, used by Alembic.
revision: str = ${repr(up_revision)}
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
def upgrade() -> None:
"""Upgrade schema."""
${upgrades if upgrades else "pass"}
def downgrade() -> None:
"""Downgrade schema."""
${downgrades if downgrades else "pass"}
@@ -0,0 +1,34 @@
"""idempotency keys
Revision ID: a1b2c3d4e5f6
Revises: d74c0ccadc85
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
revision: str = "a1b2c3d4e5f6"
down_revision: Union[str, Sequence[str], None] = "b7e1f3a9c2d4"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.create_table(
"idempotency_keys",
sa.Column("user_id", sa.UUID(), nullable=False),
sa.Column("method", sa.String(length=8), nullable=False),
sa.Column("path", sa.String(length=255), nullable=False),
sa.Column("key", sa.String(length=128), nullable=False),
sa.Column("request_hash", sa.String(length=64), nullable=False),
sa.Column("response_body", sa.Text(), nullable=True),
sa.Column("created_at", sa.DateTime(timezone=True),
server_default=sa.text("now()"), nullable=False),
sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="CASCADE"),
sa.PrimaryKeyConstraint("user_id", "method", "path", "key"),
)
def downgrade() -> None:
op.drop_table("idempotency_keys")
@@ -0,0 +1,27 @@
"""messages history index
Revision ID: b7e1f3a9c2d4
Revises: d74c0ccadc85
Create Date: 2026-11-06 12:00:00
"""
from typing import Sequence, Union
from alembic import op
revision: str = "b7e1f3a9c2d4"
down_revision: Union[str, Sequence[str], None] = "d74c0ccadc85"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# Запрос истории: WHERE chat_id = ? AND (created_at, id) > (?, ?) ORDER BY created_at, id
op.create_index("ix_messages_chat_created_id", "messages", ["chat_id", "created_at", "id"])
op.drop_index("ix_messages_chat_id", table_name="messages") # префикс нового индекса
op.drop_index("ix_messages_created_at", table_name="messages") # для этого запроса бесполезен
def downgrade() -> None:
op.create_index("ix_messages_created_at", "messages", ["created_at"])
op.create_index("ix_messages_chat_id", "messages", ["chat_id"])
op.drop_index("ix_messages_chat_created_id", table_name="messages")
@@ -0,0 +1,84 @@
"""initial tables
Revision ID: d74c0ccadc85
Revises:
Create Date: 2026-11-03 11:36:06.290700
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'd74c0ccadc85'
down_revision: Union[str, Sequence[str], None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('chats',
sa.Column('id', sa.UUID(), nullable=False),
sa.Column('title', sa.String(length=100), nullable=False),
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('users',
sa.Column('id', sa.UUID(), nullable=False),
sa.Column('username', sa.String(length=32), nullable=False),
sa.Column('display_name', sa.String(length=100), nullable=False),
sa.Column('password_hash', sa.String(length=255), nullable=False),
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=True)
op.create_table('chat_members',
sa.Column('chat_id', sa.UUID(), nullable=False),
sa.Column('user_id', sa.UUID(), nullable=False),
sa.Column('joined_at', sa.DateTime(timezone=True), nullable=True),
sa.ForeignKeyConstraint(['chat_id'], ['chats.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('chat_id', 'user_id')
)
op.create_table('messages',
sa.Column('id', sa.UUID(), nullable=False),
sa.Column('chat_id', sa.UUID(), nullable=False),
sa.Column('sender_id', sa.UUID(), nullable=False),
sa.Column('text', sa.Text(), nullable=False),
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
sa.ForeignKeyConstraint(['chat_id'], ['chats.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['sender_id'], ['users.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_messages_chat_id'), 'messages', ['chat_id'], unique=False)
op.create_index(op.f('ix_messages_created_at'), 'messages', ['created_at'], unique=False)
op.create_table('sessions',
sa.Column('id', sa.UUID(), nullable=False),
sa.Column('user_id', sa.UUID(), nullable=False),
sa.Column('token', sa.String(length=255), nullable=False),
sa.Column('expires_at', sa.DateTime(timezone=True), nullable=False),
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_sessions_token'), 'sessions', ['token'], unique=True)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_sessions_token'), table_name='sessions')
op.drop_table('sessions')
op.drop_index(op.f('ix_messages_created_at'), table_name='messages')
op.drop_index(op.f('ix_messages_chat_id'), table_name='messages')
op.drop_table('messages')
op.drop_table('chat_members')
op.drop_index(op.f('ix_users_username'), table_name='users')
op.drop_table('users')
op.drop_table('chats')
# ### end Alembic commands ###
+83
View File
@@ -0,0 +1,83 @@
x-app-env: &app-env
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-messenger_db}
REDIS_URL: redis://valkey:6379/0
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
SESSION_CACHE_TTL_SECONDS: ${SESSION_CACHE_TTL_SECONDS:-30}
DB_POOL_SIZE: ${DB_POOL_SIZE:-10}
DB_MAX_OVERFLOW: ${DB_MAX_OVERFLOW:-10}
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-messenger_db}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 3s
retries: 5
valkey:
image: valkey/valkey:8.0-alpine
# Кэш сессий: источник истины - PostgreSQL, persistence не нужен.
command: ["valkey-server", "--save", "", "--appendonly", "no",
"--maxmemory", "64mb", "--maxmemory-policy", "allkeys-lru"]
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# Миграции выполняются один раз, до старта любой реплики API
migrate:
build: .
image: messenger-api:lab3
command: ["alembic", "upgrade", "head"]
environment: *app-env
depends_on:
db:
condition: service_healthy
restart: "no"
app:
build: .
image: messenger-api:lab3
environment: *app-env
expose:
- "8080" # порт наружу не публикуем: вход только через lb
deploy:
replicas: 2
resources:
limits:
cpus: "${APP_CPUS:-0.50}"
memory: 256M
stop_grace_period: 15s
depends_on:
migrate:
condition: service_completed_successfully
valkey:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health/ready"]
interval: 5s
timeout: 3s
retries: 3
lb:
image: haproxy:2.9-alpine
ports:
- "8080:8080"
volumes:
- ./infra/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
depends_on:
app:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
+4
View File
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 118, "failed_attempts": 0, "first_recovery_seconds": 1.483}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+4
View File
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 118, "failed_attempts": 0, "first_recovery_seconds": 1.485}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
@@ -0,0 +1,2 @@
CPUs: 12
Total Memory: 7.75GiB
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.038,
"concurrency": 32,
"successful_requests": 19889,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 662.133,
"successful_latency_ms": {
"p50": 43.139,
"p95": 98.429,
"p99": 107.096
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-5 cpu=100.37% mem=105.4MiB / 256MiB
mtusi2026lab3-lb-1 cpu=14.88% mem=110.1MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=20.20% mem=106.1MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.98% mem=9.773MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.046,
"concurrency": 32,
"successful_requests": 19469,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 647.971,
"successful_latency_ms": {
"p50": 44.074,
"p95": 100.303,
"p99": 108.524
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-5 cpu=100.95% mem=106MiB / 256MiB
mtusi2026lab3-lb-1 cpu=15.33% mem=110.4MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=18.66% mem=107.6MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.92% mem=9.711MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.032,
"concurrency": 32,
"successful_requests": 18864,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 628.123,
"successful_latency_ms": {
"p50": 45.384,
"p95": 102.428,
"p99": 116.253
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-5 cpu=100.05% mem=106MiB / 256MiB
mtusi2026lab3-lb-1 cpu=15.54% mem=110.4MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=19.48% mem=107.5MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.92% mem=9.699MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.035,
"concurrency": 32,
"successful_requests": 28896,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 962.077,
"successful_latency_ms": {
"p50": 27.839,
"p95": 75.72,
"p99": 106.223
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-6 cpu=100.39% mem=97.29MiB / 256MiB
mtusi2026lab3-app-5 cpu=80.59% mem=97.98MiB / 256MiB
mtusi2026lab3-lb-1 cpu=17.68% mem=110.4MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=26.19% mem=106.2MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.56% mem=9.754MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.05,
"concurrency": 32,
"successful_requests": 27821,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 925.836,
"successful_latency_ms": {
"p50": 29.152,
"p95": 79.038,
"p99": 111.587
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-6 cpu=83.18% mem=98.46MiB / 256MiB
mtusi2026lab3-app-5 cpu=99.80% mem=99.26MiB / 256MiB
mtusi2026lab3-lb-1 cpu=17.79% mem=110.2MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=26.26% mem=106.3MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.68% mem=9.785MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.036,
"concurrency": 32,
"successful_requests": 27584,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 918.375,
"successful_latency_ms": {
"p50": 29.293,
"p95": 79.995,
"p99": 114.898
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-6 cpu=99.78% mem=99.18MiB / 256MiB
mtusi2026lab3-app-5 cpu=84.30% mem=99.17MiB / 256MiB
mtusi2026lab3-lb-1 cpu=18.03% mem=110.6MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=27.52% mem=107.1MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.85% mem=9.773MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.062,
"concurrency": 32,
"successful_requests": 39847,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1325.516,
"successful_latency_ms": {
"p50": 5.243,
"p95": 85.063,
"p99": 139.199
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-8 cpu=100.45% mem=87.41MiB / 256MiB
mtusi2026lab3-app-6 cpu=72.75% mem=87.67MiB / 256MiB
mtusi2026lab3-app-5 cpu=72.16% mem=87.84MiB / 256MiB
mtusi2026lab3-app-7 cpu=71.99% mem=87.14MiB / 256MiB
mtusi2026lab3-lb-1 cpu=29.39% mem=110.7MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=48.20% mem=106.7MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=3.03% mem=9.949MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.037,
"concurrency": 32,
"successful_requests": 35253,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1173.667,
"successful_latency_ms": {
"p50": 13.408,
"p95": 84.216,
"p99": 129.478
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-8 cpu=94.36% mem=88.61MiB / 256MiB
mtusi2026lab3-app-6 cpu=84.66% mem=89.95MiB / 256MiB
mtusi2026lab3-app-5 cpu=76.76% mem=89.75MiB / 256MiB
mtusi2026lab3-app-7 cpu=76.73% mem=88.91MiB / 256MiB
mtusi2026lab3-lb-1 cpu=33.58% mem=110.7MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=313.38% mem=109.4MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=4.54% mem=9.855MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.033,
"concurrency": 32,
"successful_requests": 39370,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1310.873,
"successful_latency_ms": {
"p50": 5.483,
"p95": 86.353,
"p99": 139.393
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-8 cpu=71.64% mem=88.46MiB / 256MiB
mtusi2026lab3-app-6 cpu=100.29% mem=90.23MiB / 256MiB
mtusi2026lab3-app-5 cpu=74.99% mem=89.72MiB / 256MiB
mtusi2026lab3-app-7 cpu=72.07% mem=88.71MiB / 256MiB
mtusi2026lab3-lb-1 cpu=29.64% mem=110.5MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=46.94% mem=109.6MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=2.92% mem=9.887MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,5 @@
| Реплик | RPS (мед.) | p50, мс | p95, мс | p99, мс | Ошибок, % |
|---|---|---|---|---|---|
| 1 | 648.0 | 44.1 | 100.3 | 108.5 | 0.00 |
| 2 | 925.8 | 29.2 | 79.0 | 111.6 | 0.00 |
| 4 | 1310.9 | 5.5 | 85.1 | 139.2 | 0.00 |
@@ -0,0 +1,2 @@
CPUs: 12
Total Memory: 7.75GiB
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.039,
"concurrency": 32,
"successful_requests": 17540,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 583.91,
"successful_latency_ms": {
"p50": 50.91,
"p95": 96.323,
"p99": 103.286
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-4 cpu=99.72% mem=101.4MiB / 256MiB
mtusi2026lab3-lb-1 cpu=13.26% mem=110.3MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=20.31% mem=94.52MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.95% mem=9.594MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.086,
"concurrency": 32,
"successful_requests": 17420,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 579.006,
"successful_latency_ms": {
"p50": 51.182,
"p95": 98.205,
"p99": 106.041
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-4 cpu=99.81% mem=102.3MiB / 256MiB
mtusi2026lab3-lb-1 cpu=12.24% mem=110.7MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=18.55% mem=94.91MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.81% mem=9.539MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.035,
"concurrency": 32,
"successful_requests": 17183,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 572.107,
"successful_latency_ms": {
"p50": 51.835,
"p95": 99.335,
"p99": 105.482
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-4 cpu=100.15% mem=102.2MiB / 256MiB
mtusi2026lab3-lb-1 cpu=13.03% mem=110.3MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=19.83% mem=95.19MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.84% mem=9.539MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.036,
"concurrency": 32,
"successful_requests": 27579,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 918.184,
"successful_latency_ms": {
"p50": 30.185,
"p95": 73.607,
"p99": 101.753
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-4 cpu=99.25% mem=94.79MiB / 256MiB
mtusi2026lab3-app-5 cpu=85.78% mem=95.77MiB / 256MiB
mtusi2026lab3-lb-1 cpu=16.20% mem=110.3MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=28.67% mem=93.86MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.51% mem=9.602MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.042,
"concurrency": 32,
"successful_requests": 26799,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 892.055,
"successful_latency_ms": {
"p50": 31.158,
"p95": 76.223,
"p99": 108.837
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-4 cpu=100.16% mem=97.67MiB / 256MiB
mtusi2026lab3-app-5 cpu=88.94% mem=95.84MiB / 256MiB
mtusi2026lab3-lb-1 cpu=17.17% mem=110.6MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=29.39% mem=95.93MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.52% mem=9.582MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.036,
"concurrency": 32,
"successful_requests": 26328,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 876.546,
"successful_latency_ms": {
"p50": 32.71,
"p95": 75.671,
"p99": 109.784
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-4 cpu=98.96% mem=98.08MiB / 256MiB
mtusi2026lab3-app-5 cpu=99.86% mem=95.95MiB / 256MiB
mtusi2026lab3-lb-1 cpu=23.28% mem=111MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=35.28% mem=97.85MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.70% mem=9.598MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.043,
"concurrency": 32,
"successful_requests": 31856,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1060.333,
"successful_latency_ms": {
"p50": 6.424,
"p95": 97.486,
"p99": 163.167
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-4 cpu=79.76% mem=84.46MiB / 256MiB
mtusi2026lab3-app-5 cpu=84.82% mem=85.2MiB / 256MiB
mtusi2026lab3-app-7 cpu=88.01% mem=85.07MiB / 256MiB
mtusi2026lab3-app-6 cpu=79.69% mem=83.77MiB / 256MiB
mtusi2026lab3-lb-1 cpu=29.17% mem=110.5MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=60.26% mem=101.5MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=3.31% mem=9.844MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.041,
"concurrency": 32,
"successful_requests": 34815,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1158.918,
"successful_latency_ms": {
"p50": 6.572,
"p95": 98.785,
"p99": 151.797
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-4 cpu=75.66% mem=85.69MiB / 256MiB
mtusi2026lab3-app-5 cpu=99.99% mem=85.61MiB / 256MiB
mtusi2026lab3-app-7 cpu=79.73% mem=87.9MiB / 256MiB
mtusi2026lab3-app-6 cpu=76.23% mem=84.44MiB / 256MiB
mtusi2026lab3-lb-1 cpu=26.42% mem=110.4MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=49.89% mem=102.7MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=2.74% mem=9.816MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.043,
"concurrency": 32,
"successful_requests": 35185,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1171.152,
"successful_latency_ms": {
"p50": 5.94,
"p95": 94.926,
"p99": 152.799
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-4 cpu=100.45% mem=85.77MiB / 256MiB
mtusi2026lab3-app-5 cpu=78.89% mem=86.27MiB / 256MiB
mtusi2026lab3-app-7 cpu=82.04% mem=87.93MiB / 256MiB
mtusi2026lab3-app-6 cpu=78.21% mem=85.16MiB / 256MiB
mtusi2026lab3-lb-1 cpu=27.77% mem=110.9MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=61.33% mem=104.3MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=2.70% mem=9.816MiB / 7.75GiB
@@ -0,0 +1 @@
17
@@ -0,0 +1,5 @@
| Реплик | RPS (мед.) | p50, мс | p95, мс | p99, мс | Ошибок, % |
|---|---|---|---|---|---|
| 1 | 579.0 | 51.2 | 98.2 | 105.5 | 0.00 |
| 2 | 892.1 | 31.2 | 75.7 | 108.8 | 0.00 |
| 4 | 1158.9 | 6.4 | 97.5 | 152.8 | 0.00 |
@@ -0,0 +1,2 @@
CPUs: 12
Total Memory: 7.75GiB
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.04,
"concurrency": 32,
"successful_requests": 17193,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 572.331,
"successful_latency_ms": {
"p50": 50.882,
"p95": 101.399,
"p99": 112.476
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-2 cpu=99.76% mem=100.6MiB / 256MiB
mtusi2026lab3-lb-1 cpu=12.81% mem=108.3MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=21.13% mem=67.53MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.85% mem=9.441MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.102,
"concurrency": 32,
"successful_requests": 17364,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 576.845,
"successful_latency_ms": {
"p50": 50.667,
"p95": 101.686,
"p99": 111.03
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-2 cpu=100.42% mem=101.4MiB / 256MiB
mtusi2026lab3-lb-1 cpu=13.98% mem=109.6MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=20.57% mem=76MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.80% mem=9.438MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.055,
"concurrency": 32,
"successful_requests": 17252,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 574.024,
"successful_latency_ms": {
"p50": 51.195,
"p95": 101.833,
"p99": 110.878
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,4 @@
mtusi2026lab3-app-2 cpu=101.13% mem=103.3MiB / 256MiB
mtusi2026lab3-lb-1 cpu=14.66% mem=109.4MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=19.41% mem=77.22MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=0.82% mem=9.422MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.065,
"concurrency": 32,
"successful_requests": 25980,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 864.132,
"successful_latency_ms": {
"p50": 32.007,
"p95": 81.266,
"p99": 110.258
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-3 cpu=99.71% mem=94.69MiB / 256MiB
mtusi2026lab3-app-2 cpu=97.52% mem=92.96MiB / 256MiB
mtusi2026lab3-lb-1 cpu=23.43% mem=109.8MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=36.05% mem=82.12MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.74% mem=9.582MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.048,
"concurrency": 32,
"successful_requests": 25714,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 855.761,
"successful_latency_ms": {
"p50": 33.083,
"p95": 79.872,
"p99": 114.01
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-3 cpu=89.37% mem=97.39MiB / 256MiB
mtusi2026lab3-app-2 cpu=100.56% mem=95.36MiB / 256MiB
mtusi2026lab3-lb-1 cpu=19.81% mem=110MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=32.27% mem=87.07MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=2.00% mem=9.496MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.05,
"concurrency": 32,
"successful_requests": 26105,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 868.722,
"successful_latency_ms": {
"p50": 32.691,
"p95": 77.103,
"p99": 111.428
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,5 @@
mtusi2026lab3-app-3 cpu=85.99% mem=99.25MiB / 256MiB
mtusi2026lab3-app-2 cpu=99.96% mem=97.98MiB / 256MiB
mtusi2026lab3-lb-1 cpu=16.58% mem=110.1MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=28.25% mem=88.69MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.42% mem=9.516MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.109,
"concurrency": 32,
"successful_requests": 22619,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 751.237,
"successful_latency_ms": {
"p50": 6.29,
"p95": 180.763,
"p99": 255.146
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-2 cpu=42.65% mem=77.91MiB / 256MiB
mtusi2026lab3-app-4 cpu=41.79% mem=77.86MiB / 256MiB
mtusi2026lab3-app-3 cpu=42.18% mem=78.53MiB / 256MiB
mtusi2026lab3-app-5 cpu=49.86% mem=78.51MiB / 256MiB
mtusi2026lab3-lb-1 cpu=14.93% mem=110.6MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=26.74% mem=91.28MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.45% mem=9.598MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.07,
"concurrency": 32,
"successful_requests": 21774,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 724.12,
"successful_latency_ms": {
"p50": 5.494,
"p95": 183.004,
"p99": 251.99
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-2 cpu=42.57% mem=81.04MiB / 256MiB
mtusi2026lab3-app-4 cpu=43.14% mem=80.63MiB / 256MiB
mtusi2026lab3-app-3 cpu=50.22% mem=80.84MiB / 256MiB
mtusi2026lab3-app-5 cpu=44.80% mem=80.85MiB / 256MiB
mtusi2026lab3-lb-1 cpu=15.53% mem=110.3MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=27.80% mem=92.98MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.52% mem=9.633MiB / 7.75GiB
@@ -0,0 +1 @@
17
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.099,
"concurrency": 32,
"successful_requests": 21375,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 710.161,
"successful_latency_ms": {
"p50": 5.459,
"p95": 185.229,
"p99": 265.189
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,7 @@
mtusi2026lab3-app-2 cpu=39.08% mem=81.5MiB / 256MiB
mtusi2026lab3-app-4 cpu=50.10% mem=80.82MiB / 256MiB
mtusi2026lab3-app-3 cpu=39.50% mem=81.09MiB / 256MiB
mtusi2026lab3-app-5 cpu=42.32% mem=81.55MiB / 256MiB
mtusi2026lab3-lb-1 cpu=14.89% mem=110.8MiB / 7.75GiB
mtusi2026lab3-db-1 cpu=26.73% mem=94.22MiB / 7.75GiB
mtusi2026lab3-valkey-1 cpu=1.98% mem=9.613MiB / 7.75GiB
@@ -0,0 +1 @@
17
+5
View File
@@ -0,0 +1,5 @@
| Реплик | RPS (мед.) | p50, мс | p95, мс | p99, мс | Ошибок, % |
|---|---|---|---|---|---|
| 1 | 574.0 | 50.9 | 101.7 | 111.0 | 0.00 |
| 2 | 864.1 | 32.7 | 79.9 | 111.4 | 0.00 |
| 4 | 724.1 | 5.5 | 183.0 | 255.1 | 0.00 |
+31
View File
@@ -0,0 +1,31 @@
global
log stdout format raw local0
defaults
mode http
timeout connect 1s
timeout client 15s
timeout server 15s
retries 2
option redispatch
resolvers docker
nameserver dns 127.0.0.11:53
hold valid 2s
hold nx 2s
hold other 2s
resolve_retries 3
timeout resolve 1s
timeout retry 1s
frontend fe
bind *:8080
default_backend api
backend api
balance roundrobin
option httpchk GET /health/ready
http-check expect status 200
# проверка каждую 1 с, 2 неудачи подряд = backend выключен (~2-3 с на обнаружение отказа)
default-server check inter 1s fall 2 rise 2 init-addr none resolvers docker
server-template app 1-6 app:8080
+15
View File
@@ -0,0 +1,15 @@
# Web framework
fastapi==0.115.0
uvicorn==0.30.6
pydantic==2.9.2
# Database & Migrations
sqlalchemy==2.0.35
asyncpg==0.30.0
alembic==1.13.3
# Security
argon2-cffi==23.1.0
# Cache (Valkey/Redis)
redis==5.2.0

Some files were not shown because too many files have changed in this diff Show More