Hadyai Internet R&D LAB
แหล่งความรู้ => Server => Linux Server System => ข้อความที่เริ่มโดย: admin ที่ 25 มกราคม 2012, 04:59:44
-
มันคืออะไร งงจัง
เรื่องนี้ admin tan เคยบอกไว้นานแล้ว แต่ยังไม่เคยได้ลองเทสสักที มันคืออะไรนะเหรอ มันก็คือ
นำ SSD มาทำเป็น Cache ให้กับ HDD ธรรมดา เพื่อเพิ่มความเร็วในการอ่านเขียนของ HDD
ตัวที่จะนำมาใช้ก็คือ
https://github.com/facebook/flashcache/
ขั้นตอน ก็ไม่ได้ยากอะไรมาก
ดาวน์โหลดมา เสร็จแล้วก็ทำการ
unzip , make , make install
ทำการโหลด module flash cache ด้วยคำสั่ง modprobe flashcache
เพียงแค่นี้ก็สามารถใช้งาน flash cache ได้แล้ว
โดยจะมี 3 คำสั่ง ดังนี้
flashcache_create
flashcache_destroy
flashcache_load
ศึกษาคู่มือการใช้งานได้ที่
https://github.com/facebook/flashcache/blob/master/doc/flashcache-sa-guide.txt
-
ตัวอย่างสถานะการใช้งาน สามารถนำมาใช้กับ Master หรือ Cow ก็ได้
0 1048576000 flashcache stats:
reads(1757190), writes(21520570)
read hits(1612466), read hit percent(91)
write hits(1) write hit percent(0)
dirty write hits(0) dirty write hit percent(0)
replacement(0), write replacement(0)
write invalidates(17), read invalidates(13)
pending enqueues(0), pending inval(0)
metadata dirties(1), metadata cleans(0)
metadata batch(0) metadata ssd writes(1)
cleanings(0) fallow cleanings(0)
no room(0) front merge(0) back merge(0)
disk reads(144724), disk writes(21521574) ssd reads(1612466) ssd writes(143449)
uncached reads(1275), uncached writes(21521574), uncached IO requeue(0)
uncached sequential reads(0), uncached sequential writes(0)
pid_adds(0), pid_dels(0), pid_drops(0) pid_expiry(0)
-
ตัวอย่าง HDD 500G ใช้ Cache เป็น SSD ขนาด 40G (Intel)
Disk /dev/mapper/cachedev: 500.1 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x37292787
Device Boot Start End Blocks Id System
/dev/mapper/cachedev1 1 65270 524281243+ 83 Linux
root@SmartCafe:~# hdparm -t /dev/mapper/cachedev
/dev/mapper/cachedev:
Timing buffered disk reads: 554 MB in 3.00 seconds = 184.58 MB/sec
root@SmartCafe:~#
ก็จะได้ความเร็วเป็น SSD (180MB/sec) แ่ต่ขนาดความจุ เป็น HDD (500G)