45 Cache Hits Per Second

We all know that accessing the database can be resource intensive. But did you realize accessing the hard drive is intensive too? Every time you include a file in a script or write to a file, that is using the hard drive. Hard drives are fast, but when you multiply the number of includes, writes, etc by the number of hits per second, it’s only time before your website comes to a crawl.

You can overcome this by utilizing faster hard drives. Most servers are running 7200 RPM drives, but some have 5400 RPM! That alone can make a big difference!

Second, you can setup a RAID array. There are many ways to set them up. You can mirror them, so when you read files it’s twice as fast. You also then have a backup of every file in case of a drive failure. Or you can do striping, which is splitting each file across the drives. This increases read time and write time.

And lastly, you can utilize the fastest drive of them all. Memory! Come on, you knew RAM was faster than a hard drive right? So use that baby!

In case you were wondering, StartXchange is utilizing all 3 areas! It uses two 10,000 RPM drives in a RAID mirror, and a cache in the RAM that gets hit 45 times per second. Imagine that, the drives don’t have to be used 45 times per second! That’s about 4 MILLION times a day! This leaves the drives open and ready for anything that can’t be cached, supa fast!

:: (3) Comments :: PHP :: Permalink

3 comments

  1. See my profile on MyBlogLog.com! Adam Says:

    It’s logical that accessing a database is intensive like reading a file. Both are stored on the hard-drive unless the database has been explicitly been set-up as a MEMORY table.

  2. See my profile on MyBlogLog.com! Kelly Wheeler (tuneup13) Says:

    Raid is Great!! I love working with it…if your using striping—do you have a backup in case 1 drive or 2 drives fail>

  3. See my profile on MyBlogLog.com! Tim Says:

    Kelly - I have it mirrored, and an off the server backup is generated daily. While RAID is great, it still uses regular hard drives that can fail, so off server backups are a must ;-)