| blog |
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.]

ShareTweet about this on TwitterShare on Google+Share on FacebookEmail this to someone
Posted by alan to meta at 7:44 pm PT | Link | Comments (4)

RSS feed | Trackback URI


Comment by JustAgirl
2004-11-24 14:22:58

It loaded just fine just now!

Comment by ricka0
2004-11-26 17:17:51

Y wood u use MySql when the far more robust and efficent MSDE is free? I wood knot use it:)

Comment by Essive
2004-11-27 21:22:55

As a former web project director for many sites my advice to you is to cache, cache, cache. My directive to all web developers was always the same. If you cannot keep your page rendering under 100ms then redo it or cache the data because the site will not scale. Keep you page counts out of the database directly. Cache the counts in memory and persist them at some hit intervals (such as every 5 or 10 hits).

Comment by sqlmy
Name (required)
E-mail (required - never shown publicly)
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> in your comment.

All content Copyright © 2002-2009 Alan Penner
Powered byWordPress, Penner Hosting and Superb Internet
Some Rights Reserved
Redistribution is permitted under the terms of
this Creative Commons License