knadh / listmonk

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
https://listmonk.app
GNU Affero General Public License v3.0
15.08k stars 1.38k forks source link

replicas, static frontend, and campaigns concurrency #2052

Closed ashisherc closed 1 month ago

ashisherc commented 1 month ago

I have been exploring Listmonk for a while now, gone throgh multiple gh issues, and I would be grateful to understand a few things about Listmonk.

1 - Regarding operational compatibility - Can we have multiple instances of Listmonk running, load-balanced? kubernetes deployment with multiple replicas? Does it interfere with campaign sending process etc. 2 - What happens when Listmonk/instance crashes in between a campaign is being sent? Where does it keep the campaign processing state? does it continue on restart or do we start the campaign again manually? 3 - Does Listmonk maintain a buffer, if we send tons of transactional emails. (I would ideally maintain a queue on our stack) 4 - Can we have the front end deployed on S3, static build? I saw this is possible in dev mode, was just wondering if we can do this in prod as well.

Appreciate your time in responding to these questions. Thanks,

knadh commented 1 month ago

1 - Regarding operational compatibility - Can we have multiple instances of Listmonk running, load-balanced? kubernetes deployment with multiple replicas? Does it interfere with campaign sending process etc.

No, this is not possible. A listmonk DB can only have one listmonk instance acting on it.

2 - What happens when Listmonk/instance crashes in between a campaign is being sent? Where does it keep the campaign processing state? does it continue on restart or do we start the campaign again manually?

It stores states in the DB and resumes.

3 - Does Listmonk maintain a buffer, if we send tons of transactional emails. (I would ideally maintain a queue on our stack)

Yes, it has an internal multi-threaded queue. Internally, the queue's size is cfg.Concurrency*cfg.MessageRate*2 (these are configured in Settings -> Performance)

4 - Can we have the front end deployed on S3, static build? I saw this is possible in dev mode, was just wondering if we can do this in prod as well.

This should work, but not sure why you would want to build the admin dashboard of an app and serve it separately. If you've a CDN/proxy in front, it should all be cached either way.

ashisherc commented 1 month ago

Thanks much for the quick response. 4 was only if we could have replicas. All good.

ashisherc commented 1 month ago

@knadh since kubernetes may unintentionally sometimes have 2 pods running, for eg. spin up another pod while the old one is still pending termination. it could maybe for a short while. would it create chaos?

knadh commented 1 month ago

Not familiar with K8s, but 2 instances of listmonk at the same time even for a short while can create conflicts.