Author Topic: Mail Throttling  (Read 4515 times)

mike_mac

  • Posts: 17
    • View Profile
Mail Throttling
« on: May 29, 2007, 09:51:10 am »
Hi

I used the following code to throttle my mailings:

if(($y % '2')==0 && $y <> sizeof($sendq)) usleep(14500000);

pasted into admin.php in the appropriate place.

this has worked, but the mailings seem to stop and i have to resume them on a regular basis, initially I had to throttle mail down to 250 per hour, so i had to resume them like 20 times over a period of 2 days (i wasn't spending hours watching the computer, so just came back every hour or so to resume it)

My hosting package is being upgraded and I am told then my limit will be between 1.2k and 3k per hour. so i will be able to reduce the time limit in the throttle code, but i still do want to have to keep resuming my mailings.

any ideas.

thanks

Mike

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Mail Throttling
« Reply #1 on: May 29, 2007, 04:43:30 pm »
Hi Mike, Please test whether your server has a set script time limit that could be causing this.  Some PHP code you can use to do this can be found in the following post:

http://listmailpro.com/forum/index.php?topic=1747.0

I also recommend enabling the "Always write SMTP log" option on the Configuration page.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Mail Throttling
« Reply #2 on: May 30, 2007, 07:03:49 am »
Mike,

Quote
but i still do want to have to keep resuming my mailings.


I also use throttling, mostly to make sure the mail gets through and I have shown it results in more clicks - most likely a busy mail server is not able to handle clicks and accesses to the mysql tables, so throttling helps.

You never mention if you setup the 'resume.php' script?  That script prevents you from having to click 'resume' over and over.  Even though you will still see the mailings stop, and even possible errors, it won't matter as the resume.php script will restart the mailing for you automatically.

I setup my resume to run every 2 minutes in cron, that way it restarts very quickly if it would go down, here's my crontab call for resume:
Code: [Select]

*/2 * * * * /usr/bin/wget -O /dev/null -T 0 http://MYDOMAIN.COM/mail/resume.php?pw=mypassword 1> /dev/null 2> /dev/null


If you haven't set up resume.php, give it a try, see if that solves it for you.
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

mike_mac

  • Posts: 17
    • View Profile
Mail Throttling
« Reply #3 on: May 30, 2007, 11:15:37 am »
Hi Dean thanks for your response,
I tried the timetest.php script and it worked fine.

Webshamen, I wasn't even aware of the resume.php!! so i guess this just will restart the maillings if they have stopped automatically.

I can easily set that up in my cron, thanks webshamen.

Should i need to set up the resume script? i never had any problems (well once or twice) with the mailings stopping before I throttled the mail.

thanks

Mike

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Mail Throttling
« Reply #4 on: May 30, 2007, 01:37:21 pm »
Mike,

Quote
Should i need to set up the resume script?


Set it up anyway, it will be there if LMP ever stalls out, or exits with an error.  You may want to make sure it's working properly and the only way to do that is run a large mailing and wait for an error, then go to any screen in LMP and watch the top # of messages in queue, as you refresh you'll notice when it's stalled the # of messages never changes, when resume.php kicks in, the emails start going out again and the # of messages goes down.

Before Dean put this in LMP  I had to sit there for days clicking 'resume'  :roll:
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Mail Throttling
« Reply #5 on: May 30, 2007, 05:04:30 pm »
Mike,

Try enabling the SMTP log so we can hopefully see exactly where/why the system is stalling.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

mike_mac

  • Posts: 17
    • View Profile
Mail Throttling
« Reply #6 on: May 31, 2007, 04:46:33 am »
Thanks Guys, I'll turn on the SMTP log and as soon as i get an error i'll post it here.

Know what you mean webshamen, spent most of last weekend clicking resume every time I walked past my computer! :roll:

mike_mac

  • Posts: 17
    • View Profile
Mail Throttling
« Reply #7 on: June 01, 2007, 11:40:32 am »
OK started sending my mailing today, and just have one question, when LM disconnects after sending X emails (option on the config page) when / how does it reconnect? is that the connect every x minutes setting?

It doesn't matter now as I am running the resume.php on my cron. but noticed today that i had the mails throttled to 2 every 14.5 secs which is 500 an hour, so I thought setting the disconnect to 250 would stop the mailing, which it did, which then brought this question to mind. I would just like to try and get some idea of how many emails were going out.

thanks

Mike

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Mail Throttling
« Reply #8 on: June 01, 2007, 12:03:01 pm »
Mike,
Quote
when LM disconnects after sending X emails (option on the config page) when / how does it reconnect? is that the connect every x minutes setting?

No, the "Reconnect every X messages" option is separate from the "Authorize by checking email" method.  When reconnecting ListMail sends a QUIT command, then starts a new connection to the SMTP server.
Quote
I thought setting the disconnect to 250 would stop the mailing, which it did, which then brought this question to mind.

Hmm, maybe your host has a limit of 1 connection per IP or requires that some time pass between SMTP connections (although, I've never seen that before).  Does it always stall when it tries to reconnect?  ie. can you only get out as much email as listed in the "Reconnect" feature?

Send me some ListMail SMTP logs (or access to your FTP server) via email to dean@... when some logs have been written and I will check for clues.  You could also go ahead and submit a full bug report here so I have all the information needed for testing your server.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

mike_mac

  • Posts: 17
    • View Profile
Mail Throttling
« Reply #9 on: June 02, 2007, 05:49:19 am »
My Mailings are stopping every 200?? in the config its set to 1000, and the cron resume.php isn't working, this is the command i have running on the cron every 5 mins:
/usr/bin/wget -O /dev/null -T 0 http://ipaddress/listmail/resume.php?pw=mypassword> /dev/null 2> /dev/null

thanks

Mike

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Mail Throttling
« Reply #10 on: June 02, 2007, 10:56:30 am »
Mike,

It looks like you have your autoresume setup wrong, look at the end of the call, it should be:
Code: [Select]
1> /dev/null

You have:
Code: [Select]

> /dev/null 2> /dev/null


You're missing the "1" and just have ">", I'm not sure if that will affect it, but it could.  This is telling the call to pipe the standard output 1 to /dev/null (basically disappear).

There's a way you can test it.  Shell in to your host, using SSH/PuTTY, and then run the command, but without the >1 /dev/null 2> /dev/nul and see what output you get, you should see that it runs, or if not an error.

If you see an error post it here, someone will know what it means.  If you don't see an error, it's likely that the missing '>' as mentioned above is the problem.

Good luck...
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Mail Throttling
« Reply #11 on: June 03, 2007, 04:30:21 am »
Mike,

If it stops at 200 there might be a limit of 200 messages per connection.  Try setting your "Reconnect every X emails" to 200.  I think Brett is right about the autoresume script - the command-line should look like as mentioned in the help file here.

Please let me know if I can be of further assistance.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

mike_mac

  • Posts: 17
    • View Profile
Mail Throttling
« Reply #12 on: June 04, 2007, 07:21:22 am »
Thanks for your suggestions guys, OK, i have copied the line from my dailymail cron command, and changed dailymail.php to resume.php and changed the timing to 2 mins (my host has a control panel to set up the cron, so i just put in the command to run and set what timing i want on it). The resume script doesn't seem to be doing anything, but the dailymail script runs as its supposed to every 24 hours, here is the command to run resume:
/usr/bin/wget -O /dev/null -T 0 http://myaddress/listmail/resume.php?pw=mypassword 1> /dev/null 2> /dev/null

thanks

Mike

mike_mac

  • Posts: 17
    • View Profile
Mail Throttling
« Reply #13 on: June 04, 2007, 03:13:58 pm »
Got it sorted, the way the cron works on my hosting, i though i had it configured to work every 2 mins, but it was actually set to run 2 mins past each hour! Dean, Brett, thanks very much for your help.

Mike