One of our bloggers has been reporting that the view count sometimes goes down for certain articles. I have searched everywhere in the EE code (we are running 2.5.5), and there is only one place where the view_count_* fields are updated, and it is an UPDATE SQL statement that performs a simple increment by 1.
Since the increment is done atomically in the database, I thought there could not be any way for the view_count fields ever to go down, so I blamed it on browser or some other kind of caching.
But yesterday I decided to create a cron job that queries the database for one particular article’s view_count_one value and logs it to a file every minute. So there is no browser or caching involved.
In the last 16 hours or so, the view count for this article has actually dropped 12 times, by seemingly random amounts ranging from 1 to 72. If the decreases are actual views that are lost, then for this particular story the view count is below the true amount by almost 11% so far. See the attached plot of a portion of the log file. The blogger who complained says that he has seen counts drop by several thousand for other stories, so this problem could be much more severe.
Has anyone else noticed this behavior? Any advice as to what to look for or test would be most appreciated.