Apache crash when sending mass email through third party

136 Views Asked by At

I have a LAMP stack setup on Digital Ocean (Ubunu 12.04) that is pretty stable. The only time we have had a crash is when we sent out a mass email to about 30,000 people. We are not using the server to send the message, but a third-party email service (iContact). I watch the server with Top and can see it fill up with apache entries (each taking about 20MB) for a short while then drop back down after the mail has finished being sent.

I have successfully adjusted the apache settings to no longer crash - it just slows down for a bit. These are not hits to the pages, but something is making apache ramp up and spin off a ton of workers during the email send process.

My question is, where do I look to get some idea of what is happening? Unfortunately iContact has been no help and the log files I've looked at aren't telling me much, so I think I'm likely looking in the wrong place.

1

There are 1 best solutions below

0
On

I used to send emails to over 200,000 people directly from a single machine. Trying to do it from a webpage is pretty crazy, so I wrote a command-line based script to first write it into a database, and then send ~50 at a time from the database, deleting as it went.

With Symfony/Swiftmailer it is pretty easy these days - the sending part is just a shell script that keeps running 'app/console swiftmailer:spool:send', sleeping and restarting till the database is empty.