Optimizing Connection Count, Max Deliveries per Connection, and Message Rate in KumoMTA

Hey KumoMTA team,

I’m currently running KumoMTA on a 4-core, 16GB RAM setup and have been working on performance tuning based on the official guide:
https://docs.kumomta.com/userguide/operation/performance/

I’m trying to get a deeper understanding of how to configure and optimize settings related to connections, max deliveries per connection, and message rate. Specifically, I have the following questions:

Number of Connections:
How can I configure the number of simultaneous connections to ensure I’m maximizing my server’s capability? Are there any recommended limits or parameters I should set for a server with 4 cores and 16GB of RAM?

Max Deliveries per Connection:
What’s the best way to adjust the number of deliveries per connection? Is there a recommended value for this setting based on the server resources I have?

Max Message Rate:
Are there any guidelines or best practices for configuring the maximum message rate? I want to ensure I’m pushing out emails as quickly as possible without overwhelming the server or causing delivery delays.

Connection Pools and Queuing:
Should I be making any specific adjustments to connection pooling or queuing settings to optimize throughput for large-scale mail delivery? If so, which parameters would be the most impactful?

I’m attaching my shaping.lua for better understanding

connection_limit = 10
max_connection_rate = "100/min"
max_deliveries_per_connection = 100
max_message_rate = "100/s"
idle_timeout = "60s"
data_timeout = "30s"
data_dot_timeout = "60s"
enable_tls = "disabled"
consecutive_connection_failures_before_delay = 100

["gmail.com"]
max_deliveries_per_connection = 50
connection_limit = 5
enable_tls = "Required"
consecutive_connection_failures_before_delay = 5

["yahoo.com"]
max_deliveries_per_connection = 20

[["yahoo.com".automation]]
regex = "\\[TS04\\]"
action = "Suspend"
duration = "2 hours"

["comcast.net"]
connection_limit = 10
max_deliveries_per_connection = 250
enable_tls = "Required"
idle_timeout = "30s"
consecutive_connection_failures_before_delay = 24

["mail.com"]
max_deliveries_per_connection = 100

["example.com"]
mx_rollup = false
max_deliveries_per_connection = 100
connection_limit = 3

["example.com".sources."sources"]
connection_limit = 5

Advising on traffic shaping rules is a paid offering from the KumoMTA team, but the community may have suggestions.

To be honest depending on volumes etc. those connection value may vary, but it is better in my opinion to use the shaping automation to listen to logs and respond to what they tell and suspend delivery if needed or reduce connection numbers if the logs tell you that too many connections were made. There should be a community shaping.toml soon with a nice headstart for the big ESPs like Outlook, Yahoo and Gmail.