はてなにおける SSD の実績

社内で SSD の寿命について話題に上がったので、ちょろっと X25-M G1 の運用実績に関する日記を書いてみよう。
プロダクション環境にある MySQL が動いているホストから、比較的 I/O が激しいものをチョイスして smartctl を叩いた結果がこんな感じ。

# smartctl -d ata -a /dev/sda       
smartctl version 5.36 [x86_64-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model:     INTEL SSDSA2MH080G1GC
Serial Number:    xxxxxxxxxxxxxxxxxx
Firmware Version: 045C8610
User Capacity:    80,026,361,856 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   7
ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 1
Local Time is:    Mon Jan 25 21:06:46 2010 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (  32) The self-test routine was interrupted
                                        by the host with a hard or soft reset.
Total time to complete Offline 
data collection:                 (   1) seconds.
Offline data collection
capabilities:                    (0x75) SMART execute Offline immediate.
                                        No Auto Offline data collection support.
                                        Abort Offline collection upon new
                                        command.
                                        No Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (   5) minutes.
Conveyance self-test routine
recommended polling time:        (   1) minutes.

SMART Attributes Data Structure revision number: 5
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  3 Spin_Up_Time            0x0000   100   000   000    Old_age   Offline  In_the_past 0
  4 Start_Stop_Count        0x0000   100   000   000    Old_age   Offline  In_the_past 0
  5 Reallocated_Sector_Ct   0x0002   100   100   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0002   100   100   000    Old_age   Always       -       6149
 12 Power_Cycle_Count       0x0002   100   100   000    Old_age   Always       -       13
192 Power-Off_Retract_Count 0x0002   100   100   000    Old_age   Always       -       5
232 Unknown_Attribute       0x0003   100   100   010    Pre-fail  Always       -       0
233 Unknown_Attribute       0x0002   053   053   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective Self-Test Log Data Structure Revision Number (0) should be 1
SMART Selective self-test log data structure revision number 0
Warning: ATA Specification requires selective self-test log data structure revision number = 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

# 

乗っているのはマスターマスター構成*1スレーブとして*2動く 47GB の InnoDB で、 2010/1/25 21:45 現在、 iostat を眺めると 60 秒平均 で 5MB/s ぐらい出ている。ホストの構成は MySQL 5.0 + InnoDBext3 on XenBus on LVM というよくある環境。

注目すべきは 9 と 233(=E9) の値。 250日強で Media Wearout Indicator が 53% まで低下している。 250日で半分なので、 1.5年ぐらいは使える計算である。(ウェアレベリングが十分に賢いと仮定すれば)容量を倍にすれば寿命も倍になるので、もうちょい頑張ることも可能。そもそもこいつ書き込み多いし。
買った当時の値段は知らないが、 2万円で買える SSD が数万円台後半の BBU付き RAID を蹴散らす性能を出すんだから、良い時代です。

続きは iostat の実行結果。

# iostat 60
Linux 2.6.18-92.1.22.el5xen (xxxx.host.h)      01/25/10

(snip)

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
xvda1           579.82      7352.80     14449.47     441168     866968
xvda2             0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.57    0.00    0.24    5.84    0.08   93.28

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
xvda1           532.69      8664.82      8945.31     519976     536808
xvda2             0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.49    0.00    0.40    6.57    0.04   90.50

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
xvda1           614.35     11947.60      8255.87     716856     495352
xvda2             0.00         0.00         0.00          0          0

*1:相方は枯れたハードウェアRAID

*2:よく見たらただのslaveだった…