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

Future Fix Optimising alerts by mass-sending method

Discussion in 'Future-Fix Bug Reports' started by guiltar, Sep 4, 2012.

  1. guiltar

    guiltar Well-Known Member

    I have noticed that alerts give a huge overhead in old threads.
    So I suggest to create mass-alert method and handle them all together instead of separately.
    It would save hundreds of queries!

    Screenshots made while inserting new post.

    Attached Files:

    Xon, pegasus, semprot and 3 others like this.
  2. Robbo

    Robbo Well-Known Member

    One of the downsides of data writers being shown here I think. I'd like to see data writer functionality that could group inserts/updates in some way when all content is the same it is using just with one column different (as in the user_id in this example).
  3. Digital Doctor

    Digital Doctor Well-Known Member

    Would it be useful / possible to distribute mass alerts over time ?

    FWIW, an easy way to get rid of this problem is to close mass threads and open up a follow up thread.

    or get rid of "automatically watch threads which you have replied".

    Of course, "automatically watch threads which you have replied" is a great feature to get new users engaged. :)
  4. Brent W

    Brent W Well-Known Member

    Then xenForo would be no better than vBulletin in handling large threads.
  5. guiltar

    guiltar Well-Known Member

    Moreover, when conversation has 100 and more members server doesn't respond at the time and member post duplicate messages.

    Please think about making email notifications by cron.
    For example, our national social network vk.com send emails not at the moment but after some time.
    It has next options:
    • Turn off email notifications
    • Send email notifications no more than one a day
    • Send email notifications no more than one a week
    So your site mail will not be recognized as spam as now happen very often.

    All alerts can be sent by 1 insert query instead of hundred of them.
    Luis likes this.
  6. Mike

    Mike XenForo Developer Staff Member

    This is something we'll need to look into in the future.

    Note to self: unit of work.
    Xon, Valhalla, Rob and 7 others like this.
  7. digitalpoint

    digitalpoint Well-Known Member

    One simple thing I've done is put outgoing emails and alerts needing to be sent into a variable, then do the actual sending on __destruct(). Doesn't change how long it takes to send them, but the user experience isn't part of that time.
    Digital Doctor likes this.
  8. Chris D

    Chris D XenForo Developer Staff Member

    @digitalpoint when you do move to 1.2 you might want to look at the Deferred system as an alternative.

    Probably nothing wrong with what you're doing but the Deferred system is ideal for handling this as, likewise, it doesn't affect the user experience.
  9. digitalpoint

    digitalpoint Well-Known Member

    Yeah, that's the plan... Side note - we are on 1.2. :)
    Xon and Chris D like this.
  10. The Dark Wizard

    The Dark Wizard Well-Known Member


    This would certainly be awesome.
  11. Xon

    Xon Well-Known Member

    I hope this is fixed for XF 2.0, as this is being an issue with pervasive use of email notifications in addition to reply alerts on the forums I look after.

Share This Page