SSD on database server

 

I was looking for ways to enhance database performance on the quite busy database server of the very busy forum site. Currently I have to maintain forum that have to handle more than 1000 people online concurrently and have average posts about 5k posts per day. Therefore, it ever reached around 5M posts last year before my clients decided to split to new forums and left old forums read-only. And now ... It already reach 700k of posts for only half year with 1.5GB of database size (So ... WHAT A HECK THEY POSTING ?).

When database size increase dramatically ... And if it becoming large and nearly reach amount of RAM that your server has. Your database will face serious performance problems because your memory now not enough to hold all disk cache of database files on disk.

It happened last year when database size of this forums reach around 10GB when the server has only 8GB RAM. Even this database is on very fast 4 disks, 15k RPM RAID 10, Battery Backed LSI MegaRAID SAS HBA. I/O Utilization usually reach 100% at the busy time. And my web server start to respond Error 500 because of database overload.

And now SSD is out and may be a choice of what I want ... High mixed, random, read/write IOPS. But one thing to consider, Endurance, how much data can writes to SSD.

As you may know, SSD have limited time of writes compared traditional magnetic harddisk. If you decided to put SSD inside server ... You need to measure how much data gonna write on it to ensure your SSD will live long enough.

From X25-M SSD datasheet:

3.5.4 Minimum Useful Life
A typical client usage of 20 GB writes per day is assumed. Should the host system
attempt to exceed 20 GB writes per day by a large margin for an extended period, the
drive will enable the endurance management feature to adjust write performance. By
efficiently managing performance, this feature enables the device to have, at a
minimum, a five year useful life. Under normal operation conditions, the drive will not
invoke this feature.

You may notice 2 things here. First X25-M SSD endurance is 5 years for average writes of 20GB per day. Second, if you put data more than 20GB per day, it will activate endurance management mechanism that results in lower performance.

Now it time to measure disk writes on my server. It can done by basic command in Linux ... 'iostat' (If your server not have iostat ... simply install sysstat package).

popcorn2 64h # uptime
 03:31:16 up 23 days,  6:47,  2 users,  load average: 0.35, 0.15, 0.31
popcorn2 64h # iostat -m /dev/sdb
Linux 2.6.27-gentoo-r5 (popcorn2)       03/30/09

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           9.30    0.00    1.66    0.49    0.00   88.55

Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sdb              15.81         0.02         0.07      37865     144223

With basic calculation ... This result around 6.26GB per day.


So I can use X25-M SSD on this system for database, or even faster version X25-E.

If you decided to use SSD for your database server ... make sure you check how much data gonna write to your SSD before putting some important data on it. And do not forgot to BACKUP. SSD is quite more expensive than 15K RPM disks of the same capacity with much lower write endurance. ($400 80G SSD vs $250 74G 15K RPM)

 

你可能感兴趣的:(database)