Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Cron based e-mail sending Details »»
Cron based e-mail sending
Version: 3.8.001, by Paul M Paul M is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.8.x Rating:
Released: 01-09-2009 Last Update: Never Installs: 295
Uses Plugins
Code Changes Additional Files Translations  
No support by the author.

As of 24 Nov 2017 this modification has been withdrawn.

In default vBulletin, if you send a large number of e-mails, vbulletin either puts them in it's queue and attempts to send them as each user visits a page, or just simply tries to send them straight away (as is the case when you use the Administrators email users inteface).

The result of this can be that your server can gets seriously overloaded very quickly - or on many hosts, you get banned for exceeding their e-mail sending limits. This can make sending several thousand e-mails (like a newsletter) very difficult.

This modification does two things ;

1. The processing of the mail queue is set-up as a vbulletin cron item.

2. Allows you to add a small delay before each e-mail is sent (between 1 and 9 seconds).

3. E-mails from the ACP inteface are sent to the mail queue, not straight to the mail system.

Use option 2 carefully, otherwise you will slow your e-mail system right down.

For this to work, you must turn on e-mail queuing in the ACP options - set 'Use Mailqueue System' to 'Yes', and 'Number of Emails to Send Per Batch' to a realistic value (based on the cron setting, as below).

There are two options for the cron job, you can either set it to run every minute, and set the items to be processed to something small (like 10), or you can do what this modification does by default and set it to run every 10 minutes, and set the items to be processed to something larger (like 100).

Remember, 10 per minute = 600 per hour, 100 per 10 minutes is also 600 per hour. The numbers really depend on how quick you want large queues processed, and how much your mail server can handle in one go.

Once working, when using the ACP mail users inteface, remember you can set it to process 9999 at once (not 500 or whatever) as the mails will now go into the queue, not be sent directly.

Note: This modification will affect any queued e-mails such as subscription e-mails. It will not affect registration e-mails as they bypass queuing anyway.

This modification includes the code by Antivirus that displays the current size of the mail queue.


History:

v3.8.001 : First Release for vB 3.8.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
ahmedeldeep, need2fart, rpgamersnet, xorex

Comments
  #62  
Old 03-30-2009, 03:02 PM
PPUS PPUS is offline
 
Join Date: Mar 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, thanks Paul... so I have it set as:

Number of Emails to Send Per Batch: 50 and the delay at 1 second. Is this the only setting I need? I do not want to exceed 500/hour as I am allowed 600 and the extra 100 is for other functions and email users on the server. I am I correct that there are no settings in the mod/hack, only those in the ACP?

Gotta say I am nervous as a long tail cat in a room of rocking chairs.
Reply With Quote
  #63  
Old 03-30-2009, 04:15 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The cron runs 6 times an hour (every 10 minutes), so 50 x 6 = 300 an hour, well under your 500/Hr - you are fine.
Reply With Quote
  #64  
Old 03-30-2009, 04:48 PM
PPUS PPUS is offline
 
Join Date: Mar 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
The cron runs 6 times an hour (every 10 minutes), so 50 x 6 = 300 an hour, well under your 500/Hr - you are fine.
Ahh, the light bulb comes on, I did not realize the cron ran 6x per hour. So whatever I put in the field is x6 to give me the hourly send rate. So a quick math lesson for other:

Setting the "Number of Emails to Send Per Batch" to:

50 = 300/hr
60 = 360/hr
70 = 420/hr
80 = 480/hr
90 = 540/hr

Perfect! I got it now, Thanks again Paul.
Reply With Quote
  #65  
Old 03-31-2009, 01:23 PM
tehPARADOX tehPARADOX is offline
 
Join Date: Feb 2007
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just wanted to stop by to warn you guys:

If you have say over 200,000 emails queued and you decide to upgrade vbulletin, make sure to do the file edits on the new files immediately before uploading it!

I made the noob mistake of uploading a fresh functions.php onto the server. Within seconds, all the emails were sent out, bringing my server to a halt with a load of 1000+.

I didn't know what the heck was going on until I saw exim crash.
Reply With Quote
  #66  
Old 03-31-2009, 11:06 PM
obmob obmob is offline
 
Join Date: Nov 2001
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... yeah, editing first might be a wise action
Reply With Quote
  #67  
Old 04-02-2009, 05:39 PM
Plasma2002 Plasma2002 is offline
 
Join Date: Jul 2006
Location: Riverside, California
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Paul,

Ive been using this addon for quite a while now and it has been a lifesaver... but i have a question.

Maybe it has nothing to do with your addon, and its more of a vBulletin thing, but you may know the answer anyways


I dont have much traffic on my forums (most the traffic is on the main site), so this becomes a problem when, say, in the middle of the night, i have a newsletter that needs to go out to 8,000 people that doesnt get finished until the next couple weeks.

What i tried to do to remedy this was make my local machine at home just do a simple wget of vBulletin's cron.php file every 5 minutes.

I figured this would be the best solution... but for some reason, when i look at my mailqueue from the adminpanel, it shows that the number of unsent mails never changed when i just hit the cron.php file... but it works fine if i leave a browser on the forums and make it reaload every 60 seconds.

Would you happen to have any idea how i can manually execute the cron and make my emails send out when my forums are empty?


Thanks


EDIT: I found out my problem, in case anybody got here by googling. it was in fact my wget script... if you are trying to run your cron's manually, simply make something hit cron.php on your forums.
Reply With Quote
  #68  
Old 04-02-2009, 07:16 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I dont.
Reply With Quote
  #69  
Old 04-20-2009, 07:59 AM
cellow cellow is offline
 
Join Date: Oct 2006
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Note: This modification will affect any queued e-mails such as subscription e-mails. It will not affect registration e-mails as they bypass queuing anyway.
All my activation links are queued. My Users are waiting up to 10 minutes for their activation e-mails.

How can i solve this problem?
Reply With Quote
  #70  
Old 04-20-2009, 09:22 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As it says, activation e-mails are not queued by vb.
Reply With Quote
  #71  
Old 04-20-2009, 12:48 PM
cellow cellow is offline
 
Join Date: Oct 2006
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did you test it on your forum? Why my vb queued activation links?
how can i solve this problem?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:06 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07281 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete