Threads with 0 views / threads don't go to the top.
#1
TGO Supporter
Thread Starter
Threads with 0 views / threads don't go to the top.
Lately I have seen a lot of threads with responses but show 0 views... a fix on the way?
Also, in the past two weeks I've had at least two reply posts of mine not move the thread to the top of the forum. What's that about?
Also, in the past two weeks I've had at least two reply posts of mine not move the thread to the top of the forum. What's that about?
#2
Community Administrator
iTrader: (1)
Re: Threads with 0 views / threads don't go to the top.
The thread view count and thread view reply count are not updated "live". This is not a bug, but a feature that started out as a hack to help reduce server load.
Each time a thread was viewed or replied to, mysql would have to lock the proper table to update a "trivial" counter. When that occurs, anything that needs that table (read or write) is put on hold until the table is no longer write or read locked. On a large board with people viewing so many threads/posts, it quickly can cause "table locking" in mysql which makes the server load become a huge issue in some cases. The table that would be locked to update the counters is needed elsewhere throughout the board, so having it "locked" leads to performance issues since other processes are put on hold.
I'm not sure exactly how Dirk has it setup on this board, but the above general "fix" was to not update the counters live, which started out as a hack that people could add onto their vB2.x board. The counts are stored in a different table in the database that isn't needed elsewhere in vB, only for holding counts. It is also a table that resides in memory, which is faster. After whatever defined function Dirk has set (it can be server load, based or time, or done in a cron job) the counts are then mass moved into the original vB table all at once. This reduces the amount of time mysql has to lock that table, by having the data stored in another table, and then mass moving it the original table. All that prevents the table locking issues which in turn help keep the server load down.
Again, I'm not exactly sure how Dirk does it on this board and it can vary.
That's my understanding of it. Sorry if that's too much info, but that's in case anyone is curious as to why it's done that way, rather just knowing that it's not a bug, but instead a feature to help the server load stay in an optimal range so that the forums function faster, since it is common to mistake it as a bug.
Each time a thread was viewed or replied to, mysql would have to lock the proper table to update a "trivial" counter. When that occurs, anything that needs that table (read or write) is put on hold until the table is no longer write or read locked. On a large board with people viewing so many threads/posts, it quickly can cause "table locking" in mysql which makes the server load become a huge issue in some cases. The table that would be locked to update the counters is needed elsewhere throughout the board, so having it "locked" leads to performance issues since other processes are put on hold.
I'm not sure exactly how Dirk has it setup on this board, but the above general "fix" was to not update the counters live, which started out as a hack that people could add onto their vB2.x board. The counts are stored in a different table in the database that isn't needed elsewhere in vB, only for holding counts. It is also a table that resides in memory, which is faster. After whatever defined function Dirk has set (it can be server load, based or time, or done in a cron job) the counts are then mass moved into the original vB table all at once. This reduces the amount of time mysql has to lock that table, by having the data stored in another table, and then mass moving it the original table. All that prevents the table locking issues which in turn help keep the server load down.
Again, I'm not exactly sure how Dirk does it on this board and it can vary.
That's my understanding of it. Sorry if that's too much info, but that's in case anyone is curious as to why it's done that way, rather just knowing that it's not a bug, but instead a feature to help the server load stay in an optimal range so that the forums function faster, since it is common to mistake it as a bug.
Originally posted by CaysE
Lately I have seen a lot of threads with responses but show 0 views... a fix on the way?
Lately I have seen a lot of threads with responses but show 0 views... a fix on the way?
Last edited by JT; 04-13-2004 at 01:35 PM.
Thread
Thread Starter
Forum
Replies
Last Post
Street Lethal
Power Adders
634
04-30-2019 12:14 PM
Omega
Engine/Drivetrain/Suspension Parts for Sale
9
10-01-2015 02:20 PM
Linson
Auto Detailing and Appearance
40
08-21-2015 02:12 PM