Commit Graph
3152 Commits
Author SHA1 Message Date
Wez Furlong 57544668eb disable delete-old-packages workflow for the moment 2025-05-07 06:20:56 -07:00
Wez Furlong c3dff7e2c8 docs: update for latest release 2025-05-06 18:24:15 -07:00
Wez Furlong b29689af74 docs: memoize: allow_stale_reads 2025-05-06 05:55:44 -07:00
Wez Furlong 507822f1c9 docs: fmt 2025-05-06 05:55:34 -07:00
Wez Furlong 82c831a8d8 kumod: avoid panic when main policy file has syntax error
The log-accounting-db-on-flush logic was getting tripped up
in the case that you have a fatal syntax error, such as a
construct like `local foo = {` with no closing brace.

It would try to flush the db before shutting down, but we
hadn't yet initialized the root LifeCycle object, so it
would panic before we got a chance to print the details
of the syntax error.

This commit makes the flush logic recognize when we haven't
started a lifecycle and simply skip in that case, because
we couldn't possibly have passed traffic in that situation.
2025-05-05 21:58:59 -07:00
Mike Hillyer 9249fbc482 Remove extra references. 2025-05-05 16:10:09 -04:00
Wez Furlong e8573f9a76 rfc5965: ignore bogus rfc822 dates arrival or reception-date headers
The rfc includes a bogus date in one of its examples, which the
underlying chrono library produces an error for.

Since we don't loudly report failures in parsing incoming reports,
this sort of error is confusing for the user.

These date fields are optional, so we can convert the error to
None without harming the overall outcome.
2025-05-05 08:48:41 -07:00
Wez Furlong fedd2959b6 enhance log_arf, log_oob to support LogThenDrop
It is common to want to express that incoming reports should
be logged, but not relayed.

This commit facilitates that by expanding `log_arf` and `log_oob`
to allow more than just a simple boolean value.

We now support both LogThenRelay and LogThenDrop as dispositions
for an incoming report, as well as Ignore to not care about the
report content.

For the LogThenDrop case we'll log only the incoming OOB or Feedback
record to the logs and then discard the incoming message.

For LogThenRelay we'll log the incoming OOB/Feedback report as well
as enqueue the message and log a Reception and, subsequently, records
for its delivery attempts.

The previously supported boolean values are mapped to `Ignore` (false)
and `LogThenRelay` (true), respectively: their behavior is the same as
in prior releases.

The integration test and smtp server tracing infra has been enhanced a
bit to support extracting these new disposition states from the tracer
during the integration test.
2025-05-05 08:25:40 -07:00
Wez Furlong 16fad7b260 promote docker_utils to policy-extras
It is useful enough and avoids some reptitions between
the single node and docker swarm examples.

closes: https://github.com/KumoCorp/kumomta/issues/359
2025-05-02 10:09:57 -07:00
Wez Furlong 76cb46e36e cargo update 2025-05-02 09:36:34 -07:00
Wez Furlong 9641bcf1ff docs: note about domain-suffix when using iptables 2025-05-01 10:23:01 -07:00
Wez Furlong db1f3c3773 docs: wrap iptables command 2025-05-01 10:20:01 -07:00
Wez Furlong c3b65667a6 docs: expand discussion around iptables 2025-05-01 10:19:15 -07:00
Wez Furlong 3732bc0fef docs: code formatting 2025-05-01 10:09:01 -07:00
Mike Hillyer d57953ba87 Formatting and spelling fixes. 2025-05-01 12:55:44 -04:00
Mike Hillyer 35e49a4312 Typo fix. 2025-05-01 12:31:05 -04:00
Mike Hillyer 366b45c2e5 Formatting update. 2025-05-01 12:31:05 -04:00
Mike Hillyer e08111beee Implement Wez's feedback to use meta instead of header in the logging example. 2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong d9273e2e19 Update docs/faq/how_do_i_include_multiple_files.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike Hillyer 1a68d526f5 Update to linux tuning to show possible parameters but not values to prevent copypasta. 2025-05-01 12:31:05 -04:00
Mike Hillyer c978a23a8c Update Linux tuning to have less examples so that people don't blindly implement them. 2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 1ef1cf4cc3 Update docs/userguide/performance/testing.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 50a274fa83 Update docs/userguide/performance/loghooks.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 1a645681fd Update docs/userguide/performance/loghooks.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike Hillyer b92812cf8b Add glob example. 2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 163f826fa1 Update docs/userguide/performance/architecture.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 7b5b655a09 Update docs/userguide/performance/architecture.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike Hillyer 670133a64f Quick edit. 2025-05-01 12:31:05 -04:00
Mike Hillyer 5035b82092 Add a SPOF FAQ entry. 2025-05-01 12:31:05 -04:00
Mike Hillyer 62a48d4787 Added the architecture page, further tweaks. 2025-05-01 12:31:05 -04:00
Mike Hillyer c086a08c03 Linter complaints. 2025-05-01 12:31:05 -04:00
Mike Hillyer 08224b223d DNS and loghook pages 2025-05-01 12:31:05 -04:00
Mike Hillyer dd4a2acf60 Updates to the performance chapter of the userguide. 2025-05-01 12:31:05 -04:00
Mike Hillyer 01cd7985ae Update Message flow page to go deeper on some of the events and factors that will need to be tuned. 2025-05-01 12:31:05 -04:00
Mike Hillyer 27447c8e0b Updated testing page to use the sink container rather than the sink init.lua so that testers will be encouraged to have more realistic tests. 2025-05-01 12:31:05 -04:00
Mike Hillyer 66a377bae6 Initial re-arranging of existing performance related content from the Operation chapter to the Performance chapter. 2025-05-01 12:31:05 -04:00
Mike Hillyer ab40de0920 Initial commit just to test my changes. 2025-05-01 12:31:05 -04:00
Mike Hillyer 2f67b735a1 Update README.md
Adding a note to not post help requests to Issues.
2025-05-01 10:43:47 -04:00
Wez Furlong cd09170bc4 throttle: fix TTL issue with redis-script based throttles
When using throttles with a long period, a porting issue from the JS
based throttle code meant that we'd compute a TTL in *seconds* but tell
redis that its value is in *milliseconds*, resulting in a much shorter
expiration time than desired, allowing more messages to pass the
throttling condition.

