ZFSã§ã®MySQLã®äœ¿çšã«é¢ããããªã倧ããªèšäºã®ç¿»èš³ãšãZFSãšUFSã®æ¯èŒãã¹ããå ¬éããŸãã
ããããæé«ã®ç¿»èš³å質ã§ã¯ãªãããšããadvanceã³ããŸã-è±èªãå匷ããããšããããŸããã æè¬ã®æ°æã¡ã§ãç§ã¯ä¿®æ£ãåãå ¥ããŸãã
ZFSã«ã€ããŠ
Sun Microsystemsã2004幎ã«ZFSãã¡ã€ã«ã·ã¹ãã ãç«ã¡äžãããšãããã¡ã€ã«ã¹ãã¬ãŒãžã®å®çšçãªå¶éããã¹ãŠåãé€ãããã¡ã€ã«ã¹ãã¬ãŒãžç®¡çã®è¬ãéå»ã®ãã®ã«ããŸããã ZFSã¯128ãããã®ãã¡ã€ã«ã·ã¹ãã ã§ãããããã€ãã®ããããã£ã«ååãä»ããŸããã-ãã©ã³ã¶ã¯ã·ã§ã³ã³ããŒãªã³ã©ã€ãã»ãã³ãã£ã¯ã¹ãé«éã¹ãããã·ã§ããããªãã·ã§ã³ã®å§çž®ã
ZFSã䜿çšããæãéèŠãªå©ç¹ã¯ã管çã®å®¹æãã§ãã ZFSã§ã¯ããã£ã¹ã¯ã®ãã©ãŒãããã/ etc / fstabã®ç·šéãªã©ã®åŸæ¥ã®ã¿ã¹ã¯ã¯å®å šã«æé€ããããã©ãŒãRAIDã¢ã¬ã€ã®æ§ç¯ã¯ãèŠããããã€ã³ã¿ã©ã¯ãã£ããªãã«ãã®ããæå³ã®ããã³ãã³ãã®å©ããåããŠéæã§ããŸãã å庫管ççšã®ZFSã¯ãMySQLãããŒã¿ããŒã¹ã«å¯ŸããŠè¡ãããšãè¡ããMySQLã«å ããŠããªãŒãã³ãœãŒã¹ã³ãŒããåããŠããŸãã ZFSã¯ããšããšSolarisã§ãªãªãŒã¹ãããŠããŸããããLinuxã®ç§»æ€ãé²è¡äžã§ãAplpeãOS X 10.5ã«ã€ã³ã¹ããŒã«ããFreeBSD 7ã«å«ãŸããŠããŸãã詳现ã«ã€ããŠã¯ã opensolaris.orgã®ZFSã³ãã¥ããã£ããŒãžãåç §ããŠãã ãã
ZFS管çã¯ãã¹ãã¬ãŒãžããŒã«ã管çããããã®zpoolãšãã¡ã€ã«ã·ã¹ãã çšã®zfsã®2ã€ã®ã³ãã³ãã«å€§ããäŸåããŠããŸãã ã¹ãã¬ãŒãžããŒã«ã¯éèŠãªæœè±¡æŠå¿µã§ããããŒã«ã¯è€æ°ã®ç©çããã€ã¹ã§æ§æã§ããè€æ°ã®ãã¡ã€ã«ã·ã¹ãã ããã¹ãã§ããŸãã ã¹ãã¬ãŒãžãããŒã«ã«è¿œå ãããã³ã«ããããå¿ èŠãšãããã¹ãŠã®ãã¡ã€ã«ã·ã¹ãã ã§äœ¿çšå¯èœã«ãªããŸãã ããŠã³ãããããã©ã€ãå šäœãZFSã¹ãã¬ãŒãžãšããŠäœ¿çšããã«ã¯ã次ã®ã³ãã³ããå®è¡ã§ããŸãã
ïŒzpool create zp1 c2t0d0
ããã§ãzp1ã¯ããŒã«ã®ååãè¡šããc2t0d0ã¯ãã£ã¹ã¯ããã€ã¹ã§ãã Solarisã¹ã¿ã€ã«ã®ããã€ã¹ã®åœåã«ãªãã¿ããªãå Žåã¯ãLinuxããã³ãã®ä»ã®OSã§ã¯å ã®ååã䜿çšããå¿ èŠãããããšã«æ³šæããŠãã ããã
ããšãã°ãããããŒãã£ã·ã§ã³ã§UFSã䜿çšããŠãã£ã¹ã¯ããã§ã«ãã©ãŒããããããŠããå Žåãå¥ã®ç©ºãããŒãã£ã·ã§ã³ã«ããŒã«ãäœæã§ããŸãã
ïŒzpool create zp1 c2t0d0s2
ãã¡ã€ã«ããªããžããªãšããŠäœ¿çšããããšãã§ããŸãã
ïŒzpool create zp1ã/ storage / myzfile
ãã§ã«ããŒã«ãããå Žåã¯ããã®äžã«ãã¡ã€ã«ã·ã¹ãã ãæ§ç¯ã§ããŸãã
ïŒzfs create zp1 / data
ïŒzfs create zp1 / logs
ãã®ã³ãã³ããå®è¡ããåŸããã¡ã€ã«ã·ã¹ãã ã®äœæãåŸ ã€å¿ èŠããããšã¯æããªãã§ãã ãããå³åº§ã«å®è¡ãããŸãã å°æ¥ã空ãé åãäžè¶³ããå Žåã¯ãããã€ã¹ãããŒã«ã«è¿œå ããã ãã§ããã¡ã€ã«ã·ã¹ãã ãå¢å ããŸãã
ïŒzpool add zp1 c3t0d0
ZFSãšããŒãã«ã¹ããŒã¹
ãã®ãã¯ãŒãMySQLã«ãšã£ãŠäœãæå³ããããè©äŸ¡ããã«ã¯ãInnoDBã®ã¹ãã¬ãŒãžç®¡çã®åé¡ãèæ ®ããŠãã ãã
innodb_data_file_path = / disk1 / ibdata1ïŒ10G; / disk2 / ibdata2ïŒ10G; / disk3 / ibdata3ïŒ10GïŒèªåæ¡åŒµ
ãã®äŸã§ã¯ãInnoDBã¹ããŒã¹ã3ã€ã®ç©çãã£ã¹ã¯ã«å²ãåœãŠãããŠããŸããåãã£ã¹ã¯ã«ã¯10 GBãããªãããããè² è·ãããŒãããããšããŠããå¯èœæ§ããããŸãã 3çªç®ã®ãã£ã¹ã¯ã¯èªåæ¡åŒµãšããŠããŒã¯ãããŠãããããå¿ èŠã«å¿ããŠå¢ããããšãã§ããŸãã
æ®å¿µãªããã3ã€ã®ãã£ã¹ã¯ã®è² è·ãåæ£ããããšããŠããå®éã«ã¯æ©èœããŸããã InnoDBã¯ã次ã®ãã£ã¹ã¯ã䜿çšããåã«æåã®ãã£ã¹ã¯ããã£ã±ãã«ãã3çªç®ã®ãã£ã¹ã¯ãå§ããåã«2çªç®ã®ãã£ã¹ã¯ããã£ã±ãã«ããå¿ èŠããããŸãã å¥ã®åé¡ã¯ããªã³ã©ã€ã³ã§è¡šã¹ããŒã¹ãæ¡åŒµã§ããªãããšã§ãã ãã©ã€ãïŒ3ã®ãã£ã¹ã¯å®¹éãäžè¶³ããŠå¥ã®ãã©ã€ããããã¡ã€ã«ãè¿œå ããå Žåãå€æŽãæå¹ã«ããã«ã¯ãµãŒããŒãåèµ·åããå¿ èŠããããŸãã ïŒãã®äŸã§ã¯autoextendã䜿çšããŠããã€ãã®ããªãããŒãªã¢ã¯ã·ã§ã³ãå®è¡ããå¿ èŠããããŸããããããã®è©³çŽ°ã¯ãã®èª¬æã®ç¯å²å€ã§ãïŒã
ã¹ãã¬ãŒãžç®¡çãããŒã¿ããŒã¹ã®åœ±é¿ç¯å²ããå®å šã«åé€ãããå Žåãç¶æ³ãä¿®æ£ã§ããŸãã ãããè¡ãã«ã¯ãinnodb_data_file_pathã§ZFSã䜿çšããã ãã§ååã§ãã
innodb_data_file_path = / dbzpool / data / ibdatafileïŒ10GïŒautoextend
ãã®ã¹ãã¬ãŒãžã奜ããªã ãããã€ã¹ã«åå²ã§ããZFSã¯è² è·ãã€ã³ããªãžã§ã³ãã«åæ£ããŸãã ããŒã¿ããŒã¹ãåèµ·åããã«ãããã€ã¹ãçµã¿åãããŠãã©ãŒåããå¿ èŠã«å¿ããŠã¹ããŒã¹ãè¿œå ãããã®å Žã§ããã¯ã¢ãããã£ã¹ã¯ãè¿œå ããç Žæãããã£ã¹ã¯ãé€å€ã§ããŸãã ããŒã¿ããŒã¹ãããŒã¿ããŒã¹ã«ããããšãã§ããŸããmysqlã®ãŠãŒã¶ãŒã«ãšã£ãŠã¯ãããŒã¿ããŒã¹ãã·ã³ãã«ã§å®äŸ¡ã§äœ¿ãããããã®ã«ããããšã«éäžã§ããŸãã
MySQL Falconãšã³ãžã³ã§ã¯ããªã³ã©ã€ã³ã§è¡šã¹ããŒã¹ãäœæããã³åé€ã§ããŸããã1ã€ã®ããŒã¿ãã¡ã€ã«ã®ã¿ãå«ããããšãã§ããŸãã å°æ¥ã®ããŒãžã§ã³ã§ã¯è€æ°ã®ããŒã¿ãã¡ã€ã«ã®ãµããŒããçŽæãããŠããŸãããZFSãŠãŒã¶ãŒã¯ãã®æ©èœãå¿ èŠãšããŸããã
ãã¡ã€ã«ã·ã¹ãã ããããã¡ãªã³ã°ãäºæž¬
åŸæ¥ããã¡ã€ã«ã·ã¹ãã ã¬ãã«ã«ã¯ãã»ãšãã©ã®ã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãå€§å¹ ã«åäžãããããšãã§ããå°ããªããããã£ã»ãããå«ãŸããŠããŸãã 1ã€ç®ã¯ãããã¡ãªã³ã°ã§ã -ç©çãã£ã¹ã¯ãšããã䜿çšããã¢ããªã±ãŒã·ã§ã³ã®éã®ã¡ã¢ãªã®äžéé åã
以äžã¯å èªã¿ã§ããã¢ããªã±ãŒã·ã§ã³ããã¡ã€ã«ã®å€§ããªãããã¯ãèŠæ±ããå Žåãã¢ããªã±ãŒã·ã§ã³ãããã«èªã¿ç¶ããããšãæåŸ ããŠããã¡ã€ã«ã·ã¹ãã ã¯ããã«å€§ããªãããã¯ãèªãå¿ èŠããããŸãã
ãã®ç¹ã§ãããŒã¿ããŒã¹ãµãŒããŒã¯äžè¬çãªææ¡ã§ã¯ãããŸããã ãããã£ãŠãã¬ã³ãŒãããã£ãã·ã¥ããããã«ãã¡ã€ã«ã·ã¹ãã ãããã¡ã«äŸåããŠããããŒã¿ããŒã¹MyISAMã¯ããã®ã»ã¯ã·ã§ã³ã§èª¬æããåé¡ã®åœ±é¿ãåããŸããããä»ã®å€ãã¯ç¬èªã®ãããã¡å±€ã䜿çšããŸãã ããŒã¿ããŒã¹ã®ããã©ãŒãã³ã¹ã¯ããã®ãã£ãã·ã¥ã®äœ¿çšå¹çã«äŸåããŸãããã£ãã·ã¥ãã¹ãçºçããç©çãã£ã¹ã¯ããã®èªã¿åããçºçãããã³ã«ãå¹çãäœäžããŸãã
ãã®åé¡ã¯ãããŒã¿ãããŒã¿ããŒã¹ãµãŒããŒäžã§2åãã¡ã¢ãªã«2åãã£ãã·ã¥ããããã¡ã€ã«ã·ã¹ãã ã§2åãã£ãã·ã¥ããããšãã«çºçããŸãã ããŒã¿ã®ã³ããŒã2ã€ä¿åãããšãã¡ã¢ãªäœ¿çšéãååã«ãªããŸãã ã¡ã¢ãªããã£ã±ãã«ãªããšãå¯èœãªããŒã¿ã®ååããå«ãŸããªãããããã£ãã·ã¥å ã®ãããæ°ãæžå°ããèªã¿åãæ°ãå¢å ããŠå¹çãäœäžããŸãã ãããããã«ãããã¡åé¡ãšåŒã³ãŸãã
次ã®æé©å-ãã¬ãŒã³ããŒã·ã§ã³-ããããŒã¿ããŒã¹ãµãŒããŒã«æ害ãªå ŽåããããŸãã ããŒã¿ããŒã¹ã«ãã£ãŠè¡ãããèªã¿åãå€ã¯äºæž¬å¯èœãªãã³ãã¬ãŒãã«é©åããªãããããã¡ã€ã«ã·ã¹ãã ã¯äœ¿çšãããªãããŒã¿ãèªã¿åããŸãã Sunã®ãšã³ãžãã¢å Œããã¬ãŒã§ããRoch Bourbonnaisã¯ãããã調æ»ããŸãããåŸæ¥ã®UFSãã¡ã€ã«ã·ã¹ãã ãã2ã€ã®é£ç¶ããããŒãžãžã®ã¢ã¯ã»ã¹ãèŠããšãçŸåšã¯éåžž1MBã®ãµã€ãºã®å®å šãªã¯ã©ã¹ã¿ãŒãèªã¿åããŸãã ãã£ã¹ã¯ããããäžèŠãªããŒã¿ã®èªã¿åãã«è²»ããæéã¯ãããçç£çã«è²»ããå¿ èŠããããŸãã
å€ãã®MySQLãŠãŒã¶ãŒãç¹ã«Solarisã§ã¯ãããã2ã€ã®åé¡ã¯åã«èšå®ãç¡å¹ã«ããããšã§è§£æ±ºããããšçããŠããŸãã ãããã¡ãªã³ã°ãšèªã¿åãå€ãªãã®ãã¡ã€ã«ã·ã¹ãã ãžã®ã¢ã¯ã»ã¹ã¯Direct I / Oã«ç¥ãããŠãããO_DIRECTã§innodb_flush_methodãèšå®ããããšã§my.cnfã§èš±å¯ã§ããŸãã
innodb_flush_method = O_DIRECT
MySQL 5.0.42ããã³5.1.18ã®ãªãªãŒã¹åã®2007幎4æã«ã¯ããã®ããã«ãSolarisã®forcedirectioãªãã·ã§ã³ã§ããŒã¿ãã¡ã€ã«ãå«ãããŒãã£ã·ã§ã³ãããŠã³ãããå¿ èŠããããŸããã 幞ããªããšã«ãçŸåšã¯ããã§ã¯ãããŸãããInnoDBã¯ããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ã«ããŒãã£ã·ã§ã³å šäœãžã®çŽæ¥ã¢ã¯ã»ã¹ã匷å¶ããããšãªããçŽæ¥ã¢ã¯ã»ã¹ã䜿çšã§ããŸãã
ZFSããã³I / Oã¹ã±ãžã¥ãŒã©ãŒ
InnoDBãZFSã§äœ¿çšãããšãééããªãããã«ãããã¡ãŒã®åé¡ãçºçãããã®å¹æã¯ä»¥äžã®ãã¹ãã§ç°¡åã«ç¢ºèªã§ããŸãã èªã¿åãã«é¢ããŠã¯ãZFSã®åæãªãªãŒã¹ã¯èªã¿åãã«æ©ãŸãããŠããŸããããçŸåšã®ãªãªãŒã¹ïŒOpenSolaris Nevadaãã«ã70以éïŒã¯å ããŠããŸãã å¥ã®SUNãšã³ãžãã¢ããã³ããã¬ãŒã§ããNeelakanth Nadgirã¯ã2006幎ã«ããŒã¿ããŒã¹ã§ZFSãã¹ããããã€ãè¡ãã以åã®ããã©ãŒãã³ã¹ã®åé¡ã¯æ°ãããã«ãã§ä¿®æ£ããããšè¿°ã¹ãŸããã
ZFSã¯ãI / Oã¹ã±ãžã¥ãŒã©ã«3çªç®ã®èå³æ·±ãããã©ãŒãã³ã¹ã®æ¹åããããããŸãã ZFSã¹ã±ãžã¥ãŒã©ã¯ã次ã®èšç»ã«åŸã£ãŠæ©èœããŸãã
â¢I / OèŠæ±ãã«ãŒãã«ã«å°çãããšããã¥ãŒã«å ¥ããããåªå é äœãšæéïŒããé«ãåªå é äœããããæéïŒãå²ãåœãŠãããŸãã
â¢èªã¿åãèŠæ±ã¯ãæžã蟌ã¿èŠæ±ãããåªå ãããŸãã èªã¿åãèŠæ±ã¯å®éã«ã¯åæã§ããããïŒã¢ããªã±ãŒã·ã§ã³ã¯ãããã¯ãããå¿çãåŸ æ©ããŠããŸãïŒã èªã¿åãèŠæ±ã¯ãã¥ãŒã®å é ã«èœã¡ãŸãã
â¢ã¹ã±ãžã¥ãŒã©ãŒã¯ãã¹ãŠã®ä¿çäžã®èŠæ±ãã¹ãã£ã³ãã次ã«å®è¡ããã決å®ãè¡ããŸãã ãããè¡ãã«ã¯ãæãç·æ¥ã®èŠæ±ããæéã°ã«ãŒããã«ãŸãšããè«çãããã¯ã¢ãã¬ã¹ã®é åºã§ãã£ã¹ã¯ã«é åžããŸãã
SUNã®å¥ã®ããã¬ãŒã¯ãZFS I / Oã¹ã±ãžã¥ãŒã©ãŒã§å°ãªããšã1ã€ã®ãã¹ããè¡ããŸã
ïŒããããããã§ç§ã®è³ãå£ããïŒ
ããã«å¥ã®Sunããã¬ãŒãå°å ¥ããããã«ãZFS I / Oã¹ã±ãžã¥ãŒã©ãããã©ãŒãã³ã¹ã«å€§ããªéããããããããšã瀺ãããŠãããã³ãããŒã¯ãå°ãªããšã1ã€ãããŸãã
ZFSã«MySQLããããã€ããïŒè©³çŽ°
ZFSãšMySQLã®çµã¿åããã¯ææãªçµã¿åããã®ããã«èŠããŸãããã©ã®ããã«çµã¿åãããã®ã§ããããïŒ å€ãã®å ŽåãããŒã¿ããŒã¹ãµãŒããŒãšãã¡ã€ã«ã·ã¹ãã ã¯åãäžé£ã®åé¡ã解決ããå¿ èŠããããããããã解決çãæäŸããŸãã 2ã€ã®ãœãªã¥ãŒã·ã§ã³ã¯äºãã«ããŸãçµã¿åããããããäºãã«éãªãåããªãããšããããŸãã 以äžã¯éèŠãªãã€ã³ãã§ãã
ZFSã¬ã³ãŒããµã€ãºããããã¯ãµã€ãºã«èšå®ãã
ZFSã¯ããã¡ã€ã«ã®ãµã€ãºãšãã®äœ¿çšã¿ã€ãã«åºã¥ããŠãåãã¡ã€ã«ã®ãããã¯ãµã€ãºãçºèŠçã«æ±ºå®ããããšããŸãã å°ããªãã¡ã€ã«ã¯å°ããªæçã§ç®¡çããã倧ããªãã¡ã€ã«ã¯å€§ããªæçã§ç®¡çãããŸãã ZFSéçºè ã¯ããã®ãããªã¹ããŒã ãäžè¬çãªå Žåã«æé©ã§ããããšãç¥ã£ãŠããŸãããããŒã¿ããŒã¹ã«ã¯ãŸã£ããé©ããŠããªãå¯èœæ§ãããããããã¡ã€ã«ã·ã¹ãã ãããŒã¿ããŒã¹ã§äœ¿çšããããšãã«ãŠãŒã¶ãŒãåºå®ã¬ã³ãŒããµã€ãºãèšå®ã§ããããã«ããŸããã ãã®èšäºã§åŸè¿°ããããã€ãã®èæ ®äºé ã¯ãããŒã¿ããŒã¹ã®ããŒãžãµã€ãºãZFSã¬ã³ãŒãã®ãµã€ãºãšçããå Žåã«ã®ã¿åœãŠã¯ãŸããŸãã
InnoDBã¯ãç°ãªãããŒãžãµã€ãºã§åã³ã³ãã€ã«ãããŸã§ã16KBããŒãžã®ããŒã¿ãã¡ã€ã«ãåŠçããŸãã Falconã¯ããã©ã«ãã§4KBããŒãžã䜿çšããŸãããmy.cnfã®ã€ã³ã¹ããŒã«ãèš±å¯ããŸãã ã©ã¡ãã®å ŽåããZFSã¬ã³ãŒããµã€ãºãããŒãžã®ãµã€ãºã«èšå®ããããšãéèŠã§ãã ããã¯ãã»ã¯ã·ã§ã³å ã®ãã¡ã€ã«ãäœæãããåã«å®è¡ããå¿ èŠããããŸããã³ãã³ãã¯æ¬¡ã®ããã«ãªããŸãã
ïŒzfs set recordsize = 16K zp1 /ããŒã¿
InnoDBãã¥ã¢ã«æžã蟌ã¿ãããã¡ãŒãšãã©ã³ã¶ã¯ã·ã§ã³ã¹ãã¬ãŒãž
äžéšã®ãã©ã³ã¶ã¯ã·ã§ã³ã·ã¹ãã ïŒInnoDBã§ã¯ãªãïŒã¯ãããŒã¿ããŒãžå šäœããã©ã³ã¶ã¯ã·ã§ã³ãã°ã«æžã蟌ã¿ãŸãã ãã ããInnoDBã¯ããŒãžçªå·ãšå€æŽãããã¬ã³ãŒãã®ã¿ãèšé²ããŸããããã¯ãŠãŒã¶ãŒããã©ã³ã¶ã¯ã·ã§ã³ã®å®äºãåŸ æ©ããéèŠãªç¬éã§ãããããInnoDBã¯ãã£ã¹ã¯ã«éä¿¡ããããŒã¿ãå°ãªããªããããã©ãŒãã³ã¹ãåäžããŸãã
ãããã®ä»ã®ããŒã¿ããŒã¹ãã¯ã©ãã·ã¥ããå Žåããã°ã䜿çšããŠåèµ·åããŠåŸ©å ãããšããã°ããããŒã¿ã®ããŒãžå šäœãåŒãåºããŠããŒã¿ãã¡ã€ã«ã«æžã蟌ãããšãã§ããŸãã
InnoDBã§ã¯ããªã«ããªã¯ããã»ã©ç°¡åã§ã¯ãããŸããã æ å ±ã®ã»ãã®äžéšã®ã¿ããã°ã«èšé²ããããããããŒã¿ããŒãžã¯ãã£ã¹ã¯äžã§æ£ç¢ºã§ãªããã°ãªããŸããã InnoDBã¯ãæåŸã«èšé²ãããããŒãžã®2çªç®ã®ã³ããŒãå«ããäºéæžã蟌ã¿ãããã¡ãŒãšåŒã°ããããŒã¿ãã¡ã€ã«ã®ç¹å¥ãªé åã䜿çšããŠããããä¿èšŒããããšããŠããŸãã ã¯ã©ãã·ã¥åŸãå€æŽããŒã¿ã®ã³ããŒã2ã€ãããŸãã1ã€ã¯éåžžã®ãã¡ã€ã«ã«ã2ã€ç®ã¯ããã«ãšã³ããªãããã¡ã«ããããããã®ã³ããŒã®å°ãªããšã1ã€ã¯ç¡å·ã§ãªããã°ãªããŸããã ããã«ã©ã€ããããã¡ã¯ZFSã§ã¯å¿ èŠãããŸããããããç¡å¹ã«ããããšã§ãå¹çãå°ãäžããããšãã§ããŸãã
éšåèšé²äžã®äºéæžã蟌ã¿ãããã¡ãäž»ã«ä¿è·ãããã®ããïŒããŒã¿ããŒã¹ã16KBããŒãžããã£ã¹ã¯ã«éä¿¡ããããé»æºãåããåã«å®éã«æžã蟌ãŸããã®ã¯4KBãŸãã¯8KBã ãã ã£ãå Žåã ãã®å Žåããã©ã³ã¶ã¯ã·ã§ã³ã¯ããŒã¿ããŒã¹ããã§ã¯ãªãããã¡ã€ã«ã·ã¹ãã ããã®ãã®ã§ããZFSã¯ãéšåçãªããŒã¿èšé²ãçºçããªãããã«ããŸãã
éšåçãªèšé²ã®å®å šãªç»åãååŸããã«ã¯ãå¥ã®ãã£ã¹ã¯ãããã¯ãããšãã°ãããã¯82ãæ³åããŠãã ãããããã¯ãé»æºãåãããšãã«åŸæ¥ã®Unixãã¡ã€ã«ã·ã¹ãã ã§äžæžããããŸããã ã·ã¹ãã ããªããŒããããšããããã¯82ã®å é ã«ã¯éšåçã«èšé²ãããæ°ããããŒã¿ãå«ãŸãã次ã®ããŒã¹ã«ã¯ãŽããå«ãŸãããããã¯ã®æ«å°Ÿã«ã¯äžæžããããªãå€ãããŒã¿ãå«ãŸããŸãã ãããã¯ã«InnoDBããŒãžãå«ãŸããŠããå ŽåãããŒãžã®æåŸã«ãã§ãã¯ãµã ãå«ãŸããŸãããã§ãã¯ãµã ã¯ãæ€èšŒäžã«ããŒãžã®ã³ã³ãã³ãã®å€±æã瀺ããŸãã
ZFSã§ã¯ãåé»åã«ããŒã¿ããŒã¹ããããã¯82ãäžæžããããšããŸã£ããç°ãªãããšãèµ·ãããŸãã ãããã¯82ã¯å®éã«ã¯äžæžããããŸãããã代ããã«ãæ°ãããããã¯å šäœãå¥ã®å Žæã«æžã蟌ãŸããŸãã ãããã£ãŠãèšé²ããã»ã¹äžã«é»åã倱ãããå Žåããããã¯82ã¯ãã®ãŸãŸæ®ããŸãã ãã¹ãŠãããŸãããã°ãããŒã¿ã¯å¥ã®å Žæã«ä¿åãããå€ããããã¯ã§ã¯ãªãæ°ãããããã¯ããã¡ã€ã«ã«å«ãŸããŸãïŒå°ãªããšãçŸåšã®ããŒãžã§ã³ã®ãã¡ã€ã«ã«å«ãŸããŸãïŒïŒãã¡ã€ã«ã®ä»¥åã®ããŒãžã§ã³ã®ã¹ãããã·ã§ãããååšããå ŽåããããŸããå€ããããã¯ïŒããŒã¿ããŒã¹ã«è¿ã人ã¯ããã«ãããŒãžã§ã³ã䜿çšããåæã¢ã¯ã»ã¹ãèšæ¶ã§ããŸããããã¡ã€ã«ã·ã¹ãã ã¬ãã«ã§ããããã®ããããã£ã¯FreeBSDãNetAppãVeritasãã¡ã€ã«ã·ã¹ãã ã«é·å¹ŽååšããŠããŸããïŒã
MySQL ZFSãšããã©ãŒãã³ã¹ã®æ¯èŒ Open Solarisäžã®UFS
Solarisã§UFSãšZFSãæ¯èŒããããã«ã2ã€ã®åå¥ã®ãã¹ããå®æœããŸããã OpenSolaris Nevada build 74ããã³MySQL 5.0.50ã§ã®x86ãã¹ã¯ãããã2 GB RAMã®ãã¹ãã«äœ¿çšããããã·ã³ã æåã®ãã¹ãã¯ãäžæ¬æ¿å ¥ããALTER TABLEããªã©ã®äžè¬çãªæäœã衚瀺ããããã«èšèšãããã·ã³ã°ã«ã¹ã¬ããã®ããŠãŒãã£ãªãã£ãã§ãã ãã®ãã¹ãã§ã¯ã2ã€ã®ãã¡ã€ã«ã·ã¹ãã éã«é¡èãªéãã¯èŠãããŸããã§ããããäžéšã®åã ã®æäœã¯ãUFSãããZFSã§5ïŒ é ããªããŸãã
次ã®ãã¹ãã¯ããèå³æ·±ãããšãå€æããŸããã ãã®ãã¹ãã«ã¯ãINSERTã¯ãšãªãšUPDATEã¯ãšãªã§åºåãããSELECTã¯ãšãªã®85ïŒ ã®ãã¿ãŒã³ã䜿çšããŠã3.2GBããŒã¿ããŒã¹ã«ã¢ã¯ã»ã¹ãã6ã€ã®ã¯ã©ã€ã¢ã³ãã¹ã¬ãããå«ãŸããŠããŸããã 3.2 GBã®ããŒã¿ããŒã¹ã¯å€§ããããŠã¡ã¢ãªã«åãŸããŸããã ãã¹ãã¯å ¥ååºåã®å¶éã瀺ããåããã¹ãã¯ã»ãšãã©ã®å®éã®ã¢ããªã±ãŒã·ã§ã³ã®åäœãã·ãã¥ã¬ãŒãããŸããå¥ã®ã¬ã³ãŒãã»ããïŒå šäœã®çŽ5ïŒ ïŒãä»ã®ã¬ã³ãŒããããã¯ããã«é »ç¹ã«éžæãããŸãã
ãã®ãã¹ãã¯ãã£ãã·ã¥ã®åäœã«ç¹ã«ææã§ãããåãã¹ãã«ã¯ãã£ãã·ã¥ãæºããããã®ãŠã©ãŒã ã¢ããæéãå«ãŸããŠããããŠã©ãŒã ã¢ããæéãç°ãªãå Žåã¯ãã¹ããæ£åœã«æ¯èŒã§ããŸããã ãŠã©ãŒã ã¢ããæéããŒãã«ãªã»ããããã«ã¯ããã£ãã·ã¥ãããã¡ããã©ãã·ã¥ãããŠããéã«ãã¡ã€ã«ã·ã¹ãã ãåããŠã³ãããå¿ èŠãããå ŽåããããŸãã
ZFSãš 5åéã®ãŠã©ãŒã ã¢ããåŸã®UFSã æ°å€ã倧ããã»ã©ããã©ãŒãã³ã¹ãåäžããŸãã 2 GBã®RAMãåãããµãŒããŒããã3.2 GBã®ããŒã¿ããŒã¹ã
InnoDBãããã¡ãŒããŒã«ãµã€ãº | UFSãã€ã¬ã¯ãI / O | ZFS |
---|---|---|
100 MB | 36.84 | 96.21 |
250 MB | 45.70 | 80.69 |
350 MB | 50.68 | 102.75 |
500 MB | 57.32 | 94.99 |
700 MB | 61.92 | 85.95 |
1000 MB | 82.41 | 98.35 |
1200 MB | 95.01 | 88.98 |
1400 MB | 101.32 | 117.83 |
5åéã®ãŠã©ãŒã ã¢ãããã¹ãã§ã¯ããããã¡ãŒãµã€ãºã®å¢å ã«äŒŽããUFSã®ããŒã¿ããŒã¹ããã©ãŒãã³ã¹ãçå®ã«åäžããŠããããšã瀺ãããŠããŸãã ZFSã§ã¯ãçµæã¯äžå®å®ã§éç·åœ¢ã§ãã ãŠã©ãŒã ã¢ããæéã10åã«å¢ãããšãç»åãããé®®æã«è¡šç€ºãããŸãã
ZFSãš 10åéã®ãŠã©ãŒã ã¢ããåŸã®UFSã
InnoDBãããã¡ãŒããŒã«ãµã€ãº | UFSãã€ã¬ã¯ãI / O | ZFS |
---|---|---|
100 MB | 35.71 | 179.18 |
250 MB | 44.25 | 154.26 |
350 MB | 50.60 | 110.14 |
500 MB | 57.10 | 93.29 |
700 MB | 66.57 | 101.35 |
1000 MB | 103.47 | 114.18 |
1200 MB | 168.66 | 156.04 |
1400 MB | 325.05 | 290.14 |
ç¹°ãè¿ãã«ãªããŸãããUFSã®ããã©ãŒãã³ã¹ã¯ããããã¡ãŒãµã€ãºã®å¢å ãšãšãã«çå®ã«å¢å ããŠãããæåŸã«åãã£ãŠéåžžã«å€§ãããªã£ãŠããŸãã 1200ããã³1400 MBã®æåŸã®2ã€ã®ãã€ã³ãã¯ããã·ã³ã¡ã¢ãªã®60ããã³70ïŒ ãæå³ããããã¯ããŒã¿ã®ååãæ ŒçŽããã®ã«ååã§ãã
ãããã¡ãµã€ãºãå°ããå ŽåãZFSã¯UFSãããã¯ããã«åªããŠããŸãã ZFSãã£ãã·ã¥ã¯éåžžã«å¹ççã§ãã 100MBãããã¡ãŒã§ã®ZFSã¯ã1200MBã§ãUFSãããå¹ççã§ãã ãã ããããŒã«ãµã€ãºãå¢å ãããšãZFSã®ããã©ãŒãã³ã¹ã¯äœäžããŸã
ãã®åäœã¯ãããã«ãããã¡ãªã³ã°ãåå ã§ãã äžéšã®ããŒã¿ã¯äž¡æ¹ã®ãã£ãã·ã¥ã«ååšãããããã¡ã¢ãªã«ä¿åãããããŒã¿ã¯å°ãªããªããç©çãã£ã¹ã¯ãžã®ã¢ã¯ã»ã¹ãããé »ç¹ã«å¿ èŠã«ãªããŸãã ãã®å¹æã¯ããããã¡ãµã€ãºã500 MBã«èšå®ãããŠããå Žåãææªã®å¹æããããŸãã
500MBãè¶ ãããšã2ã€ã®ãã¡ã€ã«ã·ã¹ãã ã¯ããé¡äŒŒããæ¹æ³ã§åäœãå§ããŸãã ããŒã¿ããŒã¹ãµãŒããŒã¯ã»ãšãã©ã®ç©çã¡ã¢ãªãå¿ èŠãšããZFSã«ã»ãšãã©æ®ããªããããããã©ãŒãã³ã¹ãžã®ZFSã®å¯äžãæå°éã«æããããã«ãããã¡ãªã³ã°ã®åé¡ã軜æžããŸãã
ãããã«
ZFSã䜿çšãããšãå®éã®ããã©ãŒãã³ã¹ãæãªãããšãªããéåžžã«ã·ã³ãã«ã§æè»ãªç®¡çãå¯èœã«ãªããŸãã ææªã®å Žåã®ã·ããªãªã§ã¯ããããã®ãã¹ãã§ã¯ãZFSã¯Direct I / Oã䜿çšããUFSãšã»ãŒåãããã«åäœããŸãã InnoDBã®å Žåãããã©ãŒãã³ã¹ã°ã©ãã¯ããinndbãããã¡ãŒãå°ãªãèšå®ããZFSã«ãããã¡ãªã³ã°ã管çãããããšããæ°ããæŠç¥ã䜿çšããããæ瀺ããŸãããã¹ããå®è¡ãããšãããŸã FFSããã¹ãããŠããŸãããè¡ããã³æžå°ããããŒãžãã£ãã·ã¥ã ããã«ãããã¡ãªã³ã°ã®åé¡ã¯ZFSã®ããã©ãŒãã³ã¹ã°ã©ãã«ã¯ã£ãããšè¡šããŠããŸãããææªã®å ŽåãZFSã¯UFSãããçç£çã§ãã
ïŒçŽãæåŸã®æ®µèœã§ãç§ã¯è³ãå£ããïŒ
ãã®ãã³ãããŒã¯ã§åªããããã©ãŒãã³ã¹ãåŸãããæ¬åœã®çç±ã¯æ確ã§ã¯ãããŸãã-å®éããã¹ãŠã®ã¯ãŒã¯ããŒãã¯ç°ãªããŸã-ããããZFS I / Oã¹ã±ãžã¥ãŒã©ãããŒã¿ããŒã¹ããã©ãŒãã³ã¹ã«æ³šæãæã£ãŠããSunã®ãšã³ãžãã¢ãããã³æè¿ïŒ2007幎åŸåã«è²¢ç®ããZFSãã°ä¿®æ£ïŒOpen Solarisã®ãªãªãŒã¹ã¯ãäœãè¯ããã®ãè¿œå ããŠããããã§ãã
psïŒç¹°ãè¿ããŸãããå質ã«è¬çœªããŸããããã¹ãã¯ããªã¥ãŒã ãããããªããæ¹æ³ããããŸããããããªãã§ã¯ãããã«èš±å®¹ã§ããªãæéãæ¢ã«è²»ãããŠããŸãã 翻蚳ã¯ãåºçã®ããã§ã¯ãªãããããã¯ã«å¯Ÿããããå®å šãªæŽå¯ã®ããã«è¡ãããŸããã ç§èªèº«ãã€ã³ã¹ãã¬ãŒã·ã§ã³ãåããŠããããã«èŠããŸããããä»ã®èª°ãã«åœ¹ç«ã€ããšãé¡ã£ãŠããŸãã è¿ãå°æ¥ããã¹ããå®æœããäºå®ã§ããã³ãã¥ããã£ãèå³ãæã£ãŠããå Žåã¯ãããããå ¬éããŸãã