I discovered a similar issue as described in this post, but think I figured out why behind the scenes
http://www.jomsocial.com/forum/technical-issues/23385-purging-the-mail-queue
The problem started when the queue gets large (over 10,000 records) and hasn’t been purged. In theory, a similar issue could also happen if your ‘totalemailpercron’ is set to be to high in your default.ini settings. The frustrating part about this issue is that you may never realize there is a problem as the email queue in backend reports everything as OK; when in reality your messages may not have been sent.
I can’t give you guys an easy way to replicate this because I have since purged my queue, and in addition the only way I knew there was a problem was when I didn’t get an email in my inbox. As mentioned, the queue said things were fine; and I don’t want too accidently send my users a million test messages debugging this
So since I can’t really show you the problem on my site (because of what I describe above) but I can show you the problem in the code. Are you guys hiring lol? I have now discovered and provided fixes to a few bugs at my own expense here ☺
When examining the cron task, there is function that called _sendEmails which does what it sounds like. This file calls a send function located here:
/components/com_community/libraries/mailq.php
The send function is located on line 19, and the problematic function call is located on line 23:
public function send($total = 100) {
$app = JFactory::getApplication();
$mailqModel = CFactory::getModel('mailq');
$userModel = CFactory::getModel('user');
$mails = $mailqModel->get($total, true);
if (!$validate) { //email is blocked by user settings
$mailqModel->markEmailStatus($row->id, 2);
} else {
$mailqModel->markSent($row->id);
}
Hi John,
I will try to discuss this issue with our developer, maybe they will apply it on our core code or maybe will have another solution.
thank you
Upon further investigation I discovered what really slows my cron job down is the call to this function:
$this->_removeDeletedUserFolder(JPATH_ROOT . '/images');
My server stats for reference (will be upgraded in a half year):
Front-end web servers
3 x Sun v40z AMD Opteron servers
2 x AMD Opteron 870 Dual core CPUs
8GB (4x1GB, 2x2GB) ECC RAM
2 x 73GB 10K RPM Ultra320 SCSI local disks
2 x gigabit ethernet adapters
redundant power supplies
MySQL/NFS server
Sun Fire V490 server
2 x 1.5GHz UltraSPARC UltraSPARC IV+ processors
8GB (16x512MB) ECC RAM
2 x 146GB FC-AL disks
2 x gigabit ethernet adapters
2 x fibre-channel adapters
redundant power supplies