Project: userver (App Definition and Development / Streaming & Messaging)
File: dynamic_configs.md

Here you can find schemas of dynamic configs used by userver itself. For general information on dynamic configs, see @ref scripts/docs/en/userver/dynamic_config.md @anchor HTTPCLIENTCONNECT_THROTTLE Token bucket throttling options for new connections (socket(3)). `-limit` - token bucket size, set to `0` to disable the limit `-per-second` - token bucket size refill speed ``` yaml schema: type: object properties: http-limit: type: integer minimum: 0 http-per-second: type: integer minimum: 0 https-limit: type: integer minimum: 0 https-per-second: type: integer minimum: 0 per-host-limit: type: integer minimum: 0 per-host-per-second: type: integer minimum: 0 additionalProperties: false required: http-limit https-limit per-host-limit ``` Example: ```json { "http-limit": 6000, "http-per-second": 1500, "https-limit": 100, "https-per-second": 25, "per-host-limit": 3000, "per-host-per-second": 500 } ``` Used by components::HttpClient, affects the behavior of clients::http::Client and all the clients that use it. @anchor HTTPCLIENTCONNECTIONPOOLSIZE Open connections pool size for curl (CURLMOPT_MAXCONNECTS). `-1` means "detect by multiplying easy handles count on 4". ``` schema: type: integer ``` Example: ``` 5000 ``` Used by components::HttpClient, affects the behavior of clients::http::Client and all the clients that use it. @anchor MONGODEFAULTMAXTIMEMS Dynamic config that controls default $maxTimeMS for mongo requests (0 - disables default timeout). ``` yaml schema: type: integer minimum: 0 ``` Example: ``` 200 ``` Used by components::Mongo, components::MultiMongo. @anchor MONGODEADLINEPROPAGATIONENABLEDV2 Dynamic config that controls whether task-inherited deadline is accounted for while executing mongodb queries. ``` yaml schema: type: boolean ``` Example: ```json false ``` Used by components::Mongo, components::MultiMongo. @anchor POSTGRESDEFAULTCOMMAND_CONTROL Dynamic config that controls default network and statement timeouts. Overrides the built-in timeouts from components::Postgres::kDefaultCommandControl, but could be overridden by @ref POSTGRESHANDLERSCOMMANDCONTROL, @ref POSTGRESQUERIESCOMMANDCONTROL and storages::postgres::CommandControl. ``` yaml type: object additionalProperties: false properties: networktimeoutms: type: integer minimum: 1 statementtimeoutms: type: integer minimum: 1 ``` Example: ```json { "networktimeoutms": 750, "statementtimeoutms": 500 } ``` Used by components::Postgres. @anchor POSTGRESHANDLERSCOMMAND_CONTROL Dynamic config that controls per-handle statement and network timeouts. Overrides @ref POSTGRESDEFAULTCOMMAND_CONTROL and built-in timeouts from components::Postgres::kDefaultCommandControl, but may be overridden by @ref POSTGRESQUERIESCOMMAND_CONTROL and storages::postgres::CommandControl. ``` yaml type: object additionalProperties: $ref: "#/definitions/CommandControlByMethodMap" definitions: CommandControlByMethodMap: type: object additionalProperties: $ref: "#/definitions/CommandControl" CommandControl: type: object additionalProperties: false properties: networktimeoutms: type: integer minimum: 1 statementtimeoutms: type: integer minimum: 1 ``` Example: ```json { "/v2/rules/create": { "POST": { "networktimeoutms": 500, "statementtimeoutms": 250 } }, "/v2/rules/select": { "POST": { "networktimeoutms": 70, "statementtimeoutms": 30 } } } ``` Used by components::Postgres. @anchor POSTGRESQUERIESCOMMAND_CONTROL Dynamic config that controls per-query/per-transaction statement and network timeouts, if those were not explicitly set via storages::postgres::CommandControl. Overrides the @ref POSTGRESHANDLERSCOMMANDCONTROL, @ref POSTGRESQUERIESCOMMANDCONTROL, @ref POSTGRESDEFAULTCOMMAND_CONTROL, and built-in timeouts from components::Postgres::kDefaultCommandControl. Transaction timeouts in POSTGRESQUERIESCOMMANDCONTROL override the per-query timeouts in POSTGRESQUERIESCOMMANDCONTROL, so the latter are ignored if transaction timeouts are set. ``` yaml type: object additionalProperties: $ref: "#/definitions/CommandControl" definitions: CommandControl: type: object additionalProperties: false properties: networktimeoutms: type: integer minimum: 1 statementtimeoutms: type: integer minimum: 1 ``` Example: ```json { "cleanupprocesseddata": { "networktimeoutms": 92000, "statementtimeoutms": 90000 }, "selectrecentusers": { "networktimeoutms": 70, "statementtimeoutms": 30 } } ``` Used by components::Postgres. @anchor POSTGRESCONNECTIONPOOL_SETTINGS Dynamic config that controls connection pool settings of PostgreSQL driver. Dictionary keys can be either the service component name (not database name!) or `default`. The latter configuration is applied for every non-matching PostgreSQL component of the service. Take note that it overrides the static configuration values of the service! ``` yaml type: object additionalProperties: $ref: "#/definitions/PoolSettings" definitions: PoolSettings: type: object additionalProperties: false properties: minpoolsize: type: integer minimum: 0 maxpoolsize: type: integer minimum: 1 maxqueuesize: type: integer minimum: 1 connecting_limit: type: integer minimum: 0 required: minpoolsize maxpoolsize maxqueuesize ``` Example: ```json { "default": { "minpoolsize": 4, "maxpoolsize": 15, "maxqueuesize": 200, "connecting_limit": 10 }, "postgresql-orders": { "minpoolsize": 8, "maxpoolsize": 50, "maxqueuesize": 200, "connecting_limit": 8 } } ``` Used by

