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

Why does it take long?

Discussion in 'Troubleshooting and Problems' started by Carlos, Jan 5, 2011.

  1. Carlos

    Carlos Well-Known Member

    Why is it that it takes a long time for xenforo to update counters?

    For example, upon on starting a thread, it takes several minutes to update the stats counter.

    Another example is that when you see a lot of visitors online at a given time, it takes an 50 minutes to an hour to get the thread views counter to update.

    Is there a way to update this in real time, instead of a delay?
  2. Decent60

    Decent60 Well-Known Member

    They can all be adjusted through the CronJob Entries. Just take care that you don't over do it, as it can heighten the server load.
  3. Kaiser

    Kaiser Well-Known Member

    I hate this too, running the cronjobs shouldnt be needed to update realtime... like other forums (mybb, vb, phpbb update on time) Its very annoying.
  4. Dean

    Dean Well-Known Member

    So what do all the cron jobs do on my vb3.8 forum? Thread Views, attachment views, hourly cleanup 1, hourly cleanup 2...

    They work the same way.
  5. Kaiser

    Kaiser Well-Known Member

    But they change instantly, like on other forums software it changes instantly.
  6. Dean

    Dean Well-Known Member

    The crons can be adjusted to run as frequently as the admin wants them to run.

    If there is a forum where the stats change instantly, I'd like to see it.
  7. Kaiser

    Kaiser Well-Known Member

    My point is on xenforo forums they take a while to update by themselves compared to other forum softwares.
  8. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    That is a performance feature and it is actually a good thing.

    A forum with a lot of traffic would have really really bad performance if the counters were updated in real time, as the thread table would lock frequently and delay almost all reads.

    Every time you update the view count on a thread, an update DML is triggered on the thread table. The thread table is one of the most demanded of the forum as it is used almost everywhere. It used to be in the MyISAM world that when you update the table it gets a lock, preventing other people from reading it. This also means that if you update the table frequently, you can effectively lock your forum from reading.

    It also prevents people from gaming the system and, say, refreshing a thread 1,000 times to increase the view count. I have seen that people avoid doing that if they don't see the counter increase in real time. If you as an admin need to see it go up, just run the cron job. You can even set the cron job to run every minute if you want.

    A question for the devs is .. now that we are in the innodb world (with row locking), and not on myisam, does that matter anymore?
  9. Carlos

    Carlos Well-Known Member


    I didn't have to do any cron jobs on any of my vbulletin instances - whether its vB3, or vB4. Sure, the views counters were not updated immediately, but it updates quicker than xenforo. I'm not saying xenforo isn't fast, I am merely saying that vBulletin 3/4 did not require my going into ACP and starting up those cronjobs just to be able to speed up views counter, stats counters, etc.
  10. Luke F

    Luke F Well-Known Member

    Did vBulletin not have a completely instant update option?

    I'd like to see some kind of asynchronous but still instant update in XenForo for smaller forums.
  11. Mike

    Mike XenForo Developer Staff Member

    InnoDB writes are quite slow because of the fsync that they do. As such, it's likely still significantly better to do them in bulk. (While you can modify properties in MySQL related to this, servers with the values changed are going to be very few and far between.)

Share This Page