Time for some database cleanup
I’ve just deleted over a thousand mods from the database (which used to contain a bit more than three thousand mods).
Listing mods...
1470 mods, where 1042 are trash.
Deleting mods...
Completed everything in 59.991328001022 seconds.
2085 queries.
You see, this was really needed. Due to the ammount of data on my stats database, the time spent when generating graphics is increasing each day, and the server I run this website in has a time limit of 30 seconds for the cron jobs I create. When it gets past this limit, the execution is terminated, and usually this means that graphs just freeze in time, never updating anymore. This happens from time to time with the mods graphics, and with the recent addition of the mods by game page, it started to become an issue.
While investigating the database, I discovered something very odd – there were a lot of mods for Half-Life 2 that were featured on the database (and thus wasted CPU time when rendering the graphics and querying the database) but that have only appeared once on the Half-Life 2 stats. This means that they’re just test mods, or some other odd mods with their directories renamed.
That’s why I have just created a cleanup script that gets rids of all this data. It’s some data that gets lost, but hey, it’s not like I’m worried about not knowing anymore the date when the one server with one player playing the “Raping Halo” existed, or how much people played the “anti counter-strike” mod (one) in how many servers (one) how many times (only once).
So hopefully now the graphics will get back into their nightly-generating state smoothly. In the meantime, if you’re curious, I’ve created a list with all HL2 mods ever found on the database (including the deleted ones, listed at the top). There are some really insightful mod names there; of particular note is the many “cstrike” and “garrysmod” variants, and many references to zombies.
Really, I wonder what the hell did some people have in mind to go all the way in creating a new mod directory with that name, placing some content there (maybe), and starting a multiplayer server.
Edit: apparently the database cleanup (allied to some optimization changes I made on the scripts on the past couple of days) wasn’t enough to get all graphics going; the script is still halting before finishing the mod graphs, so they are a few days old. I’ll try to find a solution on the next few days, there’s probably a lot more that can be optimized.