Page 1 of 1

how long does it take to send 1000 mails ..?

Posted: Wed Feb 07, 2007 4:09 pm
by jepe
hi,

i've been reading about Swift Mailer for a week or so .. and I already got it work .. and have no problems ..

but i would like to know how to "desing" sending my mails ..

I have to send over 1 000 mails at a time ..

and my server goes tome out after 20 secs or so ..

as I understand there's a looping in Swift Mailer .. so I suppose it's taking some time to send like 1000 mails ..
---------

so my question is: how many mails can I possibly send at a time ..
like within 15-20 seconds ..

and also: how long should i wait before next call .. 1 minute or 2 ..?

thanx very much!

peter

Posted: Wed Feb 07, 2007 5:42 pm
by vwiley1
Are you on shared hosting? Ask your host the hourly and daily limits.

If you are on your own server, check to see if your mail server has limits.

Depending on your mail server, sending mail can send server loads up pretty high. If swiftmailer allows you to send out in batches... I would send out 3 mails every 10 seconds. For 1000 mails, that would take 55 minutes.

Posted: Wed Feb 07, 2007 11:06 pm
by jepe
yeah I'm on shared hosting ..

and it's a good one - but after 20-30 minutes apache goes like internal server error ..
which kills nice logging :(

what i don't have is the abelity to set_time_limit(0) .. i mean i can do that - but server will stop on its own :)

mailsending limits i don't seem to have however .. cause i've been sending these 1000 mails in like
5 minutes (50 BBC-s in one) so far .. until i found out that php's mail() sucs :)
i don't want to be rude to the server - that's all ..


however sending 3 mails in 10 secs seem to me as quite a few - i mean Swift Mail's strength is not opening a new socket connection any time when sending a new one .. i hope i can utilize this Swiftness somehow :)
also i want to send mails like 1/ person - no BCC-s :)

Thans!

Peter

Posted: Thu Feb 08, 2007 12:28 pm
by Chris Corbyn
ignore_user_abort() ;)

Your first question way too vague. Swift is fast. Your SMTP server might not be. How long's a piece of string? ;)

I was managing to send 10 emails per second to a remote SMTP server but I know that the bandwidth was good, and the server was only processing my mail, not loads of other stuff. Going via Sendmail (i.e. locally) you may get as high as 100/second -- but that's a false sense of speed; they all just sits on the mail spool and then go through the normal SMTP process.

If you're desparate for lightning fast speeds get off shared hosting and get a dedicated server :)

Posted: Thu Feb 08, 2007 4:03 pm
by jepe
hey d11wtq,

thanx for your post!

my question didn't mean to be wague - sorry .. i'm almost certain that it's misunderstanding - however I love Woody Allen movies too much and leatrn to much from them - so maybe I won't g deep into expanations and excuses :)

what I was talking about - sorry - the server I meant is going down every 15-20 mimuts - by itself !!
not the mail part .. even if I get some text processed by some easy scripts .. so it's not even related to Swift (!!!!)

it's just my given circumstances .. I mean i have lie 1-20 seconds to send - without a problem .. and i wanted to fugure how much can I send in that period ..

You answered that and thank you!

also - make a note - that the previois kind poster's answer I didn't "buy" (no offence) .. I mean I knew that Swift must be wy coooler than sending 10 per seconds (or 1000 / hour :))

I knew that the open TCP socket must be great advantage - and that's the heart of our dear Swift - I guess :)

so once again the sever weaknesses are not even related to swift .. Swift i'm jut going to run - for real - for the first time .. and just didn't want to get a server error and know nothing about whatever went out :)

i'm giving all RESPECT to SWIFT .. really :)

and thanx again !
these numbers really helped ..

you know I just tried to fiigure how many to put in the addresses array - to go thru - within my stupid time-limitations ...

Posted: Thu Feb 08, 2007 5:59 pm
by vwiley1
yeah I'm on shared hosting ..

and it's a good one - but after 20-30 minutes apache goes like internal server error ..
which kills nice logging
Does this happen normally? If so, it doesn't seem like a good one. If it happens when you were sending your mails with BCC, I wouldn't be surprised. Trying to send that much mail is going to fill up the mail queue and cause server loads to go high.
mailsending limits i don't seem to have however .. cause i've been sending these 1000 mails in like
5 minutes (50 BBC-s in one) so far .. until i found out that php's mail() sucs
i don't want to be rude to the server - that's all ..
The funny thing, is you were being rude to the server rather you know it or not... Your on shared hosting meaning you have to share resources such as CPU and RAM. If my next statement isn't true, then you were probably using more than your fair share of CPU.

Next Statement: Most hosts that I know of silently discard BCC's in PHP Mail.... So there's a chance those BCC's didn't even go out. That is a common thing that hosts do to prevent contact forms from being exploited by spammers (spammers use BCC when exploiting contact forms or other forms on web sites that are capable of sending mail).
what I was talking about - sorry - the server I meant is going down every 15-20 mimuts - by itself !!
not the mail part .. even if I get some text processed by some easy scripts .. so it's not even related to Swift (!!!!)
Again, it doesn't seem like your hosting is as good as you claim. It's not normal for a server to go down every 15-20 minutes. Again, if this was only happening near the times you were sending all your BCC's, it was probably caused by the server being overloaded (BY YOU).
also - make a note - that the previois kind poster's answer I didn't "buy" (no offence) .. I mean I knew that Swift must be wy coooler than sending 10 per seconds (or 1000 / hour )
Well that previous "kind" poster was me... and rather or not you bought what I was saying... your still on a shared server...and you have to "share" resources like CPU and RAM. There's no doubt in my mind that Swift is cool, and is capable of sending 1000's of mails per minute. In fact there's other scripts just like it that can do the same thing (PHPList, Dada Mail, Mailman ect...).

The question is... is how much is too much for the server to handle? That's not something you can answer...because you have no idea how much load is on the server to begin with. How fast you can send also depends on the server specs. Those are questions for your hosting provider.

If you were on your own dedicated server, and there were no other clients or websites that would be affected by your sending.... There is still a limit to how fast the server can send the mail out and it all depends on the available CPU and RAM in the server.

Also keep in mind, different hosting providers have different setups. I have also shown you one example above, where some hosts silently discard BCC emails sent with PHP Mail().

Other things that some hosts do:
Set daily and hourly email limits and bounce messages over the limits.
Set daily and hourly email limits and silently discard messages over the limits.
Suspend customers for CPU Abuse if trying to send mails to fast and overloading the server.
Limit how long a PHP process can run (for example, some hosts will automatically kill a PHP process if it runs longer than X minutes)

If you don't believe me, contact some of the popular hosting providers out there (HostGator, HostRefugee, Dreamhost, Servage, PowWeb, Site5, ect...). That's just a few hosts off the top of my head....and every one of them has sending limits.