Page 1 of 2

SwiftMailer Scalability (>million emails/day)

Posted: Tue Mar 18, 2008 11:25 am
by rsgopi
I am using the swiftmailer for myspace like "invite friends" feature in a website. Considering the current growth rate this may get huge (more than 1 million emails/day)...Does anyone use swiftmailer (with decorator) for high volume mailing (>1 million emails/day)

PS:-
We use a commerical MTA (powerMTA) which can handle this level of volume, so i am only concerned with the ability of swiftmailer to feed the MTA.

Re: SwiftMailer Scalability (>million emails/day)

Posted: Tue Mar 18, 2008 10:12 pm
by xdecock
I'm currently using Swift to feed Postfix with RSA cryptographic signatures (it's the slowest point of the setup) and even with this i'm getting a sustained rate over 85K mails / hour on a low-end server (we are preparing the setup for the "big" server) so, at first glance, it can easily handle more than 2 millions emails a day. (email mean size is about 45 Ko)

Re: SwiftMailer Scalability (>million emails/day)

Posted: Sun Mar 23, 2008 11:54 am
by rsgopi
Thanks for your reply. Are you using the decorator plugin to personalize the emails?...The reason i am asking is i saw other thread saying that swiftmailer is having some issues with email personalizing (with large number of emails). so i am concerned!

Re: SwiftMailer Scalability (>million emails/day)

Posted: Sun Mar 23, 2008 6:49 pm
by Chris Corbyn
Decorator is broken for now unless you want to try and apply this fix:

viewtopic.php?f=52&t=77319&hilit=decorator+plugin

Sorry.

Re: SwiftMailer Scalability (>million emails/day)

Posted: Mon Mar 24, 2008 11:56 am
by rsgopi
Chiris, i understand you dont want to release any more 3.3.x versions and want to focus on php 5. But since this is a major serious bug can you please consider releasing a new intermediate version with the fix you mentioned?.

Thanks in advance for your consideration :)

Re: SwiftMailer Scalability (>million emails/day)

Posted: Mon Mar 24, 2008 3:53 pm
by Chris Corbyn
Serious bugs in the core of Swift I would consider doing that for, but since this is just in a plugin it probably doesn't warrant a new release. The other factor in that decision is that it's something you can implement in a more optimized fashion yourself anyway by just doing str_replace() in a loop.

Code: Select all

$text = 'Hello {name}';
 
foreach ($users as $email) {
  $message->setBody(str_replace('{name}', $replacements[$email]['{name}'], $text);
  $swift->send($message,  ....);
}
:)

Re: SwiftMailer Scalability (>million emails/day)

Posted: Mon Mar 24, 2008 4:57 pm
by rsgopi
Thanks for the reply Chris...One of the factors which turned me from PHPmailer to swift is the decorator plugin which promised performance boost in message customization!. Since the fix is a simple one putting the modified code as a new version made sense to me, thats why i posted the request. Anyway this is your baby and i understand you have the absolute authroity to decide :)

Re: SwiftMailer Scalability (>million emails/day)

Posted: Mon Mar 24, 2008 6:21 pm
by Chris Corbyn
There's really no performance boost over the code I posted above ;) It's slower in fact. The plugin has to scan the message headers and all sub-parts that are attached to it, then it has to "restore" the message when it's finished. With a simple str_replace() you, the programmer, know exactly what needs replacing so that scanning and restoring overhead is eliminated.

Hopefully I haven't promised a performance boost in the documentation for the decorator since it really will not give you one ;)

Swift Mailer in general offers a HUGE performance boost over PHPMailer though.

Re: SwiftMailer Scalability (>million emails/day)

