I am currently running a website that generates over 2 million page views a day.
I am sending 2 million emails (1 per page view) at the time of each pageview.
I have 3 servers on a load balancing switch.
My servers are linux with sendmail running php 3. For each pageview I have started writing a file that is named the persons email address. It is saved in a directory "month/day/hour/minute/email@domain.com"
The message is the same for anybody so it is an empty file.
This all runs fine.
What I had intended to do was send a message to each person for the next 10 days once a day.
I want to run a cron job every minute that wgets a php page that opens up the directory from 24 hours ago and reads the files in the directory sending a mail to each one in the loop.
This would all be fine, but I think my system will not be able to handle all the mail after the 10th day rolls around.
If I run mail() in a loop with 1000 email addresses each server can do them in 1 min.
What would make speed this up?
Writing to text files appears to be much faster than mysql for me. I am writing to about 2 million text files a day with php right now. Is there a better way to do this? I tried to import data to mysql and It took a long time to import 1,000,000 emails.
Is there a better way for me to sendmail to a email address other than running a cron to run a php script? I think php mail() is slow and sendmail seems to keep up just fine.
when the php mail function is run it does 100 at a time with a slight pause in between. Can this be changed to make it faster? I changed sendmail varibles and made them all much higher than 100.
does postfix or qmail make the mail() function faster? If so does anyone know how much faster? I have sendmail set to process in the background.