This issue doesn't apply to the redis-cell based throttle
implementation.

The fix here is simply to switch the `PX` (TTL in milliseconds) to
`EX` (TTL in seconds).

Possibly this was the source of the flakeyness that we could never
run down in https://github.com/KumoCorp/kumomta/issues/297
2025-04-30 14:15:39 -07:00
Wez Furlong f92df0fca0 lruttl: introduce allow_stale_reads option
This is paired with a corresponding field in the memoize options
struct, which is in turn exposed to the shaping helper shaping_data
cache via the `allow_stale_shaping_data` field.

The effect of setting this to true is:

* Undoes the effect of invalidate_with_epoch, as stale reads cannot
  be epoch based
* If a semaphore wait times out, and a stale value was present in
  the cache, that stale value will be returned to the caller

To facilitate this behavior, the lruttl cache introduces a new
state for a cached value: `Refreshing`, which is a combination
of both `Present` and `Pending`.

When stale reads are allowed, we take care to avoid unilaterally
replacing `Present` with `Pending` when an item has expired.

Whenever we satisfy a lookup with a stale value, we will bump a new
lruttl_stale_count counter for that cache.  Previously, we would
classify those as errors.

Something else that changed as part of this commit, is that we now set
an overall deadline for the semaphore wait operation; previously, each
wait would allow for up to the specified semaphore timeout, but now the
total wait time for that lookup will be bounded to the specified
timeout.
2025-04-30 14:01:26 -07:00
Wez Furlong eecc1b8f1f readyq: avoid over-notifying readyq w/ max_connection_rate throttle
This commit continues in the theme of
18e510ebe2 to make us a bit more
discerning about how often the readyq maintainer is run.

In this case, we're adding an explicit delay in the maintainer itself
when there is a max_connection_rate defined for that particular site.
This will reduce overall cpu utilization in the case that the readyq
size suggests a larger number of connections than can be established
immediately, due to the max_connection_rate throttle.

As with the referenced earlier commit, this is an approximation; it may
cause more latency than is strictly required, but the consequences are
low because connection rates tend to have a short period, and the impact
is only a delay, not a suppresion of a wakeup.  While the maintainer
task is delaying, any additional wakeups are queued and will effective
coalesce into a lower volume and rate of wakeups.

The throttling behavior is explicitly local-only, and doesn't use
the redis throttle backend, as the intent is to reduce the workload
rather than increase the workload.
2025-04-30 14:01:26 -07:00
Wez Furlong c4935f7d54 remove metrics_context_layer::TracingContextLayer
We don't appear to use its span -> metrics injection at all, and it
seems to have a noticeable prescence in some perf profiles.
2025-04-28 05:51:13 -07:00
Wez Furlong 7cfebaa68c ci: docs: see if this brings back the modification dates 2025-04-25 06:34:57 -07:00
Wez Furlong b8310da8be docs: add warning about logging headers
TL;DR: you can easily halve your system performance by logging headers
vs. logging meta.

This is one of those things that is easy to overlook or forget,
but: whenever you need to operate on the message data, rather
than its metadata, the aggregate cost is high.

In this case, we were recently troubleshooting a system where
the CPU was bogged down and we traced it to the logging configuration: a
number of message headers were being logged in a configuration that
made heavy use of throttles and limits in its traffic shaping, and
thus had a large number of Delayed and TransientFailure events being
written to the logs.

When logging headers, each one of those events requires loading
the message from the spool and parsing out the headers.  When the
average message size is ~100KB this imposes a notable overhead
on the CPU and IO utilization of the system.

What we recommend instead of logging headers directly is capturing
the information that you want to log into the message metadata
at the time that the message is received.

The message meta is usually already loaded, but is also typically
much smaller and easier to decode than the full message content
in the cases where it is not loaded.

As a result, it is much cheaper to log meta than to log headers.

This commit adds some warnings and cross links to help folks
be aware of this, and to generally navigate related meta and logging
topics more easily via tags.
2025-04-25 05:52:44 -07:00
Wez Furlong 448fa55afb docs: update for docker dev build naming change 2025-04-24 09:13:20 -07:00
Wez Furlong e484c0b1bc ci: update paths 2025-04-24 08:14:15 -07:00
Wez Furlong 25edb7c768 I hate yaml 2025-04-24 08:12:36 -07:00
Wez Furlong f35958c476 ci: docker dev builds are now ghcr.io/kumocorp/kumomta:main
This simplifies the overall build process.

ghcr.io/kumocorp/kumomta:main is the most recent commit to the
main branch

ghcr.io/kumocorp/kumomta:latest is the most recently tagged
stable commit.

I'll manually trigger a run like this to ensure that we actually
publish, then I will update the docs to reflect it.
2025-04-24 07:39:23 -07:00
Wez Furlong e76e4332f9 ci: remove now-unused pipeline for woodpecker 2025-04-23 14:59:12 -07:00
Wez Furlong fd764df23a ci: builder images on GH actions 2025-04-23 14:29:25 -07:00