Get answers quicker by searching

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Sending speed
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    Hi Ben,
    I have now a daily quota of 112.000 with 70 mails/sec; running on m1.small instance but can still not get any higher than 26.000/h. Sending to a list of 100.000 still takes appr. 4 hours. What may the problem be?
  • 42 Comments
  • I have the same issue on the most current release of sendy. On 1.1.1.3 I get close to 10,000 sends / 5 min.
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support
    Hi @Ergun, can you try rebooting your instance to see if this improves?

    @derivativemedia

    Later versions of Sendy includes this feature called "Auto retry". For each bursts of emails sent in parallel, Sendy will check the HTTP code returned by Amazon SES. If it's anything other than "200", that means sending to that email failed. Sendy will pause for 1 second and then automatically try to send the email to the recipient again. If it fails again, the recipient will be recorded and the full list will be available as a CSV download.

    This makes sending robust and extremely accurate.

    But if you have a large list, Amazon may return a failure more often than a small list. Sending will be paused for 1 second and then retried - multiplied by the number of times Amazon returns a failure HTTP code. This may be the reason you're not seeing the same speed as you see in 1.1.1.3.

    Having said all these, sometimes Amazon may not even return any failure code throughout the whole sending process.

    1.1.13 does not have this "auto retry" feature. Emails just get transferred to Amazon SES in parallel without checking if any emails failed to go through and subsequently try to re-send.

    Lastly, you mentioned on 1.1.13, you get close to 10,000 sends / 5 min. That works out to be around 33 emails per seconds. May I know what's your sending rate?

    Also, how many emails are being sent per second using the latest 1.1.3.1?

    Thanks.

    Ben
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support
    I forgot to mention one other thing. Recently I've been sending tens of thousands of emails to a "catch all" email account.

    After sending is completed, all emails sent does not appear in my Inbox at once. It trickles in slowly until I receive all emails. Sometimes this takes several hours.

    Transferring emails between Sendy and Amazon SES will always have some latency, you will never reach 100% of your send rate. Even if you do, emails won't appear on all your recipients' inbox immediately. It takes hours until Amazon finish sending emails to all your recipients.
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    Ok, but 26.000/h equals a quota of 7.22 per sec. My quota is 70 per sec. I'm expecting at least 50-60 per second, which should be easily attainable.
  • My quota rate is 70 per sec. I am sending about 1000 per 5 min now
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    @derivativemedia 1.000/5min or 10.000/5min?
  • on the most current release its 1000/5min down from approx 10000/5min on 1.1.1.3
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support
    @derivativemedia that's 3 emails per second when you have 70/sec. That's way too slow. Is there anything in your queue table? And how much memory does your instance have? What's the memory_limit for your PHP setup?
  • Instance has 1.7gb memory and php memory is set to 128M
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support
    Thanks @derivativemedia. Is there currently any emails in your queue table? And how many emails do you typically send to?
  • nothing in the queue right now as nothing is sending. I am sending to 40k
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    Hi I have booted the instance today, and sent to approximately 22k subscribers. It took about 1 hour
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    No change in speed
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    A question: What i have realized is that sendy sends in increments of the per sec quota of ses. Now that i have a quota of 70 per sec, it sends and waits for the answers for all of them? what happens if all but one are delivered and retries only the one that was not reported ok? When does sendy load the next 70?
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    Finished sending to 99.000 users in 6 hours 48 minutes.
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support
    Hi @Ergun @derivativemedia, how about increasing your PHP's memory_limit to 1GB and see how it pans out? With a send rate of 70 per second, PHP is executing 70 processes per second. Both of you have the exact same settings, on a small EC2 instance, with 1.7GBs of RAM. Bumping up the memory may improve speed.
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    I will give it a try. shouuld I do it in htccess or php.ini?
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    ok i did it, dont bother
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    hi @ben, I changed PHP's memory limit to 1024M and sent today to a list of 3.906 subscribers. It took 13 min to deliver. This equals to a sending speed of 5 p/sec, but i have a quota of 70/sec. Still no change in speed!
  • no luck here either
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    Hi @Ben, I'm going to send 300K emails on wednesday, at the current speed it will take more than 16 hours to send, is there anything else to be done?
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support
    Hi @Ergun, I previously tested sending with a send rate of 28 emails / second. Even though sending did not reach maximum speed, it was pretty fast. I'm going to test with 70 emails / second with a 1GB allocated memory.

    In any case, all emails transferred to Amazon SES will not be immediately sent. The time taken for Amazon to send your emails after emails are transferred to Amazon is usually longer.

    I know this because I've always tested sending emails to a 'catch-all' email. The time taken to receive all emails from Amazon is much longer than when they are fully transferred from Sendy to Amazon.
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    If alone the transfer takes 16 hours, this is way too high, and a big problem. If it took 2 hours 2 send to ses and another 2 hours for ses to send, this would be acceptable. I do not know with what type of emails you achieved 28 emails per sec, but with real emails and a bounce rate of 0,02% i can not get even this high. This is a very big problem for me. But @derivativemedia says he achieved 10.000 per 5 min, with the older version, so there must be a problem in the update.
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user
    I sent today to the same list of 3900 subscribers another campaign, it also took 13 min to deliver.
  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    Sent yesterday to 210.000 subscribers. It s been 23 hours and sendy is still sending

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    @ben, happy new year. Does the update address this problem as well?

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    @Ergun Happy new year to you too!

    I've tested sending with 70 emails per second and yes it does slow down a bit. When I change the send rate directly in the database in the middle of the send to a smaller number like 28 emails per second, it took a shorter time to execute 28 emails at once.

    What I deduced is that it is not an issue with the script (as much as I've tried removing the auto-retry code etc), it's just that the more emails the server processes in parallel, the longer it will take. Processing 70 emails at once apparently taxes the server more than processing 5 - 28 emails at once.

    Though, do not be mistaken that sending at 70 emails per second is slower than say, 28 emails per second, because your server does deliver 70 emails in parallel constantly to Amazon SES even if it does not take 1 second to finish each iteration of 70.

    I've previously tested 26,000+ emails and it took around 49 minutes compared to when you sent 26,000 emails it took more than 1 hour → http://sendy.co/discussion/415/sending-speed-cant-get-higher-than-26-000h#Item_2

    The only difference between the servers you and I are using even though we're both hosted on EC2 is that I'm using Linux and you're using Ubuntu. I'm not sure if there's a performance difference but looking at the numbers I think there's a positive.

    Lastly, Amazon does not send your emails immediately once emails are transferred from Sendy to Amazon. I've tested this numerous times sending tens of thousands of emails to a test 'catch all' email address. Emails trickles in very slowly even though all emails have been sent (transferred to Amazon). Hence, even if you are able to transfer your emails to Amazon at exactly 70 emails per second, Amazon will still be in the process of sending emails to your recipients. You can try testing this by sending emails to your own 'catch all' email address and name your emails 'test1@domain.com, test2@domain.com' etc.

    Although I can verify that there is no problem with the sending script, I will continue to do research and see how I can improve it.

    Thanks.

    Ben

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    Thank you for your answer. Is testing to one smtp server the same as sending to various domains and servers as is the case in my situation? Did you try testing with a larger ec2 instance? I hope we solve this problem as I have aquota 500K per day but due to the slow sending speed, can never fully utilize my quota.

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    Hi @Ergun,

    Thank you for your answer.

    You're very welcome.

    Is testing to one smtp server the same as sending to various domains and servers as is the case in my situation?

    It doesn't matter though. What Sendy does is transfer your emails to Amazon SES. Amazon in turn sends out your emails.

    Did you try testing with a larger ec2 instance?

    If I test it on a larger instance, my sending speed would be even faster.

    I'm on the micro instance using Linux. You're on small instance (higher performance than mine) using Ubuntu. And my sending speed is already faster than yours. If I were to upgrade to a larger instance, sending would be even faster.

    I hope we solve this problem as I have aquota 500K per day but due to the slow sending speed, can never fully utilize my quota

    Again, there is no problem with the sending script. It's just that the server is processing a huge amount of emails (70) at once (in parallel). And performance varies between different server software. You can try running Sendy on Linux small instance instead of Ubuntu.

    Lastly, I checked your phpinfo and found that your memory_limit is still at 128M (although you mentioned you've bumped it up to 1024M):

    image

    Thanks.

    Ben

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    I changed my php memory limit to 1024, I think i did something wrong. Will try again. Is there some other place to change it?

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    You can include this code in .htaccess: php_value memory_limit 1024M

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    I did it ok. Now it is set to 1024M. Today I have sent 2 campaigns. The first one was to a list of 3500 which was normally delivered in 13 min but today it was down to 7min. Than I have sent another campaign to 41.644 subscribers, which was fiinished in 111 min. This makes 375 sends/min, which is 6.25 sends per sec and my quota is 90 per sec. Is there any other setting I have to check? I can not even get to the speed you get on your micro instance.

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    Hi @Ergun,

    Today I have sent 2 campaigns. The first one was to a list of 3500 which was normally delivered in 13 min but today it was down to 7min. Than I have sent another campaign to 41.644 subscribers, which was fiinished in 111 min. This makes 375 sends/min, which is 6.25 sends per sec and my quota is 90 per sec.

    Now that your sending speed increases when your PHP allocated memory_limit increases, this means you'll need to increase your server memory in other to get even higher sending speeds. Which means upgrading to a more powerful instance.

    Is there any other setting I have to check? I can not even get to the speed you get on your micro instance.

    The only difference now is that I'm sending on Linux and you're sending on Ubuntu. Apparently there's a difference in performance.

    Thanks.

    Ben

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    Final score it took 24 hours to finish last campaign of 196000 subscribers. Its getting worse then before.

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    Hi @Ergun,

    I guess you can only try changing to Linux with a higher CPU and memory. Processing 90 jobs at once is very taxing and apparently it takes longer than 1 second.

    Thanks.

    Ben

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    Ok. I will try. A reason mine is too slow may be the number of subscribers. I have 300.000K subscribers on my db.

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    A reason mine is too slow may be the number of subscribers. I have 300.000K subscribers on my db.

    That may be one of the reasons too.

    I just setup a Large instance on EC2 (Apache/Linux). Allocated 7GBs in memory_limit for PHP.

    I test sent to 15,000 emails and it took only 13 minutes.

    Compared to one your campaigns where you said:

    I sent today to the same list of 3900 subscribers another campaign, it also took 13 min to deliver.

    It took 13 minutes to deliver 15,000 on my Large instance.

    The sending speed is significantly higher when the server specs are better.

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    Hi ben, Today I have sent to 41.583 subscribers after upgrade to standard medium instance, it took 66 min to deliver. It is better. Would indexing the subscriber table result in better performance?

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    Today I have sent to 41.583 subscribers after upgrade to standard medium instance, it took 66 min to deliver. It is better.

    The higher your server performance, the faster it will send.

    Let me give you an analogy using a body builder as an example:

    Number of bicep curls a LIGHT weight bolder builder can do in 5 seconds with a 50kg weight

    • Maybe 5 reps

    Number of bicep curls a HEAVY weight body builder can do in 5 seconds with a 50kg weight

    • Maybe 10 reps

    The stronger a body builder is, the more bicep curls he can do in less time with the same weight. The more memory / CPU a server has, the more it can process in less time with the same number of emails.

    Would indexing the subscriber table result in better performance?

    You can try. But if you index the subscriber table, you will slow down the import of new subscribers, eg. when you do a CSV import - it will be significantly slower.

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    I have made multiple sends of which I'd like to share the results (with a medium instance at AWS): Subscribers Duration sends per sec 3.595 3 min 20 135.856 366min 6.20
    56.052 82min 11.40 22.857 27min 14.10 41.543 66min 10.50

  • Vote Up0Vote Down ErgunErgun
    Posts: 67Sendy user

    Its almost not readable, here the summary: best performance 20mails/sec when sending to 3.595 subscribers worst performance 6.20mails/sec when sending to 135.856 subscribers

  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    Hi @Ergun,

    Thanks for the stats. If you want even higher speeds, scale up your instance. To understand why, read my explanation above (the one with the analogy).

    I want to close by saying this (again) - Sendy uses multi-threading to send your emails, it processes your send rate of 70 emails at once in each iteration. If you server is powerful enough, it can process this bulk of emails in 1 second. Then, your overall sending speed will be fast.

    Thanks.

    Ben

This discussion has been closed.
All Discussions