1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Bypass E-mail Defer Queue

Discussion in 'XenForo Questions and Support' started by nrep, May 4, 2016.

  1. nrep

    nrep Well-Known Member

    We send out a newsletter using the XF bulk mail system, however since upgrading the XF 1.5 it has become painfully slow. From some helpful advice on the forums, I found out this was because XF 1.5 handles emails by adding them to a defer queue.

    Is there a way to bypass this? On XF 1.4 we can send 5k e-mails in less than a minute. On XF 1.5 it takes closer to an hour.
    eva2000 likes this.
  2. eva2000

    eva2000 Well-Known Member

    Indeed my first admin email to user on upgraded XF 1.5 was definitely much slower than when on XF 1.4 ~ 11-13 emails/sec !
  3. Chris D

    Chris D XenForo Developer Staff Member

    You're right, it is slower.

    But also it's more consistent and reliable.

    One reason for it changing was the not uncommon occurrence of encountering some sort of interruption part way through the process. The process often wasn't resumable so you'd either need to start again or accept that it wasn't finished. Now it runs on the Deferred system if it is interrupted, it can be resumed once the interruption is over.
  4. eva2000

    eva2000 Well-Known Member

    but i assume resumption wouldn't occur if php timed out and crashed while processing the slow email queue ?
  5. nrep

    nrep Well-Known Member

    I understand why it's like that, but I'd happily have the option to sacrifice that for mass e-mails. It's taking hours as opposed to minutes to send an e-mail, which is quite frustrating.

    Is there a way to disable this (or a hint on how to code something)? Any tips would be most appreciated :).
  6. Chris D

    Chris D XenForo Developer Staff Member

    It's a manual deferred task, so yeah it would. It's done in batches of X emails, and has logic in there to cut that short should it take longer than Y. The upshot is, each time it is finished a batch, the current position is saved back to the xf_deferred table. If all hell broke loose (short of losing the contents of the xf_deferred table), there's enough information logged in there to allow it to continue (roughly) where it left off. You'd have a banner on the Admin CP home page stating "There are manual rebuild processes that have been stopped before completion. Click here to complete them."

    You originally said it's taking "an hour" rather than hours. Honestly, an hour doesn't seem that bad to me. You don't have to sit there and watch it. Open another tab, carry on with your life, and you can be confident it's going to finish the job. You could even close your browser and finish it later if you had to.

    There's no way to disable it.
  7. nrep

    nrep Well-Known Member

    The hour was just a comparison for the site that does 5k e-mails, I've sent out newsletters for 7 sites so far today (and more to go).

    Some of these sites have 20k subscribers, so I'm sure you can understand why this is frustrating for me and worth seeing if there is a way around it.
  8. Chris D

    Chris D XenForo Developer Staff Member

    No. I don't understand why it is frustrating. This is what tabbed browsing was invented for.

    Ultimately, the benefits of this approach far outweigh the time it takes. There's no configurable option to change it, and it's not a trivial thing to change it back.

    It would therefore require custom development, but I'd still urge against it for the reasons already mentioned.
  9. nrep

    nrep Well-Known Member

    Fair enough, well I find it frustrating. If anyone else has any suggestions on how I may be able to bypass this, I'd be interested to know.
  10. eva2000

    eva2000 Well-Known Member

    yeah PHP timeouts are the only issue i encounter now on upgraded XF 1.5, so will need to adjust my php time outs to account for this on the server level

Share This Page