Why does it take long?

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?
 
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.
 
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.
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.
 
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?
 
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.
Huh?

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.
 
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.
 
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?
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.)
 
Top Bottom