Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-29 22:53:17

hurty
Member
Registered: 2004-07-17
Posts: 28

extremely inflated file download count

We use the file download feature to count and display the number of files downloaded from our site. For the past two days the numbers have gone crazy on one of our articles. Based on our statistics for page views and other metrics we would expect that there might have been about 15,000 to 20,000 downloads of each of these files, but a couple of files included in one particular article are reporting that they have been downloaded 95,000 times. The files are MP3 files. You can see the page here:

http://www.daytrotter.com/article/1253/death-cab-for-cutie

The form that we use to display the “download” button and the song preview looks like this:

<strong class='songtitle'><txp:file_download_description /> </strong>
[<txp:file_download_size format="mb" decimals="2" />] 
[<txp:file_download_downloads /> downloads]</span><br /><br />
<txp:file_download_link>
<img src='/images/download_button.png' title='download this mp3 file' border='0' style='margin-left: 4px;' />
</txp:file_download_link>
<txp:jnm_audio audio=".">
<txp:file_download_name />
</txp:jnm_audio>
<br style='clear:both' />

Would the jnm_audio plugin cause the file to be counted as being downloaded? (not that it would explain the incredibly inflated download numbers.)

Can anyone explain why the download numbers for these files could be so out of whack?

Mark

Offline

#2 2008-04-30 08:05:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,449
Website GitHub

Re: extremely inflated file download count

Not so much a solution, but confirmation that I’ve seen this before on our record label site. One or two files were waaay over the top from what we expected.

I would hazard a guess it’s either a (very) persistent bot that’s touching/downloading the file or someone has posted one or more links to your files and it’s other people or spiders hotlinking to them from remote sites.

Out of curiosity, what do your TXP logs show as they request type? Are they GET or POST? I believe if it’s a standard human request from people clicking the file_download link, it should be GET (someone correct me if that’s wrong). I noticed most of our high download files were requested via POST, leading me to believe it was something other than a well-intentioned person causing the stats bubble.

EDIT: the jnm_audio plugin may well cause the download count to go up as well but, as you say, if you use the same form across all your downloaded files and just these two are sticking out, it’s probably not a plugin issue.

Last edited by Bloke (2008-04-30 08:09:01)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2008-04-30 17:52:48

hurty
Member
Registered: 2004-07-17
Posts: 28

Re: extremely inflated file download count

I’m not seeing any POST requests for the particular file.

This is a pretty odd issue. The counter seems to work without much problem on low traffic files. I would have assumed that the counter only increments when the file is requested via a TXP generated link to that file. So for example, if a browser requested a file by name by going directly to the URL where the file is stored (i.e. /files/filename) Textpattern would not count that as a download.

Could this be related to the mySQLd process getting hosed under heavy traffic?

M

Offline

#4 2008-04-30 18:15:48

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: extremely inflated file download count

hurty wrote:

So for example, if a browser requested a file by name by going directly to the URL where the file is stored (i.e. /files/filename) Textpattern would not count that as a download.

Yep, TXP doesn’t counts downloads from the real url, instead via TXP generated url that tells to TXP what the file actually is. That way the info in database can be update with out hazle. Almost all logging download script around the world use this same method – actutually the url always is fake and made by the software and thatfor it’s way more easier to track and manage. It just looks real coz rewriting ;)

How many times is the download link accessed in your logs? If there is exact same number of hits, then the count number is correct. So, it could be that some bot is accessing the download and so eats bandwidth. If it’s bot, the you can always easily ban the bot.

Last edited by Gocom (2008-04-30 18:19:29)

Offline

#5 2008-04-30 21:18:24

hurty
Member
Registered: 2004-07-17
Posts: 28

Re: extremely inflated file download count

A bit more info:

A search of the log files (Apache’s not textpattern) reveals that requests for the files are actually about 10% of what was being displayed in the download column of the files table. It’s really odd.

Then I remembered I had turned on query caching on the server to improve mySQL performance. I wonder if that caching could be causing the problem? Could the update query for the file download count be cached and re-executed from cache?

Offline

Board footer

Powered by FluxBB