Jump to content

Topic views counter stuck


Recommended Posts

Topics created 2 days ago have 0 views, but it's incorrect value:

image.png.ca105f49dfa76451d75d758eb15ecc08.png

The viewupdates task is stuck.

image.thumb.png.f2467329366428b0ab2611579edfef27.png

Errors and System logs don't have any entries about this problem.

I'm using Redis for caching and Elasticsearch.

PHP 7.1.12

max_execution_time is 30.

Also the option Use Redis to reduce MySQL overhead is enabled:

image.png.cc7c507416670b8f657989f7cadf2688.png

Link to comment
Share on other sites

When I run it manually the whole page stuck. White screen with endless waiting/loading.

However, it finished after a very long time, but counters haven't been updated.

I switched off the option "Use Redis to reduce MySQL overhead", rerun the viewupdates task and topic view counters started working. Apparently, the option "Use Redis to reduce MySQL overhead" doesn't work correctly.

Link to comment
Share on other sites

10 hours ago, motomac said:

When I run it manually the whole page stuck. White screen with endless waiting/loading.

However, it finished after a very long time, but counters haven't been updated.

I switched off the option "Use Redis to reduce MySQL overhead", rerun the viewupdates task and topic view counters started working. Apparently, the option "Use Redis to reduce MySQL overhead" doesn't work correctly.

That's not exactly accurate. We use it extensively in fact. This just means that there were a lot of views stored in Redis, and when you turned that option off the task began looking for views in the database instead, but since there were none it was able to complete quickly.

My recommendation is to submit a ticket.

Link to comment
Share on other sites

Apparently, the problem was in the views column in forum_topics table. The value exceeded the limit of INT(10):

UPDATE `forums_topics` forums_topics  SET `views`=`views`+1263 WHERE tid=24130 
Out of range value for column 'views' at row 1

Currently, the value is: 2147483369

#0 /var/www/site.com/system/Db/Db.php(990): IPS\_Db->preparedQuery('/*IPS\\core\\task...', Array)
#1 /var/www/site.com/applications/core/tasks/viewupdates.php(119): IPS\_Db->update('`forums_topics`...', '`views`=`views`...', 'WHERE tid=?')
#2 /var/www/site.com/applications/core/tasks/viewupdates.php(53): IPS\core\tasks\_viewupdates->update('IPS\\forums\\Topi...', 24130, 1263)
#3 [internal function]: IPS\core\tasks\_viewupdates->IPS\core\tasks\{closure}()
#4 /var/www/site.com/system/Task/Task.php(347): call_user_func(Object(Closure))
#5 /var/www/site.com/applications/core/tasks/viewupdates.php(99): IPS\_Task->runUntilTimeout(Object(Closure))
#6 /var/www/site.com/system/Task/Task.php(248): IPS\core\tasks\_viewupdates->execute()
#7 /var/www/site.com/system/Task/Task.php(217): IPS\_Task->run()
#8 /var/www/site.com/applications/core/interface/task/task.php(62): IPS\_Task->runAndLog()
#9 {main}

I can't believe I have the first IPS forum which has a topic with >2.1 billion views 🤔

Fixed it by making a view column UNSIGNED. And I recommend everybody to do the same 😄

P.S. My license is expired, so I can't get any help from tickets.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...