Performance Tweaks on 4.0.0

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
KevinC
Forum Newbie
Posts: 8
Joined: Sun Feb 15, 2009 12:01 pm

Performance Tweaks on 4.0.0

Post by KevinC »

I would like to know what performance tweaks are available in this version?

My short term goals are to implement a system able of injecting 300K+/hour newsletter messages into an external Postfix server. Currently by running multiple processes I am achieving upwards of 200K/hr (3400/min) with some very simple examples.

The messages are all based on the same content so we do not need to read the message each time and we handle some some minor personalization (ie: names) to each.

As we will be handling multiple subscriptions of over 1M records requiring timely delivery this is very important to me.

Thanks for any pointers and help.
Kevin
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Performance Tweaks on 4.0.0

Post by Chris Corbyn »

Xavier is working on a number of optimizations. In short, version 4 is currently slower than version 3 due to some of the encoding algorithms being corrected (but more expensive as a result). We should be able to get the time down considerably. Xavier has some patches ready to apply but we can't release them just yet due to lack of unit test coverage (which scares me).
xdecock
Forum Commoner
Posts: 37
Joined: Tue Mar 18, 2008 8:16 am

Re: Performance Tweaks on 4.0.0

Post by xdecock »

I have the same needs, so swift will have the needed speed for those elements, however i have few times for the very moment.

However "the same message" with small personnalisation is a big issue in fact.

because the code work that way

=> Send() => Personnalisation => QPencoder => cache (which is discarded when the content change) => sending => return


and the big perf problem is: QPencoder.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Performance Tweaks on 4.0.0

Post by Chris Corbyn »

I should note, if your server supports 8BITMIME then you can do:

Code: Select all

$message->setEncoder(Swift_Encoding::get8BitEncoder());
This will be considerably faster than QP encoding (since it doesn't actually do any encoding). We can add something to automate this process in some way (an ESMTP extension that checks for 8BITMIME in the EHLO response). Currently it's a manual process.
KevinC
Forum Newbie
Posts: 8
Joined: Sun Feb 15, 2009 12:01 pm

Re: Performance Tweaks on 4.0.0

Post by KevinC »

I tried to add that by after inserting it I'm getting:
"Call to undefined method Swift_Encoding::get8bitencoder() in "....

I'm on 4.0.0-b5, Do I need download something else.

Thanks,
Kevin
BrandonMUS
Forum Newbie
Posts: 15
Joined: Mon Nov 10, 2008 9:45 am

Re: Performance Tweaks on 4.0.0

Post by BrandonMUS »

try instead

Code: Select all

Swift_Encoding::get8BitEncoding()
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Performance Tweaks on 4.0.0

Post by Chris Corbyn »

My bad, sorry I didn't check the actual method name :)

I'm going to make this the default behaviour so that speed is better. Swift Mailer will use full 8-bit content unless no 8BITMIME extension is found on the server.

Much faster to work with.
KevinC
Forum Newbie
Posts: 8
Joined: Sun Feb 15, 2009 12:01 pm

Re: Performance Tweaks on 4.0.0

Post by KevinC »

Thanks - That did it!

-Kevin
Post Reply