@anchor POSTGRESTOPOLOGYSETTINGS Dynamic config that controls topology settings of service's PostgreSQL components. Dictionary keys can be either the service component name (not database name!) or `default`. The latter configuration is applied for every non-matching PostgreSQL component of the service. Take note that it overrides the static configuration values of the service! ``` yaml type: object additionalProperties: false properties: maxreplicationlag_ms: type: integer minimum: 0 description: maximum allowed replication lag. If equals 0 no replication lag checks are performed required: maxreplicationlag_ms ``` Example ```json { "default": { "maxreplicationlag_ms": 60000 } } ``` Used by components::Postgres. @anchor POSTGRESCONNECTIONSETTINGS Dynamic config that controls settings for newly created connections of PostgreSQL driver. Dictionary keys can be either the service component name (not database name!) or `default`. The latter configuration is applied for every non-matching PostgreSQL component of the service. Take note that it overrides the static configuration values of the service! ``` yaml type: object additionalProperties: false properties: persistent-prepared-statements: type: boolean default: true user-types-enabled: type: boolean default: true max-prepared-cache-size: type: integer minimum: 1 default: 5000 recent-errors-threshold: type: integer minimum: 1 ignore-unused-query-params: type: boolean default: false max-ttl-sec: type integer minimum: 1 ``` Example: ```json { "default": { "persistent-prepared-statements": true, "user-types-enabled": true, "max-prepared-cache-size": 5000, "ignore-unused-query-params": false, "recent-errors-threshold": 2, "max-ttl-sec": 3600 } } ``` Used by components::Postgres. @anchor POSTGRESCONNLIMITMODEAUTOENABLED Dynamic config that enables connlimit_mode: auto for PostgreSQL connections. Auto mode ignores static and dynamic max_connections configs and verifies that the cluster services use max_connections equals to PostgreSQL server's max_connections divided by service instance count. ``` yaml default: true schema: type: boolean ``` Used by components::Postgres. @anchor POSTGRESSTATEMENTMETRICS_SETTINGS Dynamic config that controls statement metrics settings for specific service. Dictionary keys can be either the service component name (not database name!) or `default`. The latter configuration is applied for every non-matching PostgreSQL component of the service. The value of `maxstatementmetrics` controls the maximum size of LRU-cache for named statement metrics. When set to 0 (default) no metrics are being exported. The exported data can be found as `postgresql.statement_timings`. ``` yaml type: object additionalProperties: $ref: "#/definitions/StatementMetricsSettings" definitions: StatementMetricsSettings: type: object additionalProperties: false properties: maxstatementmetrics: type: integer minimum: 0 ``` ```json { "postgresql-database_name": { "maxstatementmetrics": 50 }, "default": { "maxstatementmetrics": 150 } } ``` Used by components::Postgres. @anchor REDISCOMMANDSBUFFERING_SETTINGS Dynamic config that controls command buffering for specific service. Enabling of this config activates a delay in sending commands. When commands are sent, they are combined into a single tcp packet and sent together. First command arms timer and then during `watchcommandtimerintervalus` commands are accumulated in the buffer Command buffering is disabled by default. ``` yaml type: object additionalProperties: false properties: buffering_enabled: type: boolean commandsbufferingthreshold: type: integer minimum: 1 watchcommandtimerintervalus: type: integer minimum: 0 required: buffering_enabled watchcommandtimerintervalus ``` Example: ```json { "buffering_enabled": true, "commandsbufferingthreshold": 10, "watchcommandtimerintervalus": 1000 } ``` Used by components::Redis. @anchor REDISDEFAULTCOMMAND_CONTROL Dynamic config that overrides the default timeouts, number of retries and server selection strategy for redis commands. ``` yaml type: object additionalProperties: false properties: bestdccount: type: integer maxpinglatency_ms: type: integer max_retries: type: integer strategy: enum: default every_dc localdcconductor nearestserverping type: string timeoutallms: type: integer timeoutsinglems: type: integer ``` Example: ```json { "bestdccount": 0, "maxpinglatency_ms": 0, "max_retries": 4, "strategy": "default", "timeoutallms": 2000, "timeoutsinglems": 500 } ``` Used by components::Redis. @anchor REDISMETRICSSETTINGS Dynamic config that controls the metric settings for specific service. Dictionary keys can be either the database name (not the component name!) or `default`. The latter configuration is applied for every non-matching Redis database/sentinel of the service. ``` yaml type: object additionalProperties:

"#/definitions/MetricsSettings" definitions: MetricsSettings: type: object additionalProperties: false properties: timings-enabled: type: boolean default: true description: enable timings statistics command-timings-enabled: type: boolean default: false description: enable statistics for individual commands request-sizes-enabled: type: boolean default: false description: enable request sizes statistics reply-sizes-enabled: type: boolean default: false description: enable response sizes statistics ``` Example: ```json { "redis-database_name": { "timings-enabled": true, "command-timings-enabled": false, "request-sizes-enabled": false, "reply-sizes-enabled": false } } ``` Used by components::Redis. @anchor REDISPUBSUBMETRICS_SETTINGS Dynamic config that controls the redis pubsub metric settings for specific service. Dictionary keys can be either the database name (not the component name!) or `default`. The latter configuration is applied for every non-matching Redis database/sentinel of the service. ``` yaml type: object additionalProperties: $ref: "#/definitions/PubsubMetricsSettings" definitions: PubsubMetricsSettings: type: object additionalProperties: false properties: per-shard-stats-enabled: type: boolean default: true description: enable collecting statistics by shard ``` Example: ```json { "redis-database_name": { "per-shard-stats-enabled": true } } ``` Used by components::Redis. @anchor REDISRETRYBUDGET_SETTINGS Dynamic config that controls the retry budget (throttling) settings for components::Redis. Dictionary keys can be either the database name (not the component name!) or `default`. The latter configuration is applied for every non-matching Redis database/sentinel of the service. ``` yaml type: object additionalProperties: $ref: '#/definitions/BaseSettings' definitions: BaseSettings: type: object additionalProperties: false properties: enabled: description: Enable retry budget for database type: boolean max-tokens: description: Number of tokens to start with type: number maximum: 1000 minimum: 1 token-ratio: description: Amount of tokens added on each successful request type: number maximum: 1 minimum: 0.001 required: enabled max-tokens token-ratio ``` Example: ```json { "default": { "max-tokens": 100, "token-ratio": 0.1, "enabled": true } } ``` Used by components::Redis. @anchor REDISREPLICAMONITORING_SETTINGS redis Dynamic config that controls the monitoring settings for synchronizing replicas. Dictionary keys can be either the database name (not the component name!) or `default`. The latter configuration is applied for every non-matching Redis database/sentinel of the service. ``` yaml type: object additionalProperties: $ref: '#/definitions/BaseSettings' definitions: BaseSettings: type: object additionalProperties: false properties: enable-monitoring: description: set to `true` to turn on monitoring type: boolean forbid-requests-to-syncing-replicas: description: set to true to forbid requests to syncing replicas type: boolean required: enable-monitoring forbid-requests-to-syncing-replicas ``` Used by components::Redis. Example: ```json { "default": { "enable-monitoring": false, "forbid-requests-to-syncing-replicas": false } } ``` @anchor REDISSUBSCRIBERDEFAULTCOMMANDCONTROL The same as @ref REDISDEFAULTCOMMAND_CONTROL but for subscription clients. ``` yaml type: object additionalProperties: false properties: timeoutsinglems: type: integer minimum: 1 timeoutallms: type: integer minimum: 1 bestdccount: type: integer minimum: 1 maxpinglatency_ms: type: integer minimum: 1 strategy: type: string enum: default every_dc localdcconductor nearestserverping ``` Example: ```json { "bestdccount": 0, "maxpinglatency_ms": 0, "strategy": "default", "timeoutallms": 2000, "timeoutsinglems": 500 } ``` Used by components::Redis. @anchor REDISSUBSCRIPTIONSREBALANCEMININTERVAL_SECONDS Dynamic config that controls the minimal interval between redis subscription clients rebalancing. ``` yaml minimum: 0 type: integer default: 30 ``` Used by components::Redis. @anchor REDISWAITCONNECTED Dynamic config that controls if services will wait for connections with redis instances. ``` yaml type: object additionalProperties: false properties: mode: type: string enum: no_wait master slave masterorslave masterandslave throwonfail: type: boolean timeout-ms: type: integer minimum: 1 x-taxi-cpp-type: std::chrono::milliseconds required: mode throwonfail timeout-ms ``` Example: ```json { "mode": "masterorslave", "throwonfail": false, "timeout-ms": 11000 } ``` Used by components::Redis. @anchor USERVER_CACHES Cache update dynamic parameters. ``` yaml schema: type: object additionalProperties: type: object additionalProperties: false properties: update-interval-ms: type: integer minimum: 1 update-jitter-ms: type: integer minimum: 0 full-update-interval-ms: type: integer minimum: 0 updates-enabled: type: boolean default: true exception-interval-ms: type: integer minimum: 0 alert-on-failing-to-update-times: type: integer minimum: 0 required: update-interval-ms update-jitter-ms full-update-interval-ms ``` Example: ```json { "some-cache-name": { "full-update-interval-ms": 86400000, "update-interval-ms": 30000, "update-jitter-ms": 1000, "alert-on-failing-to-update-times": 2 } } ``` Used by all the caches derived from components::CachingComponentBase. @anchor USERVERCANCELHANDLEREQUESTBY_DEADLINE Controls whether the http request task should be cancelled when the deadline received from the client is reached. ``` yaml schema: type: boolean ``` Example: ``` true ``` Used by

