Friday, November 12, 2004
I noticed my site being very slow to load lately. After messing around with it a bit, I came to the conclusion that it was the actual page generation that was being slow, and not the web server or connection. Digging a bit more, I found that most of the slowdown was because of the script I was using to track how many hits my page was getting. It was storing a whole lot more data than necessary, and filling up a MySQL table with far too many records (it was at over 73,000). That’s been fixed. I also cleaned up the database I’m using for the newsfeeds on my sidebars so it deletes old data, and only keeps what it needs to. The boingboing and slashdot tables were at around 2000 lines each. That produced some speedup as well.
The page generation time has gone from 2.5-4 seconds to generally under 0.3 seconds. At some point, I’m going to see if I can cut down on the number of database queries I do. That should help bring that number down even lower.
[Note: If you’re interested, you can view the source of the page, and see how long it took to get to various points of generation in comments in the HTML.]