Joined: 11/18/2006
Posts: 2426
Location: Back where I belong
So, I was just browsing the main page and realized that almost every single movie has 0 downloads listed in the small grey bar under each description, and the ones that do have downloads listed certainly look like they've been reset in the near past. Was this intentional? A bug? And can the correct download statistics be restored in any way?
The bittorrent tracker seems to be horrid in maintaining these statistics.
Reasons.
― The statistics are embedded into the "dstate" file, which is encoded in BitTorrent encoding (meaning you need specialized software to decode it).
― The file also contains information about all peers and stuff, meaning it's slow to decode it
― The official tracker likes to discard information about torrents that are no longer available (I've patched it to not discard it, but.)
― Sometimes, the official tracker becomes unable to read its own dstate file after it has written into it.
― If the tracker / server crashes while the tracker is in process of rewriting the dstate file, the file gets corrupted and all statistics are lost.
To work around these problems, the TASvideos website uses:
― A custom program to read the dstate file. A decoder written in PHP just runs way too slow.
― Caching to save the dstate file parsing results, so that the file doesn't need to be decoded every time a page is loaded
― A SOAP api that separates the dstate handling from the site's code to the place where the tracker is handled, in case those need to be separated
In addition, I:
― Make backups of the dstate file every time the server boots up or I restart the tracker
There are a lot of vulnerable components in this.
Unless the statistics are restored from backups the "Bittorrent data" section of MovieStatistics became obsolete with this global reset, so it could as well be removed.
Warp's point still stands, though. Seems like the relevant MovieStatistics panes are now useless as they don't represent the real numbers anymore, unless you're meaning to restore it somehow. Having Track & Field as one of the most downloaded AVIs makes my head go round.