Help Needed to Send 100,000 Emails Within 1 Minute

I am currently trying to send out 100,000 emails, but it’s taking 7 minutes to complete the task. This means I’m only able to send about 14,285 emails per minute or 238 emails per second, which is not meeting my expectations.

I urgently need assistance to configure the system so that I can send all 100,000 emails within just 1 minute.

Hey there @kindhearted-deer, thanks for posting. Please read the “Troubleshooting” and “How to Ask for Help” buttons below. If you would like a 1:1 support session from the KumoMTA team, details are at the “Book a Support Session” button below.

lua is attached below

–[[
########################################################
KumoMTA minimal Send Policy
(Save this as /opt/kumomta/etc/policy/init.lua for systemd automation)
This config policy defines KumoMTA with a minimal
set of modifications from default.
Please read the docs at https://docs.kumomta.com/
For detailed configuration instructions.
########################################################
]]

local kumo = require ‘kumo’
local shaping = require ‘policy-extras.shaping’
local redis = require ‘redis’

local sources = require ‘policy-extras.sources’
sources:setup { ‘/opt/kumomta/etc/policy/sources.toml’ }
local queue_module = require ‘policy-extras.queue’
local queue_helper = queue_module:setup ({ ‘/opt/kumomta/etc/policy/queues.toml’ })

local rabitmqqueue = ‘transaction_email_events’

local listener_domains = require ‘policy-extras.listener_domains’

kumo.on(
‘get_listener_domain’,
listener_domains:setup { ‘/opt/kumomta/etc/listener_domains.toml’ }
)

kumo.on(‘get_egress_path_config’,
shaping:setup { ‘/opt/kumomta/etc/shaping.json’ }
)

kumo.on(‘init’, function()
kumo.start_esmtp_listener {
listen = ‘0:25’,
hostname = ‘kumomta.domain.com’,
relay_hosts = { ‘139.10.08.75’ , ‘127.0.0.1’},

    }

    kumo.start_esmtp_listener {
            listen = '0.0.0.0:587',
            hostname = 'kumomta.domain.com',
            tls_certificate = '/opt/kumomta/etc/ssl/ku-odo-cert.pem',
            tls_private_key = '/opt/kumomta/etc/ssl/ku-odo-key.pem',
            max_recipients_per_message = 5,
            relay_hosts = { '139.10.08.75' , '127.0.0.1','139.10.08.75'}
    }

    kumo.start_http_listener {
            listen = '127.0.0.1:8000',
            hostname = 'kumomta.domain.com',
            tls_certificate = '',
            tls_private_key = '/opt/kumomta/etc/ssl/ku-odo-key.pem',
            use_tls = false
    }
    kumo.define_spool {
            name = 'data',
            path = '/var/spool/kumomta/data',
            kind = 'RocksDB',
    }
    kumo.define_spool {
            name = 'meta',
            path = '/var/spool/kumomta/meta',
            kind = 'RocksDB',
    }
    kumo.configure_local_logs {
            log_dir = '/var/log/kumomta',
    }

end)

kumo.on(‘smtp_server_message_received’, function(msg)
local mail_from_domain = msg:from_header().domain
local signer = kumo.dkim.rsa_sha256_signer {
domain = mail_from_domain,
selector = ‘dkim1024’,
headers = { ‘From’, ‘To’, ‘Subject’, ‘Date’, ‘MIME-Version’, ‘Content-Type’, ‘Sender’ },
key = ‘/opt/kumomta/etc/dkim/’ .. mail_from_domain .. ‘/dkim1024.key’,
}
print (“DKIM signing message”)
msg:dkim_sign(signer)

end)

kumo.on(‘smtp_server_auth_plain’, function(authz, authc, password)
if password == ‘’ then
return false
end
return true
end)

Supporting files are attched below
/opt/kumomta/etc/listener_domains.toml

`[“*”]

You can specify * as a default, overridden by any more explicitly defined domains.

Since all options are false by default, this would only be needed to default

An option to true for all domains.

relay_to = false
log_oob = false
log_arf = false`

/opt/kumomta/etc/shaping.json
`{
“default”: {
“connection_limit”: 10000,
“max_connection_rate”: “10000/min”,
“max_message_rate”: “1000000/min”,
“enable_tls”: “Disabled”
},

}`

/opt/kumomta/etc/policy/queues.toml
`scheduling_header = “X-Schedule”
tenant_header = “X-Tenant”

campaign_header = “X-Campaign”
remove_campaign_header = true

default_tenant = “pool-1”

[tenant.‘pool-1’]
egress_pool = ‘pool-1’
max_age = ‘30 mins’
retry_interval = ‘5 mins’
max_retry_interval = ‘20 minutes’

[tenant.‘pool-2’]
egress_pool = ‘pool-2’
max_age = ‘30 mins’
retry_interval = ‘5 mins’
max_retry_interval = ‘20 minutes’

[queue.‘gmail.com’]
max_age = ‘30 mins’
retry_interval = ‘5 mins’
max_retry_interval = ‘20 minutes’`

The specifics of the machine you are using is critical, including its network connectivity.

Band width : 1000Mb/s
RAM : 32GB
CPU : 12 core ( Intel(R) Xeon(R) E-2286G CPU @ 4.00GHz)

this is the server specifics

Disk speed? Message size?

And what did you identify as being saturated during your test?

Speed issues are rarely a Lua problem. These almost always come down to hardware and network.

“size”:47358
Timing cached reads: 38782 MB in 1.98 seconds = 19574.10 MB/sec
Timing buffered disk reads: 6272 MB in 3.00 seconds = 2090.60 MB/sec
Disk type: nvme

During your send run iostat -x and see if it shows full utilization. Also you didn’t say your message size.

message size
“size”:47358

Kb?