Skip to content

kumo.set_lruttl_cache_capacity

kumo.set_lruttl_cache_capacity(NAME, CAPACITY)
Since: Version 2025.03.19-1d3f1f67

The functionality described in this section requires version 2025.03.19-1d3f1f67 of KumoMTA, or a more recent version.

Allows you to configure the maximum capacity for a specific named pre-defined cache.

You may only update the capacity for caches defined inside kumomta's Rust code via declare_cache!. Other caches are assumed to be dynamically created and expose their capacity as part of their own individual configuration.

kumo.on('pre_init', function()
  -- Increase the mx cache size from its default of 64*1024 to 128,000
  kumo.set_lruttl_cache_capacity('dns_resolver_mx', 128000)
end)

Note

This function is intended to be used in pre_init, but it can be called at any time. Reducing the capacity while the cache holds data will trigger a partial eviction. The cache will eventually shrink to conform to the new size as the cache is operated upon and background processing trims the cache.

Below is a list of pre-defined caches and their default capacities in the main branch. The list is automatically extracted from the code during the documentation build, unversioned and may not reflect the version of KumoMTA that you are running.

Name Capacity Comment
dkim_key_cache 1024 Caches dkim loaded signing keys based on their KeySource spec
dkim_signer_cache 1024 Caches dkim signer specs to signer objects
dns_resolver_ip 1024 Caches domain name to the combined set of ipv4 and ipv6 records
dns_resolver_ipv4 1024 Caches domain name to ipv4 records
dns_resolver_ipv6 1024 Caches domain name to ipv6 records
dns_resolver_mx 65536 Caches domain name to computed set of MailExchanger records
egress_source_pools 128 Caches EgressPool information by pool name
egress_source_sources 128 Caches EgressSource information by source name
http_server_auth 128 Caches the results of the http server auth validation by auth credential
mod_filesystem_glob_cache 32 Caches glob results by glob pattern
mta_sts_policy 65536 Caches MTA-STS policy information by domain
rfc5321_rustls_config 32 Caches TLS connector information for the RFC5321 SMTP client
smtp_dispatcher_broken_tls 65536 Remembers which site names have broken TLS
smtp_dispatcher_client_certificate 1024 Caches smtp client certificates by KeySource spec
smtp_server_tls_config 128 Caches TLS acceptor information for the esmtp listener