Skip to content

kumo.set_httpinject_concurrency_limit

kumo.set_httpinject_concurrency_limit(N)
Since: Dev Builds Only

The functionality described in this section requires a dev build of KumoMTA. You can obtain a dev build by following the instructions in the Installation section.

Bounds the number of HTTP injection requests that may be processed concurrently. N is the maximum number of in-flight requests and must be at least 1. The default limit is 32768. Earlier versions of KumoMTA did not impose a concurrency constraint, and would be limited only by system resources (file descriptors, ports, RAM).

It is recommended that you set the concurrency limit in the pre_init event, which triggers prior to the init event where you start up your http listeners:

kumo.on('pre_init', function()
  kumo.set_httpinject_concurrency_limit(128)
end)

When a request arrives and the limit is already reached, it is rejected immediately with a 503 response and the httpinject_requests_rejected_total counter is incremented. The httpinject_requests_in_flight gauge reports how many requests currently hold a slot.

The concurrency limit is checked before the injection request is processed. The request is then internally constrained by the recipient rate limit.

It applies across all HTTP listeners that have been defined.

This limit covers only requests arriving over HTTP; kumo.api.inject.inject_v1 calls into the same injection logic directly from Lua and is not constrained by it.

A request with deferred_generation: true releases its slot as soon as its body is queued for generation. The later per-recipient generation is not constrained by this limit. See deferred_generation for how to constrain that work.