Connection rate

Hi, I have a question about the delay between each connection. In the trace logs I see that kumod::ready_queue: spawning client are triggered according to my connection_limit, but it doesn’t seem to reconnect when I hit the max_deliveries_per_connection. They are created every minute after kumod::ready_queue: maintain
Here’s my shaping.toml

replace_base = true
connection_limit = 3
max_connection_rate = "100/min"
max_deliveries_per_connection = 100
max_message_rate = "100/s"
idle_timeout = 1
data_timeout = "30s"
data_dot_timeout = "60s"
enable_tls = "OpportunisticInsecure"
enable_mta_sts = false
consecutive_connection_failures_before_delay = 100```

Looking into this for you.

ah, I think we might need to trigger the maintain method to run after we close out a connection due to max_deliveries_per_connection limits.

What’s happening right now is that, because there are no new messages being delivered to that same destination, we have to wait for the next scheduled maintainer run to occur, and that happens once per minute

I’ve filed ready queue maintainer needs to be triggered after closing a connection due to max_deliveries_per_connection · Issue #116 · KumoCorp/kumomta · GitHub for this

thanks, there’s another small thing that I don’t really understand, the limit it hit 3 times as in I do have 3 logs with kumod::ready_queue: Sent 100 and limit is 100, close and make a new connection but in my delivery logs and the prometheus metrics report 150

which prometheus metrics?

the ones from localhost:8008/metrics

I meant which metric name? :slightly_smiling_face:

haha my bad, total_messages_delivered

the deliveries per connection limit is a slightly misleading name: it’s really attempts-per-connection. It will count attempts that transiently failed as well

So you should also consider the total_messages_transfail and total_messages_fail counters together with the total_messages_delivered to get a sense of whether the per-connection limit adds up

ah, let me sum that up and I’ll get back to you

I’ve added it all up and it still gives me 150

hmm, and if you look at the delivery logs, do you have a total of 150 Delivered, Bounce and TransientFailure records?

yeah, I just removed the received logs, for the ready queue I have 150 a minute

it’s weirdly consistent

and its definitely all for the same combination of site-name + source?

the logic that handles the delivered_this_connection counter is very simple, so I have high trust that isn’t being bumped up in the wrong cases. So it is strange that the number of logs doesn’t seem to match up to it; I don’t have a good explanation for that

it’s for the same source->site_name