@anchor USERVERDEADLINEPROPAGATION_ENABLED When `false`, disables deadline propagation in the service. This includes: reading the task-inherited deadline from HTTP headers and gRPC metadata; interrupting operations when deadline expires; propagating the deadline to downstream services and databases. ``` yaml schema: type: boolean ``` Example: ``` true ``` Used by components::Server and ugrpc::server::ServerComponent. @anchor USERVER_DUMPS Dynamic dump configuration. If the options are set for some dump then those options override the static configuration. ``` yaml schema: type: object additionalProperties: type: object additionalProperties: false properties: dumps-enabled: type: boolean min-dump-interval: description: dump interval in milliseconds type: integer minimum: 0 ``` Example: ```json { "some-cache-name": { "dumps-enabled": true, "min-dump-interval": 100000 } } ``` Used by dump::Dumper, especially by all the caches derived from components::CachingComponentBase. @anchor USERVERHANDLERSTREAMAPIENABLED Sets whether Stream API should be enabled for HTTP handlers. ``` yaml schema: type: boolean ``` Example: ``` true ``` @anchor USERVERHTTPPROXY Proxy for all the HTTP and HTTPS clients. Empty string disables proxy usage. Proxy string may be prefixed with `. A proxy host string can also embed user and password. ``` yaml schema: type: string ``` Example: ``` localhost:8090 ``` Used by components::HttpClient, affects the behavior of clients::http::Client and all the clients that use it. @anchor USERVERLOGDYNAMIC_DEBUG Logging per line and file overrides. Log locations are defined as path prefix from the Arcadia root ("taxi/uservices/services/"). Location of file may be followed by `:[line index]` to specify 1 exact log in that file. ``` yaml default: force-enabled: [] force-disabled: [] schema: type: object additionalProperties: false required: force-enabled force-disabled properties: force-enabled: type: array description: Locations of logs to turn on. This option is deprecated, consider using "force-enabled-level" instead. items: type: string force-disabled: type: array description: Locations of logs to turn off, logs with level WARNING and higher will not be affected. This option is deprecated, consider using "force-disabled-level" instead. items: type: string force-enabled-level: type: object description: | Locations of logs to turn on with level equal or higher to given. For example, to turn on all logs with level WARNING or higher in "userver/grpc", all logs with level DEBUG or higher in file "userver/core/src/server/server.cpp" and 1 log (since exact line is specified) with level TRACE in file "userver/core/src/server/http/httprequestparser.cpp": "force-enabled-level": { "taxi/uservices/userver/grpc": "WARNING", "taxi/uservices/userver/core/src/server/server.cpp": "DEBUG", "taxi/uservices/userver/core/src/server/http/httprequestparser.cpp:128": "TRACE" } additionalProperties: type: string force-disabled-level: type: object description: | Locations of logs to turn off with level equal or lower to given. For example, to turn off all logs with level ERROR or lower in "userver/grpc", all logs with level INFO or lower in file "userver/core/src/server/server.cpp" and 1 log (since exact line is specified) with level TRACE in file "userver/core/src/server/http/httprequestparser.cpp": "force-disabled-level": { "taxi/uservices/userver/grpc": "ERROR", "taxi/uservices/userver/core/src/server/server.cpp": "INFO", "taxi/uservices/userver/core/src/server/http/httprequestparser.cpp:128": "TRACE" } additionalProperties: type: string ``` Used by components::LoggingConfigurator. @anchor USERVERLOGREQUEST Controls HTTP requests and responses logging. ``` yaml schema: type: boolean ``` Example: ``` false ``` Used by components::Server. @anchor USERVERLOGREQUEST_HEADERS Controls whether the logging of HTTP headers in handlers is performed. ``` yaml schema: type: boolean ``` Example: ``` false ``` Used by components::Server. @anchor USERVERLRUCACHES Dynamic config for controlling size and cache entry lifetime of the LRU based caches. ``` yaml schema: type: object additionalProperties: $ref: '#/definitions/CacheSettings' definitions: CacheSettings: type: object properties: size: type: integer lifetime-ms: type: integer required: size lifetime-ms additionalProperties: false ``` Example: ```json { "some-cache-name": { "lifetime-ms": 5000, "size": 100000 }, "some-other-cache-name": { "lifetime-ms": 5000, "size": 400000 } } ``` Used by all the caches derived from cache::LruCacheComponent. @anchor USERVERNOLOG_SPANS Prefixes or full names of tracing::Span instances to not

``` yaml schema: type: object additionalProperties: false required: prefixes names properties: prefixes: type: array items: type: string names: type: array items: type: string ``` Example: ```json { "names": [ "mongo_find" ], "prefixes": [ "http", "handler" ] } ``` Used by components::LoggingConfigurator and all the logging facilities. @anchor USERVERRPSCCONTROL Dynamic config for components::Server congestion control. ``` yaml schema: type: object additionalProperties: false properties: min-limit: type: integer minimum: 1 description: | Minimal RPS limit value. up-rate-percent: type: number minimum: 0 exclusiveMinimum: true description: | On how many percents increase the RPS limit every second if not in overloaded state. down-rate-percent: type: number minimum: 0 maximum: 100 exclusiveMinimum: true description: | On how many percents decrease the RPS limit every second if in overloaded state. overload-on-seconds: type: integer minimum: 1 description: | How many seconds overload should be higher than `up-level`, to switch to overload state and start limiting RPS. overload-off-seconds: type: integer minimum: 1 description: | How many seconds overload should be higher than `down-level`, to switch from overload state and the RPS limit start increasing. up-level: type: integer minimum: 1 description: | Overload level that should least for `overload-on-seconds` to switch to overloaded state. down-level: type: integer minimum: 1 description: | Overload level that should least for `overload-on-seconds` to increase RPS limits. no-limit-seconds: type: integer minimum: 1 description: | Seconds without overload to switch from overloaded state and remove all the RPS limits. load-limit-crit-percent: type: integer description: | On reaching this load percent immediately switch to overloaded state. ``` Example: ```json { "down-level": 8, "down-rate-percent": 1, "load-limit-crit-percent": 70, "min-limit": 2, "no-limit-seconds": 120, "overload-off-seconds": 8, "overload-on-seconds": 8, "up-level": 2, "up-rate-percent": 1 } ``` Used by congestion_control::Component. @anchor USERVERRPSCCONTROL_ENABLED Controls whether congestion control limiting of RPS is performed (if main task processor is overloaded, then the server starts rejecting some requests). ``` yaml schema: type: boolean ``` Example: ``` true ``` Used by congestion_control::Component. @anchor USERVERTASKPROCESSORPROFILERDEBUG Dynamic config for profiling the coroutine based engine of userver. Dictionary key names are the names of engine::TaskProcessor. ``` yaml schema: type: object properties: {} additionalProperties: $ref: '#/definitions/TaskProcessorSettings' definitions: TaskProcessorSettings: type: object required: enabled execution-slice-threshold-us additionalProperties: false properties: enabled: type: boolean description: | Set to `true` to turn on the profiling execution-slice-threshold-us: type: integer description: | Execution threshold of a coroutine on a thread without context switch. If the threshold is reached then the coroutine is logged, otherwise does nothing. minimum: 1 ``` Example: ```json { "fs-task-processor": { "enabled": false, "execution-slice-threshold-us": 1000000 }, "main-task-processor": { "enabled": false, "execution-slice-threshold-us": 2000 } } ``` Used by components::ManagerControllerComponent. @anchor USERVERTASKPROCESSOR_QOS Controls engine::TaskProcessor quality of service dynamic config. ``` yaml schema: type: object required: default-service additionalProperties: false properties: default-service: type: object additionalProperties: false required: default-task-processor properties: default-task-processor: type: object additionalProperties: false required: waitqueueoverload properties: waitqueueoverload: type: object additionalProperties: false required: timelimitus length_limit action properties: timelimitus: type: integer minimum: 0 description: | Wait in queue time after which the `action is applied`. length_limit: type: integer minimum: 0 description: | Queue size after which the `action` is applied. action action: type: string enum: ignore cancel description: | Action to perform on tasks on queue overload. `cancel` - cancels the tasks sensortimelimit_us: type: integer minimum: 0 description: | Wait in queue time after which the overload events for RPS congestion control are generated. ``` Example: ```json { "default-service": { "default-task-processor": { "waitqueueoverload": { "action": "cancel", "length_limit": 5000, "sensortimelimit_us": 12000, "timelimitus": 0 } } } } ``` Used by components::ManagerControllerComponent. @anchor USERVERFILESCONTENTTYPEMAP Dynamic config for mapping extension files with HTTP header content type. ``` yaml schema: type: object additionalProperties: type: string ``` Example: ```json { ".css": "text/css", ".gif": "image/gif", ".htm": "text/html", ".html": "text/html", ".jpeg": "image/jpeg",