forked from mtusi2026/mtusi2026lab3
Разбить API на модули и перевести комментарии на русский
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Single public entrypoint. Backends are discovered through Docker DNS (service name "api"),
|
||||
# so `docker compose up --scale api=N` needs no config change (up to 8 replicas).
|
||||
# Единственная публичная точка входа. Реплики находятся через Docker DNS (имя сервиса "api"),
|
||||
# поэтому `docker compose up --scale api=N` не требует правки конфига (до 8 реплик).
|
||||
global
|
||||
log stdout format raw local0 info
|
||||
maxconn 4096
|
||||
@@ -20,15 +20,15 @@ defaults
|
||||
mode http
|
||||
log global
|
||||
option httplog
|
||||
option dontlog-normal # log only errors and server state changes
|
||||
option dontlog-normal # логируем только ошибки и смену состояния реплик
|
||||
timeout connect 1s
|
||||
timeout client 30s
|
||||
timeout server 10s
|
||||
timeout http-request 10s
|
||||
timeout http-keep-alive 10s
|
||||
timeout check 1s
|
||||
# A request that never reached a backend (connect refused/timeout) is retried, the last time on
|
||||
# another server. Requests already sent are NOT retried: POST /users and /chats are not idempotent.
|
||||
# Повторяется только запрос, не дошедший до реплики (отказ или таймаут соединения), последняя попытка —
|
||||
# на другой реплике. Уже отправленные запросы НЕ повторяются: POST /users и /chats не идемпотентны.
|
||||
retries 2
|
||||
retry-on conn-failure
|
||||
option redispatch 1
|
||||
@@ -42,12 +42,12 @@ backend api
|
||||
option httpchk
|
||||
http-check send meth GET uri /health/ready
|
||||
http-check expect status 200
|
||||
# Active check every 1 s (0.5 s while state is changing): 2 failures -> DOWN, 2 successes -> UP.
|
||||
# A refused connection on live traffic marks the server DOWN immediately (observe layer4).
|
||||
# Активная проверка раз в 1 с (0.5 с при смене состояния): 2 неудачи → DOWN, 2 успеха → UP.
|
||||
# Отказ соединения на живом трафике сразу помечает реплику DOWN (observe layer4).
|
||||
default-server check inter 1s fastinter 500ms downinter 1s fall 2 rise 2 observe layer4 error-limit 1 on-error mark-down resolvers docker init-addr none
|
||||
server-template api 8 api:8080
|
||||
|
||||
# Operator view (bound to 127.0.0.1 on the host by compose): /stats and Prometheus /metrics.
|
||||
# Для оператора (compose публикует только на 127.0.0.1): /stats и Prometheus /metrics.
|
||||
frontend stats
|
||||
bind :8404
|
||||
http-request use-service prometheus-exporter if { path /metrics }
|
||||
|
||||
Reference in New Issue
Block a user