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

As Designed Thread updates unexpectedly slow as thread increases in size

Discussion in 'Resolved Bug Reports' started by Xon, Aug 15, 2015.

  1. Xon

    Xon Well-Known Member

    The following operations are gated by thread reply length, and can take massive amounts of time:
    • Moving a thread between forums
    • Changing the visibility state of a thread
    This is because in XenForo_DataWriter_Discussion::_insertIntoSearchIndex, the call to XenForo_DataWriter_Discussion::_getDiscussionMessageIds fetches all the posts (even if it is the minimum set of data), which can result in a lengthy query.
  2. Mike

    Mike XenForo Developer Staff Member

    This is really expected. These elements need the IDs to queue up the necessary rebuilds. These actions should be fairly uncommon compared to replying to a thread, for example. There are things that should be expected to have linear slowdowns/memory use increases as size increases.

    I would note that we don't really consider threads with 10s or 100s of thousands of replies to necessarily be a "normal" use case, though we're aware they do happen, but challenges can be expected when they get quite large.
  3. teletubbi

    teletubbi Well-Known Member

    By the way, is there some internal limit for the size of a thread?
    Or is there an estimated size when a thread will become slow in response?
  4. Chris D

    Chris D XenForo Developer Staff Member

    Due to the way that XF stores the post position in the post table, there shouldn't really be a noticeable performance degradation in terms of inserting a new post or viewing a high numbered page. But, clearly, certain actions (as reported here) can have an impact but they should be rare enough to not be an ongoing concern.
  5. teletubbi

    teletubbi Well-Known Member

    This answer is good enough for me.
    I was thinking about to split some threads. Looks like i can do other things instead.
  6. Xon

    Xon Well-Known Member

    Fair enough.

    About the only solution would be to use a sliding window of updating a smaller batch at a time rather than the entire thread. This would also help prevent page timeouts when doing a manual search re-indexing of threads. Since for example CloudFlare has fairly strict limits for long an idle HTTP connection can stay alive.
  7. imthebest

    imthebest Formerly Super120

    Yep, I believe it is around 30 seconds. When I imported using the standard web importer I discovered the issue, and had no option but to temporarily disable CF while the migration was performed (announcing my IP to the world :mad:).
    Xon likes this.

Share This Page