Perhaps I should give a little more background on the download counter issue as well...
The system used to simply add 1 to a download count variable in the database a long time ago - really simple, exactly how you'd expect to do it! However, it became apparent that download numbers were lower than expected and didn't actually match up with web logs if I manually checked. This was down to a good old fashioned programming problem when you have multiple things updating a counter at the same time - let's say counter is 0, two near simultaneous downloads start and both read the value as zero, update it to 1 and put it back in the database - end result, it shows 1, not 2. This ought to have been an almost non existent problem - but it turns out the site got so busy that it became near rampant - and people were justifiably confused about why their files were apparently not getting downloaded very much.
Now, at the same time I set the file library up many many moons ago, I also had the system keep a record of every individual download ever made from the system in another table - and as this simply adds a new record, it doesn't suffer from any of these concurrency issues. For information, you can view the table from your perspective by going to "My Downloads" along the left hand menu on the main page of the site. This allows you to see when you downloaded every file you've downloaded, and if the file has been updated since you downloaded it, and if there have been any new comments left since you downloaded it.
Again, some years ago, it occurred to me that I could use this massive data table to get accurate download counts, so I wrote a script that would sum up this by file and put the values back in to the database. This worked ok, until the file library got bigger and bigger, and the download record table became enormous.
It's run in to various problems over the years and i've helped it along - the main one being that while it was running, it would basically stop the web site from working at all because it was making such a large load on the database server. Tuning the database and refining the queries has improved its performance.
The most recent issue was that it was being process limited - in two ways. I had put a max counter on it, one of those "well, it will never get this big, so stop it if it ever feels it has to process this many files, because that probably means it's gone mental" - turns out, it now has to process that many files (many more in fact)... Also, having fixed that, it was then taking so long to run that it was hitting the max time limit - so i've resolved that too.
Download counts are never lost, the way the system works it always goes back to that download record and counts it fresh - so even if it stops working at all, it just regenerates it, so don't worry about that
The whole process is taking around 10 minutes now which isn't too bad, considering the vast number of records it is processing. It should now re-run every day to keep the numbers current.
Hope that helps explain the background.