Major Change: Top Boards List
I've changed the formula for producing that list and was able to speed it up dramatically. With the previous version, I found that if I hit that list in two separate windows at the same time, I could spike the server at 100%. Didn't say anything earlier because anyone could've seriously dragged down performance just by repeatedly hitting that page.
Now it's no longer the case. Running that screen results in only a tiny blip on the database server.
Most of it was because, since I was dealing with such a complex formula, I really didn't write it well at all. Okay, I wrote it very poorly.
But the biggest killer was including posting activity to a board for the past 30 days. That's changed.
Now the formula takes the following into account:
1. Total posts on the board.
2. Total posts on the board in the past 24 hours.
3. Total bookmarks (turned out the previous version wasn't counting this) for the board.
4. Bookmarks placed by people who have posted in the past 30 days.
Because I'm looking at posting activity in the past 24 hours instead of the past 30 days, the results are a bit more dynamic; they can change dramatically from day to day. For example, non-stock boards will probably move up in the rankings on weekends and drop back down during the week.
The scores on all boards have changed as a result, but are largely in the same ballpark. And because of the inclusion of total bookmarks into the equation (even though "Active" bookmarks count for more), the rankings of some boards have changed.
Anyway, not only does this screen run extremely fast now, running it shouldn't be adding overhead that the other processes have to deal with.