Posted: Mon Mar 24, 2008 7:30 pm
by EoN
Would just like to say the fix in the linked thread worked for me well so far (haven't tried the inline one above) - as I unfortunately DID run into this bug in a live mailout, which caused quite a bit of trouble. But was manageable.

While on the topic, just thought I'd add my opinion/2c on the topic of the importance of this bug, and while you say it's just a 'plugin' Chris, personally I'd call this a critical, serious, ultra-high-priority bug... In my eyes it's as important as 'core', because the end result is live businesses sending out completely wrong information to potentially thousands of customers. In some respects, I can't see what would be any more important. In my situation I'd have much rathered the mailout simply not work (core), than for it to send out wrong information. If it just didn't work, I could chase down the problem & fix. But as it turned out, there was nothing I could do to fix that mailout which had already gone out, with flaws.

Anyway that's just my personal opinion. Only offering it because I feel that many people might be scared off by this issue, and I'm a complete 100% Swift supporter, and want the best thing for it where possible!

Having said that I understand that doing a whole new minor release before your next major release might not be feasible regardless of the severity.... Obviously it's for you to say. But yeah - I guess I just wouldn't underestimate the real world/practical severity of that bug.

All the best!

Re: SwiftMailer Scalability (>million emails/day)

Posted: Mon Mar 24, 2008 7:45 pm
by rsgopi
Chris, i misunderstood this document and assumed that the decorator plugin offers perfromance boost with some sort of caching mechanism...My bad!

Re: SwiftMailer Scalability (>million emails/day)

Posted: Mon Mar 24, 2008 7:55 pm
by rsgopi
Also i agree with Eon that this is a very very serious bug!..imagine what would happen if some business send personal financial details to users not meant to receive that!.

I just saw that you put a warning message in the decorator page, but some may overlook it, so i would suggest atleast to take the plugin out of the package until the next version!.

Re: SwiftMailer Scalability (>million emails/day)

Posted: Tue Mar 25, 2008 1:47 am
by Chris Corbyn
Hmm, decisions decisions.

Given the hold-up getting v4 out of the door (I'd love to share my reasons but can't just yet) I'll go for an "easy life" to shut you guys up ;)

Ok, just kidding.

I'll assess how easy it will be to:

a) Patch in that plugin fix (easy)
b) Backport the new QP encoding system which fixes some issues with certain charsets in message headers

(a) is simple, (b) could just be too messy to try and wrap into the new system so in the best case scenario it will be a "quick-fix" just to get by until the new version comes out. At worst (b) will just have to wait. I won't spend any longer than a few hours working on the old version since I have no plans to continue developing it and I'm already dusting off (read, heavily refactoring) the new version.

Hopefully I'll get chance to do this tonight but I'm seriously stretched at the moment with 4 open source projects, my work for SitePoint and an Australian Visa application (painful).

I hear you though :)

Re: SwiftMailer Scalability (>million emails/day)

Posted: Tue Mar 25, 2008 10:54 pm
by rsgopi
Thanks very much for considering the fix, Chris!

Re: SwiftMailer Scalability (>million emails/day)

Posted: Wed Mar 26, 2008 12:27 am
by Chris Corbyn
Here's the situation. I was in no position to patch anything from v4 into v3 last night since v4 was halfway through a refactor. Bring the encoding stuff from v4 to v3 is going to be too much work since it uses a different interface and an adaptor would effectively make it just as dumb as the current one (the problem is that the current one doesn't follow charsets for QP encoding). In addition to that it would mean the release would be a PHP5-only release.

I'll release a PHP5 and 4 3.3.3 tonight, with the plugin fixed. This will be the very last v3 release.

Last night I did finish the refactoring I was in the middle of with v4 and I'm getting very excited about it's release but it will be a short while yet. I've got a designer do a bit of work for me on the website among other things, and the documentation needs writing. There will be a fairly long beta period with v4, not for stability reasons, but because I'm working on a sister project which will officially be launched with the first full v4 release. More on that soon.

Re: SwiftMailer Scalability (>million emails/day)

Posted: Wed Mar 26, 2008 5:21 am
by Chris Corbyn
3.3.3 is out. I had some huge troubles uploading to SourceForge and creating the releases but they seem to work. SF is obviously not having a good day (for once!). :)