ããã«ã¡ã¯ ãã®èšäºã§ã¯ãæç³»åãåéããã³ä¿åããããã®å°çšããŒã¿ããŒã¹ã§ããAkumuliãããžã§ã¯ãã«ã€ããŠã話ããããšæããŸãã ç§ã¯ãã®ãããžã§ã¯ãã«4幎以äžåãçµãã§ãããé«ãå®å®æ§ãšä¿¡é Œæ§ãéæãããã®åéã§äœãæ°ãããã®ãçºæãããããããŸããã
æç³»åãšã¯ãå¯èœãªéãåçŽåããããã«ãæéé ã«äžŠã¹ãããäžé£ã®æž¬å®å€ã§ããããã¯ãã°ã©ãã«æãããšãã§ãããã®ã§ãã æç³»åã¯ãéèããDNAåæãŸã§ãå€ãã®ã¢ããªã±ãŒã·ã§ã³ã§èªç¶ã«çºçããŸãã æç³»åããŒã¿ããŒã¹ã®æãäžè¬çãªäœ¿çšæ¹æ³ã¯ãã€ã³ãã©ã¹ãã©ã¯ãã£ã®ç£èŠã«ãããŸãã æãæ·±å»ãªè² è·ãããèŠãããŸãã
ãTSDBã¯å¿ èŠãããŸããããã§ã«XããããŸãã
Xã¯ãSQLããŒã¿ããŒã¹ãããã©ãããã¡ã€ã«ãŸã§äœã§ãããŸããŸããã å®éãããã¯ãã¹ãŠãæç³»åãæ ŒçŽããããã«å®éã«äœ¿çšã§ããŸããã1ã€ã®èŠåããããŸã-ããŒã¿ãã»ãšãã©ãããŸããã SQLããŒã¿ããŒã¹ã«10,000åã®æ¿å ¥ãè¡ããšããã°ããã®éãã¹ãŠãæ£åžžã«ãªããŸãããã®åŸãããŒãã«ã®ãµã€ãºã倧ãããªããæ¿å ¥æäœã®å®è¡æéãé·ããªããŸãã
æ¿å ¥ããåã«ã°ã«ãŒãåãéå§ããŸãããããã¯åœ¹ç«ã¡ãŸãããæ°ããåé¡ãçºçããŸãã-ã©ããã«ããŒã¿ãèç©ããå¿ èŠããããããããŒã¿ããŒã¹ã«æžã蟌ãæéããªãã£ããã¹ãŠã倱ãå¯èœæ§ããããŸãã 次ã®ã¹ãããã¯ã1ã€ã®è¡ã«1ã€ã®ãã£ã¡ã³ã·ã§ã³ïŒid +ã¿ã€ã ã¹ã¿ã³ã+å€ïŒã§ã¯ãªããè€æ°ã®ïŒid +ã¿ã€ã ã¹ã¿ã³ã+å€+ 10ç§ã®å€+ 20ç§ã®å€+ ...ïŒãæ ŒçŽãããªã©ãããã€ãã®ããªãããŒãªã¹ããŒã ã®äœ¿çšãè©Šã¿ãããšã§ãã ããã«ãããæžã蟌ã¿ã¹ã«ãŒãããã¯åäžããŸãããæ°ããåé¡ãçºçããŸãã å§çž®ãããã»ã©åŒ·ããªããããå Žæã¯ããã«çµãããŸããç°ãªãã¹ãããã§æç³»åãä¿åããå¿ èŠããããå¯å€ã¹ãããã§æç³»åãä¿åããå¿ èŠããããéèšïŒééããšã®æ倧å€ïŒãã«ãŠã³ãããå¿ èŠãããã1æéã®ã¹ãããã§10ç§ã®ã¹ãããã§æç³»åãäœæããå¿ èŠããããŸãã
ãããã®åé¡ã¯ãã¹ãŠå æå¯èœã§ãSQLãµãŒããŒããã©ãããã¡ã€ã«ã CassandraããŸãã¯Pandaã®äžã«TSDBãæžã蟌ãã ãã§ãã å®éãå€ãã®äººããã§ã«ãã®æ¹æ³ãæ¡çšããŠããŸããããã¯ãä»ã®DBã®äžã§åäœããæ¢åã®TSDBã®æ°ããæšæž¬ã§ããŸãã Akumuiã¯ããªãªãžãã«ã®ã¢ã«ãŽãªãºã ã«åºã¥ããç¹æ®ãªã¹ãã¬ãŒãžã䜿çšãããšããç¹ã§ããããšç°ãªããŸãã
èšèš
TSDBã解決ããåé¡ã¯ãããŒã¿ã1ã€ã®é åºã§æžã蟌ãŸããå¥ã®é åºã§èªã¿åããããšããäºå®ã«åž°çãããããšãã§ããŸãã 100äžã®æç³»åããããããããã«1ç§ã«1åãçŸåšã®ã¿ã€ã ã¹ã¿ã³ãã§1ã€ã®å€ãæžã蟌ãå¿ èŠããããšããŸãã ãããããã°ããèšé²ããã«ã¯ãå°çããé ã«èšé²ããå¿ èŠããããŸãã æ®å¿µãªããã1ã€ã®æç³»åãã1æéã®ããŒã¿ãèªã¿åãããå Žåã3600 * 1 000 000ãã€ã³ããã¹ãŠãèªã¿åããã»ãšãã©ã®ããŒã¿ããã£ã«ã¿ãªã³ã°ããŠ3600ã ããæ®ãå¿ èŠããããŸããããã¯èªã¿åãå¢å¹ ãšåŒã°ããããã¯è¯ããããŸããã
æ®å¿µãªãããå€ãã®TSDBãããã«ã€ããŠã ããã£ãŠããŸãã å¯äžã®éãã¯ãããŒã¿aïŒãå§çž®ãããbïŒå°ããªãããã¯ã«åå²ãããããšã§ããåãããã¯ã¯ããã¹ãŠã®ã³ã³ãã³ãã解æããã«å¿ èŠãªããŒã¿ã«ããã«ãžã£ã³ãã§ããå圢åŒïŒããããPAXïŒãæã£ãŠããŸãã
ç§ã¯å¥ã®éãéžæããããšã«ããŸããïŒæåã«PAXãè©ŠããŸããïŒããååã«å¥ã ã®æç³»åãä¿åãããåæ±ç¶ã®ã¹ãã¬ãŒãžãå®è£ ããŸããã ããã«ãããã¯ãšãªã«å¿ èŠãªããŒã¿ã®ã¿ãèªã¿åãããšãã§ããŸãã ææ°ã®SSDãšNVMeã§ã¯ãããŒã¿ããŒã¹ããã¢ã¯ã»ã¹ãããããŒã¿ãå³å¯ã«ã·ãŒã±ã³ã·ã£ã«ã«ããå¿ èŠã¯ãããŸããããã¹ã«ãŒããããå¶éãããŠãããããããŒã¿ããŒã¹ããã£ã¹ã¯ã·ãŒã¯ãä¿åããã«æ¬åœã«å¿ èŠãªãã®ã®ã¿ãèªã¿åãããšãéåžžã«éèŠã§ãã 以åã¯ãéã®æ¹æ³ã§ã垯åå¹ ããã£ã¹ã¯ã·ãŒã¯ã«å€æŽããŸãããå€ãã®ããŒã¿æ§é ããã®åŠ¥åç¹ãäžå¿ã«æ§ç¯ãããŠããŸãïŒhello LSMããªãŒïŒã Akumuliã¯ãã®éã§ãã
å§çž®
ããã¯TSDBã«ãšã£ãŠæãéèŠãªåŽé¢ã§ãã å§çž®ã¯åŠ¥åã«åŒ·ã圱é¿ãããã®ãã©ã³ã¹ãããŒã¿ããŒã¹ã®èšèšã®åºç€ãšãªããŸãã Akumuliã®å Žåãç§ã«ã¯æããããã«ãããªãè¯ãã¢ã«ãŽãªãºã ãéçºããŸããã æ¬è³ªçã«2ã€ã®ç°ãªãã¢ã«ãŽãªãºã ã䜿çšããŠãã¿ã€ã ã¹ã¿ã³ããšå€ãå§çž®ããŸãã 詳现ã«ã€ããŠã¯è©³ãã説æããŸããã ãã¯ã€ãããŒããŒããããŸãããè¯ã玹ä»ãããããšæããŸãã
ãã€ã³ãïŒæé+å€ïŒã¯16ã®ã°ã«ãŒãã«ãŸãšããããäžç·ã«å§çž®ãããŸãã ããã«ãããåºå®é·ã®é åãåŠçããåçŽãªãµã€ã¯ã«ã®åœ¢åŒã§ã¢ã«ãŽãªãºã ãèšè¿°ã§ããã³ã³ãã€ã©ãŒã¯æé©åãšãã¯ãã«åãé©åã«è¡ãããšãã§ããŸãã 倧éšåã®å Žåãåå²äºæž¬åšãäºæž¬ã§ããªãããããã¹ã«ã¯åå²ããããŸããã
ã¿ã€ã ã¹ã¿ã³ãã¯æ¬¡ã®ããã«å§çž®ãããŸããæåã«ãã«ã¿ãã«ã¿ãšã³ã³ãŒãã£ã³ã°ãé©çšããïŒæåã®ãã«ã¿ãã«ãŠã³ãããã次ã«åãã«ã¿ããæå°èŠçŽ ãæžç®ãããŸãïŒãVByteãšã³ã³ãŒãã£ã³ã°ã䜿çšããŠãã¹ãŠå§çž®ãããŸãã VByteãšã³ã³ãŒãã¯ããããã³ã«ãããã¡ã§äœ¿çšããããšã³ã³ãŒããšäŒŒãŠããŸããããããåäœã®æäœãå¿ èŠãªããšããéãããããŸãããåäœã¯é«éã§ãã ããã¯ãã¿ã€ã ã¹ã¿ã³ãããã¢ã«çµåãããåãã¢ã®ã¡ã¿ããŒã¿ïŒå¶åŸ¡ãã€ãïŒã1ãã€ãã«æ ŒçŽããããšããäºå®ã«ããå®çŸãããŸãã
å€ãå§çž®ããã«ã¯ãå·®åæéã³ã³ããã¹ãã¡ãœããïŒDFCMïŒäºæž¬åã䜿çšããŠæ¬¡ã®å€ãäºæž¬ããããšããäºæž¬ã¢ã«ãŽãªãºã ã䜿çšãããŸãã
ããã«ãXOR-itã¢ã«ãŽãªãºã ã¯ããããèªäœã®äºæž¬å€ãšå®éã®å€ã§ãããçµæãšããŠãæ«å°ŸãŸãã¯å é ã«å€æ°ã®ãŒããå«ãŸãããããåã«ãªããŸãã ãã®ãããæååã¯æ¬¡ã®ããã«ãšã³ã³ãŒããããŸãã
- è¡ã®å é ãšæ«å°Ÿã®ãŒãã®æ°ãèæ ®ããŸããè¡ã®å é ã«ããã«ãŒããããå Žåã¯ãç¹å¥ãªãã©ã°ãèšå®ããŸãã
- ãã®ãããæååãæžã蟌ãããã«å¿ èŠãªãã€ãæ°ïŒNïŒãã«ãŠã³ãããŸãïŒãã©ã°ãèæ ®ããŠïŒã
- ãã©ã°ãèšå®ãããŠããå Žåããããæååãå·Šã«64-N * 8ãããã ãã·ããããŸãã
- ãããæååã®æåã®Nãã€ããåºåãããã¡ãŒã«æžã蟌ã¿ãŸãã
ãã®çµæãNãã€ãã®ããŒã¿ããããŸãããããã«å ããŠãã¡ã¿ããŒã¿ãä¿åããå¿ èŠããããŸã-å€Nãšãã©ã°ã¯4ãããã§ãã ã¹ããŒã¹ãç¯çŽããããã«ãå€ããã¢ã§çµã¿åãããŠãæåã«äž¡æ¹ã®å€ã®ã¡ã¿ããŒã¿ïŒå¶åŸ¡ãã€ãïŒã§ãã€ããæžã蟌ã¿ã次ã«å€èªäœãæžã蟌ã¿ãŸãã
ããã«ãå¥ã®ããªãã¯ã䜿çšãããŸãã ã䟿å©ãªãããŒã¿ãæ±ãå Žåããã®ã¢ã«ãŽãªãºã ã¯100ïŒ ã®ç²ŸåºŠã§æ¬¡ã®å€ãäºæž¬ã§ããŸãã ç£èŠã§ã¯ãããã¯éåžžã«äžè¬çã§ãããå€ã¯æéãšãšãã«å€åããªãããäžå®ã®å²åã§å¢å ããå ŽåããããŸãã ãã®å ŽåãXORã®åŸãåžžã«ãŒãå€ãååŸããŸãã ãããã®ãããããå®å šãªåãã€ãã§ãšã³ã³ãŒãããªãããã«ãã¢ã«ãŽãªãºã ã«ã¯ç¹å¥ãªã±ãŒã¹ããããŸã-16åãã¹ãŠã®å€ãäºæž¬ã§ããå Žåãç¹å¥ãªå¶åŸ¡ãã€ãã®ã¿ãæžã蟌ã¿ãŸãã ãã®å Žåãå€ã«è²»ãããŠããã®ã¯å°ãã§ãã 枬å®ã®ã¹ããããåºå®ãããŠããå Žåãã¿ã€ã ã¹ã¿ã³ãã«ãåæ§ã®ã·ã§ãŒãã«ãããå®è£ ãããŸãã
ãã®ã¢ã«ãŽãªãºã ã«ã¯åå²ããªãããã€ãå¢çã§æ©èœããŸãã ç§ã®æž¬å®ã§ã¯ãå§çž®çã¯çŽ1GB / sã§ãã
ã¹ãã¬ãŒãžãšã³ãžã³
åæç³»åã¯ãåå¥ã®ããŒã¿æ§é ãšããŠãã£ã¹ã¯ã«è¡šç€ºãããŸãã æ°å€B +ããªãŒãšåŒã³ãŸãããªããªã æ°å€ããŒã¿ãä¿åããããã®ãã®ã§ãããå®éã«ã¯ãã»ã°ã¡ã³ããB +ããªãŒã§ããLSMããªãŒã§ãã éåžžïŒå¿ ãããã§ã¯ãããŸãããïŒã»ã°ã¡ã³ãïŒSSTableïŒã¯ããœãŒããããé åãšããŠå®è£ ãããŸãã
ãã®LSMããªãŒã®MemTableããŒã«ã¯ãB +ããªãŒã®åäžã®èãå®è¡ããŸãã ããŒã¿ããã£ã±ãã«ãªããšã2çªç®ã®ã¬ãã«ã«ç§»åãã2ã€ã®ã¬ãã«ã§æ§æãããå¥ã®B +ããªãŒãåçŽã«çµåããŸãã ãã®ããªãŒããã£ã±ãã«ãªããšã3çªç®ã®ã¬ãã«ã«ç§»åãã3ã€ã®ã¬ãã«ãªã©ã§æ§æãããB +ããªãŒã«åå ããŸãã ãã®ããã»ã¹ã®è©³çŽ°ã瀺ããã¯ã€ãããŒããŒããããŸãã
ãã®ããŒã¿æ§é ã«ããã次ã®ããšãå¯èœã«ãªããŸãã
- ãã£ã¹ã¯å šäœããã»ã°ã¡ã³ããèªã¿åããã«ã»ã°ã¡ã³ããããŒãžããŸãïŒéåžžã®LSMããªãŒã®ããã«ïŒã Akumuliã¯ããã£ã¹ã¯ããããŒã¿ãèªã¿åã£ãŠæžã蟌ãããšã¯ãããŸããã ãã®ãããã§ãèªè ã¯èªãããã«ãã©ã€ãã®åž¯åå¹ ã䜿ãæããããšã«ãã£ãŠæžã蟌ã¿ããã»ã¹ãé ãããããšã¯ã§ããŸããã
- 1ã€ã®ãã¡ã€ã«ã«å€ãã®ç¬ç«ããããªãŒããããŸãã ç°ãªãããªãŒã®ããŒãã¯ããã£ã¹ã¯äžã«äºãã«ç¹åšããŠããã ãã§ãã ãã®ããããã£ã¹ã¯ãžã®æžã蟌ã¿ã¯åŒãç¶ãã·ãŒã±ã³ã·ã£ã«ã§ãã 1ã€ã®ã·ãªãŒãºãèªã¿åããšãã©ã³ãã ãªé åºã§ãã£ã¹ã¯ããããŒã¿ãéžæãããŸãããææ°ã®SSDã§ã¯ããã¯åé¡ã§ã¯ãããŸããã
- SSDããã³NVMeãã©ã€ãã®æé©åã ãã¹ãŠã®èªã¿åãããã³æžã蟌ã¿æäœã¯ããããã¯å¢çã«æããããŸãïŒããã«ãããæžã蟌ã¿ã®å¢å¹ ãæžå°ããŸãïŒã æžã蟌ã¿ãšèªã¿åãã®äž¡æ¹ã䞊è¡ããŠå®è¡ã§ããŸãïŒãããªãã§ã¯ãææ°ã®SSDã飜åãããããšã¯å°é£ã§ãïŒã ããŒã¿ããŒã¹ã¯ããã€ãã¢ãã¬ã¹å¯èœãªããã€ã¹ïŒIntel Optane SSDãªã©ïŒã«å¯Ÿå¿ããŠããŸãã ããŒã¿ãã¡ã¢ãªã«ãããããããã«çŽ°ããèªã¿æžãã§ããŸãã
- WALã䜿çšããã«çœå®³åŸ©æ§ãå®è¡ããŸãã ããã¯è€éãªåé¡ã§ããããã®è©³çŽ°ã¯èšäºã«èšèŒãããŠããŸãã ã€ãŸããAkumuliã¯WALã䜿çšãããããªãŒããŒãéã®è¿œå ãªã³ã¯ã䜿çšããŠé害ããå埩ããŸãã
- ãã«ãããŒãžã§ã³åæå®è¡å¶åŸ¡ã«ãããã¯ã©ã¹ãšããŠã®åæãšã©ãŒããªããªããŸãã ãŸããæžã蟌ã¿ãšèªã¿åãã¯äžŠè¡ããŠå®è¡ã§ãããªãŒããŒ/ã©ã€ã¿ãŒã¯äºãã«äŸåããŠããŸããã
ãã®ã¢ãããŒãã«ã¯æ¬ ç¹ããããŸãã
- ã¿ã€ã ã¹ã¿ã³ããå¢å ããé ã«ããŒã¿ãèšé²ããå¿ èŠããããŸãã
- èœäžãããšãæåŸã«èšé²ãããããŒã¿ãããšãã°æåŸã®5åéã®ç£èŠããŒã¿ã倱ãããå¯èœæ§ããããŸãã
é ããæ©ããããããã®åé¡ã¯è§£æ±ºãããŸããã解決ããããŸã§èæ ®ã«å ¥ããå¿ èŠããããŸãã
ãªã¯ãšã¹ãåŠç
PandasããŒã¿ãã¬ãŒã ã«äŒŒãæ©èœãååŸãããã£ãã®ã§ãã ãŸããããŒã¿ãä»»æã®é åºã§èªã¿åãã奜ããªããã«ã°ã«ãŒãåã§ããããã«ããããã«ãã¿ã€ã ã¹ã¿ã³ãã®æé ãŸãã¯ãã®éã§ããŸã1ã€ã®ã·ãªãŒãºã®ããŒã¿ââã次ã«æ¬¡ã®ããŒã¿ïŒã¯ãšãªã¯å€ãã®æç³»åãè¿ãããšãã§ããŸãïŒããŸãã¯æåã«1ã€ã®ã©ãã«ãæã€ãã¹ãŠã®ã·ãªãŒãºã®ããŒã¿æéããã®åŸã次ã®ã¿ã€ã ã¹ã¿ã³ããªã©ã䜿çšããŠãåãé åºã§ãã¹ãŠã®ã·ãªãŒãºã®ããŒã¿ ç§ã®çµéšã§ã¯ãã§ããããšãå¿ èŠã§ããããšã瀺ãããŠããŸãã èŠæ±ãããããŒã¿ã®ãµã€ãºã¯ã¯ã©ã€ã¢ã³ãã®RAMã®éãè¶ ããå¯èœæ§ããããåã«ããŒã«ã«ã§äžŠã¹æ¿ããããšã¯ã§ããŸããããããŒã¿ãæ£ããé åºã§å°çããå Žåã¯ãããããéšåçã«åŠçã§ããŸãã
ããã«ãè€æ°ã®ã·ãªãŒãºã1ã€ã«ããŒãžãããã€ã³ããåçŽã«çµåããããè€æ°ã®ã¿ã€ã ã·ãªãŒãºãã¿ã€ã ã¹ã¿ã³ãã§çµåããã·ãªãŒãºããŒã¿ïŒæå°ãæ倧ãå¹³åãªã©ïŒãéèšããã¹ãããã§éèšïŒãªãµã³ãã«ïŒããããããçš®é¡ã®é¢æ°ãèšç®ã§ããããã«ãããã£ãïŒã¬ãŒããabsãªã©ïŒã
ã¯ãšãªããã»ããµã¯ãçŸåšã®åœ¢åŒã§ã¯éå±€æ§é ã«ãªã£ãŠããŸãã äžäœã¬ãã«ã§ã¯ãæŒç®åãæ©èœããŸããæŒç®åã¯åžžã«ã1ã€ã®æç³»åã«å¯Ÿå¿ãã1ã€ã®ããªãŒã«æ ŒçŽãããŠãã1ã€ã®åã®ããŒã¿ãåŠçããŸãã æŒç®åã¯äžçš®ã®å埩åã§ãã ãããã¯ã¹ãã¬ãŒãžã¬ãã«ã§å®è£ ããããã®æ©èœã䜿çšã§ããŸãã ã€ãã¬ãŒã¿ãŒãšã¯ç°ãªããããŒã¿ããŒã¹ãªãã¬ãŒã¿ãŒã¯ããŒã¿ã®èªã¿åãã ãã§ãªããéèšãšãã£ã«ã¿ãŒåŠçãã§ãããããã®æäœã¯å§çž®ããŒã¿ã«å¯ŸããŠå®è¡ã§ããŸãïŒåžžã«ã§ã¯ãããŸããïŒã
ãªãã¬ãŒã¿ã¯ããã£ã¹ã¯ããèªã¿èŸŒãããšãªããããªãŒã®äžéšãã¹ãããïŒãã«ãŒãã³ã°ïŒã§ããŸãã ããšãã°ãã¯ãšãªãããŠã³ãµã³ãã«å€æãªãã§ããŒã¿ãèªã¿åãå Žåãã¹ãã£ã³ã¹ããŒãã¡ã³ãã䜿çšããããã®ãŸãŸããŒã¿ãè¿ãããŸãããã¯ãšãªãä»»æã®ã¹ãããã§ã°ã«ãŒãéçŽãå®è¡ããå Žåããã£ã¹ã¯ãããã¹ãŠãèªã¿åããã«ããŠã³ãµã³ããªã³ã°ãå®è¡ã§ããå¥ã®æŒç®åã䜿çšãããŸãã
次ã®ã¹ãããã¯ãã¯ãšãªçµæã®å ·äœåã§ãïŒAkumuliã¯åæã®å ·äœåã®ã¿ãå®è¡ããŸãïŒã ãªãã¬ãŒã¿ãŒãè¿ãããŒã¿ãããã¿ãã«ã圢æãããèšç»ã®åºæ¬æäœïŒçµåãªã©ïŒããããªã¢ã©ã€ãºãããããŒã¿ã«å¯ŸããŠæ¢ã«å®è¡ãããŸãã ãã¹ãŠã®çš®é¡ã®æ©èœãããã§å®è¡ãããŸãïŒããšãã°ãé床ïŒã
ãã¹ãŠã®åŠçã¯æ zyãªæ¹æ³ã§è¡ãããŸãã æåã«ãèŠæ±ãã³ãã©ãŒããªãã¬ãŒã¿ãŒã®ãã€ãã©ã€ã³ã圢æãã次ã«ããŒã¿ããããä»ããŠå®è¡ãããŸãã ããŒã¿ã®èªã¿åããšåŠçã®é床ã¯ãã¯ã©ã€ã¢ã³ããããŒã¿ãèªã¿åãé床ã«äŸåããŸãã ã¯ãšãªçµæã®äžéšãèªã¿åã£ãŠåæ¢ãããšããµãŒããŒã§ã®ã¯ãšãªã®å®è¡ãåæ¢ããŸãã å®éã«ã¯ãããã¯ã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ãã¹ããªãŒãã³ã°ã¢ãŒãã§ããŒã¿ãåŠçã§ããããšãæå³ãããã®ããŒã¿ãã¯ã©ã€ã¢ã³ããŸãã¯ãµãŒããŒã®RAMã«é 眮ããå¿ èŠã¯ãããŸããã
ãã¹ã
ãã®ãããžã§ã¯ãã§æãèå³æ·±ãã®ã¯ãã¹ãã§ãã ãã¹ãã¯CIãµãŒããŒã§èªåçã«è¡ãããŸãïŒç§ã¯Travis-CIã䜿çšããŠããŸãïŒã ãããžã§ã¯ãã§ã¯æ¬¡ã®ã¿ã€ãã®ãã¹ãã䜿çšãããŸãã
- æåã®ã¹ãããã¯åäœãã¹ãã§ãã åäœãã¹ãã¯çŽ1ã2åã§åäœãããã£ã¹ã¯ã«è§Šããªããããéåžžã«è¿ éã«åäœããŸãã ååž°ãèŠã€ããããšã¯ãã£ãã«ãããŸããããååž°ãè¡ããšãåé¡ã®å Žæã«é¢ããæãå€ãã®æ å ±ãæäŸããŸãã
- çµ±åãã¹ãã ãã®ã¢ããªã±ãŒã·ã§ã³ã¯ãã¹ãã¬ãŒãžã·ã¹ãã ãå®è£ ããã©ã€ãã©ãªã§ããlibakumuliã䜿çšããŸãã å°éã®ããŒã¿ã䜿çšããç°¡åãªãã¹ããå€æ°å«ãŸããŠããŸãã ãã¹ãã®ã¿ã¹ã¯ã¯ãå¥çŽãç ŽãããŠããªãããšã確èªããããšã§ãã ã©ã€ãã©ãªAPIé¢æ°ã®åäœã¯å€æŽãããŠããŸããã
- æ©èœãã¹ãã ãããã®ãã¹ãïŒ20以äžãããŸãïŒã¯pythonã§èšè¿°ãããŠãããæé«ã¬ãã«ã§åäœããŸãã åãã¹ãã¯ãæ°ããããŒã¿ããŒã¹ãäœæããããŒã¿ããŒã¹ãµãŒããŒãèµ·åããŠäœããå®è¡ããåå¥ã®ã¹ã¯ãªããã§ãã ããšãã°ãåã«ããŒã¿ãèšé²ãããã¹ãŠãèšé²ãããããšã確èªãããã¹ãããã¹ãŠã®å¯èœãªã¯ãšãªãªãã·ã§ã³ã確èªãããã¹ããã¯ã©ãã·ã¥ãªã«ããªã確èªããããã«kill -9ãä»ããŠããŒã¿ããŒã¹ãµãŒããŒã匷å¶çµäºãããã¹ããªã©ããããŸãã ãããã¯ãã»ãšãã©ã®åé¡ãèŠã€ããæãéèŠãªãã¹ãã§ãã éåžžãããã«ååž°ãè¿œå ããŸã-ãã§ã«ä¿®æ£ãããåé¡ããã§ãã¯ãããã¹ãã
- åŸåŸ©ãã¹ãã ããã¯ãäžèŠåçŽãªãã¹ãã§ãããå®å šã«bashã§èšè¿°ãããŠããŸãã S2ããããã«æžã蟌ãã圢åŒã§S2ããæ°çŸMBã®ãã¹ãããŒã¿ãããŠã³ããŒãããããŒã¿ããŒã¹ãäœæããããŒã¿ããŒã¹ãµãŒããŒãèµ·åããŠããã¹ãããŒã¿ãæžã蟌ã¿ãŸãã次ã«ããã¹ãããŒã¿ãšãŸã£ããåã圢åŒã§èšé²ããããã¹ãŠã®ããŒã¿ãçºè¡ããçµåèŠæ±ãçæããŸãã ãã¹ãŠãããŸããã£ãå Žåãäž¡æ¹ã®ãã¡ã€ã«ã¯åäžã§ããããã¹ãã¯æåããŸããã ããã¯ã2ã€ã®å ¥åããŒã¿åœ¢åŒïŒRESPããã³OpenTSDBïŒã«å¯ŸããŠ2åè¡ãããŸãã
- ãã¡ãºãã¹ãã ãããã®ãã¹ãã¯æåã§å®è¡ãããŸãã ã¿ã€ã ã¹ã¿ã³ããæç³»ååã解æããã³ãŒããªã©ãå ¥åã解æããå§çž®ã¢ã«ãŽãªãºã ãšã³ãŒãããã§ãã¯ããŸãã ãã«ãªã¯ãšã¹ãããããã®ã³ãŒãã»ã¯ã·ã§ã³ã®1ã€ã«åœ±é¿ããå ŽåãAWSã§ç¹å¥ã«äœæãããEC2ã€ã³ã¹ã¿ã³ã¹ã§æ°æ¥éãé©åãªãã¹ãã§AFLãå®è¡ããŸãã ç®ãèŠåŒµããããªäœéšïŒ
- ã©ã³ãã åããããã¹ãã æãå¥åŠãªçš®é¡ã®ãã¹ãã å Žåã«ãã£ãŠã¯ãéåžžã«äœã確çã§äœããè¡ãç¹å¥ãªã³ãŒããè¿œå ããŸãã ããšãã°ããã£ã¹ã¯ããããŒã¿ãèªã¿åãããšãããšãšã©ãŒãçºçããå®éã«çºçãããŸã§åŸ æ©ããŸããã æè¿ã®ãã®ãããã·ã£ããŠããŒãžã䜿çšããŠéå»ã®ããŒã¿ã®å€æŽã«åãçµã¿ãéå»ãžã®æžã蟌ã¿ãäœãå£ããªãããšã確èªããããã«ãéå»ãžã®æžã蟌ã¿ã®æé ãäœãå€æŽããã«è¡ãã®ãšåãããšãè¡ãã³ãŒããè¿œå ããŸããã ãã®ã³ãŒãã¯ãäœã確çã§äœæ¥ããããã»ã¹ã§åŒã³åºãããæç³»åã®ã©ã³ãã ãªãã€ã³ãã«é©çšãããŸããã ãããã®å€æŽãå«ãããŒã¿ããŒã¹ãåéããåŸãAWSã€ã³ã¹ã¿ã³ã¹ã§äœããèœã¡ããŸã§äœæéãçµ±åãã¹ããè¡ãããšã©ãŒãä¿®æ£ããŠããšã©ãŒã衚瀺ãããªããªããŸã§ããçŽããŸããã åœç¶ãããã¯CIãµãŒããŒã§ã¯å®è¡ãããŸãããããã«ã誀ã£ãŠãã¹ã¿ãŒã«ãªããªãããã«ããã®ãããªã³ãŒãã¯åžžã«åé€ããŸãã
ãã³ãããŒã¯
éåžžãAkumuliã¯åã³ã¢ã§1ç§ãããçŽ50äžã®æžã蟌ã¿æäœãå®è¡ã§ããŸãã ããªãã¡ ãã¥ã¢ã«ã³ã¢ãã·ã³ã§ã¯çŽ1Mã4x-2Mãªã©ã«ãªããŸãã ãã®èšäºã§ã¯ã32åã®æ žæ©æ¢°ã§ã®ãã¹ãããã»ã¹ã«ã€ããŠèª¬æããŸãããããã«ããã1ç§ãããçŽ1600äžã®æžã蟌ã¿æäœãçºçããŸããã ãã®ãããªè² è·ãäœæããã«ã¯ã4å°ã®ãã·ã³ãå¿ èŠã§ããïŒm3.xlargeã€ã³ã¹ã¿ã³ã¹ïŒã ãã¹ãããŒã¿ã¯äºåââã«æºåãããŸããïŒå®éã®ã³ã¬ã¯ã¿ãŒãRESP圢åŒã§16GBãå§çž®åœ¢åŒã§çæãããã®ã«å¯èœãªéãè¿ãããïŒã ãªã³ã¶ãã©ã€ã§çæããã«ã¯ãããã«å€ãã®ã³ã³ãã¥ãŒãã£ã³ã°ãªãœãŒã¹ãå¿ èŠã«ãªããŸãã ç§ã¯ãã¹ãŠã®ãã·ã³ã§äžŠåSSHãåæã«å®è¡ãã3å以å ã«ãã¹ãŠãèšé²ãããŸããã ãã¹ãäžãããŒã¿ããŒã¹ã¯64MB / sã®é床ã§ãã£ã¹ã¯ã«æžã蟌ã¿ãŸããã
ããã§èªæžé床ããã¹ãããŸãã ã ããã«ããããŒã¿ããªã¥ãŒã ã¯éåžžã«å°ããããã¹ãŠãã¡ã¢ãªã«åãŸããŸããããã¹ããéå§ããåã«ãããŒã¿ããŒã¹ãµãŒããŒãåèµ·åãããã£ã¹ã¯ãã£ãã·ã¥ãã¯ãªã¢ããŸããã 倧éã®ããŒã¿ããããããŒã¿ããŒã¹ãžã®ã¢ã¯ãã£ããªæžã蟌ã¿ãããå ŽåãAkumuliã¯éåžžã«ããŸãåäœããã¯ãã§ãã
ä»åŸã®èšç»
ç§ã¯çŸåšãéå»ã«æžãåé¡ã®è§£æ±ºã«åãçµãã§ããŸãã ããã¯ãããŒã¿è€è£œãšHAãå®è£ ã§ããããã«ããããã«å¿ èŠã§ãã ã·ã£ããŠããŒãžã«åºã¥ããå®è£ ãæ¢ã«1ã€ãããŸãããçŸåšã¯WALã䜿çšãã代æ¿ã«åãçµãã§ããŸãã ãããã®2ã€ã®ãªãã·ã§ã³ã®ããããããã¹ã¿ãŒã«ãªããšæããŸãããããã«ã¯çºçããŸããã æ·±å»ãªãã¹ããšããŒããŠã§ã¢ãå¿ èŠã§ãããããŒããŠã§ã¢ã«ã€ããŠã¯ãŠã«ãã©ããã¯ããæã£ãŠããªãã®ã§ãAWS ES2ããã«ã¡ã¯ã
éçºã®å¥ã®é åã¯ãããããçš®é¡ã®çµ±åãšããŒã«ã§ãã OpenTSDBãããã³ã«ã®ãµããŒããå®è£ ããŸãããçŸåšãAkumuliã¯collectdãªã©ã®å€ãã®ã³ã¬ã¯ã¿ãŒã§äœ¿çšã§ããŸãã Grafanaçšã®ãã©ã°ã€ã³ããããŸããããã¯ããã©ã°ã€ã³ã¹ãã¢ã«è¿œå ãããã®ãåŸ ã£ãŠããŸãã RedashãèŠãŠããŸããããããå¿ èŠãã©ããã¯ãŸã ããããŸããã
Akumuliã¯ãApache 2.0ã©ã€ã»ã³ã¹ã§å ¬éãããŠãããªãŒãã³ãœãŒã¹ãããžã§ã¯ãã§ãã ããã§ãœãŒã¹ã³ãŒããèŠã€ããããšãã§ããŸãã ããã§ã¯ãææ°ã®å®å®ãã«ãã§dockerã³ã³ãããŒã䜿çšã§ããŸããããã¯ãgraphansã®ãã©ã°ã€ã³ã§ãã ãã®ãããžã§ã¯ãã¯ããã«ãªã¯ãšã¹ããŸãã¯ãã°ã¬ããŒããéä¿¡ããããšã§æ¯æŽã§ããŸãã