Cron Based Email Sending  vBulletin mail queue back log

Cron Based Email Sending  vBulletin mail queue back log

vBulletin cron based email sending is a new feature in vBulletin 4.2 and is enabled by default and configured for only 10 batch emails sends until that queue is cleared. There is an email delay setting which allows you to set the delay between each email sent within a batch to either none, 1, 2 or 5 second delay. Then theres the delay arising from vB Scheduled Cron Task being set to process each batch of emails every 10 minutes by default.

vB Cron Based Email Problem:

Problem is working with alot of the larger and very active vBulletin forum clients, Ive noticed alot of complaints of email notification delays by members on this forums. When I look into vB MySQL databases mailqueue table, I see a back log of 30,000 to 60,000 emails queued up with the default 10 emails per batch setting. With email batch on a 10min vB Scheduled Task cron by default, you can imagine how long it would take for emails to clear the vB mail queue!

vbmailqueue.sh

So how do you figure out an optimal value for the number of emails to send per batch ? For VPS and dedicated server customers with root/SSH telnet access, I wrote a bash script, vbmailqueue.sh which can:

output and display the entire mail queue

count number of emails back logged in the mail queue

provide the last mailqueue id value

also display the current vB AdminCP email options.

log all output to a time stamped text file for viewing and analysis

The vbmailqueue.sh script is available here. Just edit the script's 5 variables explained within the script, upload to server and make it executable. So if you uploaded script to /home/tools/vbmailqueue.sh (ASCII mode)

You can manually run or setup a cron job task for it. After a period of statistics collection, you can view the info paying attention to the mail queue size and then adjust your vB AdminCP email options appropriately.

vbmailqueue.sh output

menu options  view the full mail queue by mailqueueid, count the number of emails queued and well debug is just something I had to setup to check I was getting the right last mailqueue id in the queue.

Thank you for sharing your solution.
I'm indeed in this situation where backlog for emails is more than 60000 emails to send.
I'm interessted in this sh file but can't found it attached to this post ... is it still available?
THanks

We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.

By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also consent to the transfer of your data to our servers in the United States, where data protection laws may be different from those in your country.