Statistics on story pages are frequently wrong

8letters

Writing
Joined
May 27, 2013
Posts
2,160
For example, here's the story page:
1686760564500.png

Here's the rating from the author's page, which is much different than that on the story page:
1686760645558.png

Here's the stats when I search for the story:
1686760703333.png
The rating, views and favorites are much different

Looking at the stories published a week ago, about a fifth have no rating and an understated number of views. Of the stories with a rating, about a fifth are seriously off compared to other Literotica pages.
 
The rating, views and favorites are much different

Looking at the stories published a week ago, about a fifth have no rating and an understated number of views. Of the stories with a rating, about a fifth are seriously off compared to other Literotica pages.

Aren't you the guy who keeps posting these story-stats? And you never figured out how their CDN works?

My personal suspicion (based on the observed behavior of the site) is that they save the stats in different database tables that get updated separately and in irregular intervals.

Like, with your example, the author has posted the second part of that series today. If you access the first part, it will tell you that the author has only that one story on the site and only has a single follower. If you access the second part, however, it will tell you that he has two stories published here, and the number of followers is suddenly at Five. I took these screenshots just now, AFTER the second part was already published.

AlexAndI.jpg

Why? I guess they're trying to save page loading times by reducing the number of database queries across the board. So, instead of accessing the user-database after accessing the story-database, to check for the numbers of publications and followers every time someone accessed the story, they cache these numbers with the story in the story-database. Then, maybe once a day, they run a cronjob to bring those numbers up to date.

Same for the ratings, viewcounts, and everything else. They cache those values as much as they can. I'd speculate those numbers get updated whenever a certain number of votes has been casted.
 
Last edited:
Aren't you the guy who keeps posting these story-stats?
I am.

And you never figured out how their CDN works?
Nope. I'm not an internet guy.

My personal suspicion (based on the observed behavior of the site) is that they save the stats in different database tables that get updated separately and in irregular intervals.
:
Why? I guess they're trying to save page loading times by reducing the number of database queries across the board. So, instead of accessing the user-database after accessing the story-database, to check for the numbers of publications and followers every time someone accessed the story, they cache these numbers with the story in the story-database. Then, maybe once a day, they run a cronjob to bring those numbers up to date.

Same for the ratings, viewcounts, and everything else. They cache those values as much as they can. I'd speculate those numbers get updated whenever a certain number of votes has been casted.
(A) They should be pulling all their stats from one database. You shouldn't see differences from story to story and between the story page and the search page. Having multiple databases means more work and more chances of errors
(B) I think them running a cronjob to update their numbers only occasionally is the way to go, but their cronjob isn't working right. To me, the statistics on that story were from Day One, and it had been published for a week when I looked at it. But the statistics on other stories look up-to-date.
 
It is likely done to reduce the number of queries towards the database. It is possible that the pages are semi-static, in the sense that when you open the page it doesn't make a query and pull the data from the database, it just shows you static data. Such pages refresh at regular intervals by pulling the data from the database. The database itself is always up to date, it is just that the pages are not dynamic. That is how it looks to me at least, yet it could be some other mechanism too.
 
It is likely done to reduce the number of queries towards the database. It is possible that the pages are semi-static, in the sense that when you open the page it doesn't make a query and pull the data from the database, it just shows you static data. Such pages refresh at regular intervals by pulling the data from the database. The database itself is always up to date, it is just that the pages are not dynamic. That is how it looks to me at least, yet it could be some other mechanism too.
This.

The story pages are cached, and updated on a schedule. That's why edits take 24-48 hours after approval to appear to the public on the site. Everything has been changed in the database, but until the cache updates from it, you can't see it.

I strongly suspect the cache update isn't a set this time operation either. It probably only updates when traffic is low and steadily works through the whole of the story pages with interruptions from traffic spikes. That would explain the varied level of inconsistency between story page stats and what's available elsewhere.
 
This.

The story pages are cached, and updated on a schedule. That's why edits take 24-48 hours after approval to appear to the public on the site. Everything has been changed in the database, but until the cache updates from it, you can't see it.

I strongly suspect the cache update isn't a set this time operation either. It probably only updates when traffic is low and steadily works through the whole of the story pages with interruptions from traffic spikes. That would explain the varied level of inconsistency between story page stats and what's available elsewhere.
Agree this - server lags have always been self evident. I'm a little surprised that He Who Is No Longer Here has never noticed it before, but there we are.
 
It is likely done to reduce the number of queries towards the database. It is possible that the pages are semi-static, in the sense that when you open the page it doesn't make a query and pull the data from the database, it just shows you static data. Such pages refresh at regular intervals by pulling the data from the database. The database itself is always up to date, it is just that the pages are not dynamic. That is how it looks to me at least, yet it could be some other mechanism too.
And what is that "regular interval?"
My statistics on all of my stories have been frozen since about last November. I've written to support more than once about this but I think whoever's in charge is asleep at the wheel.
 
And what is that "regular interval?"
My statistics on all of my stories have been frozen since about last November. I've written to support more than once about this but I think whoever's in charge is asleep at the wheel.
Maybe nobody's reading them - unlikely, I'd have thought, but possible.

You should be able to check if the View counter is working by going into one of your stories, then checking the View counter. It should have clicked up by one, since that's a real time update on your Control Panel. Similarly, drop a vote on one of your own stories, you should see an immediate change in the maths on your CP.

All other data sets slave off your CP, from what I can see, usually with a rolling 24 hour cycle (there appear to be several different servers, with the main refresh happening at midnight in a US time zone, not sure which one). I think these scheduled runs are done automatically, no humans involved.
 
Back
Top