Giter VIP home page Giter VIP logo

Comments (11)

andris9 avatar andris9 commented on August 22, 2024

I'll try to replicate this. There are two possible reasons for slow sending, either there's something wrong in database or delivering to STMP. Btw. which SMTP provider do you use?

from mailtrain.

radleta avatar radleta commented on August 22, 2024

We use AWS SES for sending and our rate allowed supports up to 1m day.

I was able to notice the app server was not that busy during this period. It was running less than 10% CPU on a AWS EC2 t2.nano. We were using AWS RDS MySQL t2.micro for the database and increasing to t2.medium definitely improved performance. However, the rate seemed far below what you'd expect thus, my feeling it being a unintended bottleneck of some kind in the DB like a missing index or untuned query.

from mailtrain.

andris9 avatar andris9 commented on August 22, 2024

Ok, sounds like a db issue indeed. I'll create a large subscriber list in my test instance and send messages to a local SMTP that forwards these to /dev/null. This way I should end up in the same situation if there's something going on with the db

from mailtrain.

andris9 avatar andris9 commented on August 22, 2024

Yes, I can definitely confirm that the sending gets slower in time, here's a graph for a 21 minute run:

I'll try to find out from where the delay actually comes from

from mailtrain.

andris9 avatar andris9 commented on August 22, 2024

The culprit turned out to be the query to find next unsent message. I updated it to fetch several messages at once instead of doing it one by one. Once you have sent a large amount of messages this query gets slower since checking unsent status takes more time. The updated code in master is now optimized. I did not tag it yet since I broke "pause" button – pause stops fetching new messages but if you have already cached a list of unsent messages then these cached messages are sent regardless if you pressed paused or not.

from mailtrain.

radleta avatar radleta commented on August 22, 2024

Excellent! I'll pull the latest and give it a try. Thank you.

from mailtrain.

andris9 avatar andris9 commented on August 22, 2024

I did some additional tweaks and tagged Mailtran as version v1.10.1. The database performance is much better and such slow downs should not happen anymore

from mailtrain.

radleta avatar radleta commented on August 22, 2024

Excellent! I've updated and will send another campaign through this coming weekend.

from mailtrain.

radleta avatar radleta commented on August 22, 2024

Good news. The performance was increased and I was able to send entire list within one day using the new version.

from mailtrain.

andris9 avatar andris9 commented on August 22, 2024

Awesome!

from mailtrain.

vishnus avatar vishnus commented on August 22, 2024

Hi @andris9 ,

We are facing this exact same issue. We sent out a campaign to 800k subscribers, initial 60-70k mails got sent really fast, but after that it was like 2-3 mails per second. What could be the issue? Version in package.json is 1.23.2

from mailtrain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.