ä»æ¥ã¯ãã¹ããªãŒãã³ã°ããŒã¿åŠçã䜿çšããŠãã¬ã³ã¡ã³ããŒã·ã§ã³ã®å質ãåäžãããã¬ã³ã¡ã³ããŒã·ã§ã³ã·ã¹ãã å šäœã®å¿çæéã5åççž®ããæ¹æ³ã«ã€ããŠèª¬æããŸãã ããã¯ã顧客ã®1人ã§ããRutubeãããªã¹ããªãŒãã³ã°ãµãŒãã¹ã§ãã
æåã«ãRutubeèªäœã«ã€ããŠã®ããã€ãã®èšèãšããããæšå¥šäºé ãå¿ èŠãšããçç±ã ãŸããå·çæç¹ã§ãåœç€Ÿã®æšå¥šã·ã¹ãã ã¯ã51.76çŸäžã®ãŠãŒã¶ãŒãš126äžã®ã¢ã€ãã ãã€ãŸããããªã«é¢ããããŒã¿ãä¿åããŠããŸãã åœç¶ãè¿ãå°æ¥ããã¹ãŠã®ãããªãèŠèŽã§ãããŠãŒã¶ãŒã¯ããªããªããŸãã æšèŠã·ã¹ãã ã圌ã®å©ãã«ãªããŸãã 第äºã«ãRutubeã¯åºåã衚瀺ããããšã§ãéã皌ããŸãã äŒç€Ÿã®äž»èŠãªããžãã¹ææšã®1ã€ã¯ããµã€ãã§ãŠãŒã¶ãŒãè²»ãããæéã§ãã Rutubeã¯ãã®ã¬ãŒããæ倧åããŸãã æšå¥šã·ã¹ãã ã¯ãããè¡ãã®ã«åœ¹ç«ã¡ãŸãã ãããŠç¬¬äžã«ãRutubeèªäœã®æ©èœã§ãã ã³ã³ãã³ãã®äžéšã¯åçšãããªã®èäœæš©ææè ã§ãã ããšãã°ãTNTã«ã¯ç¬èªã®ãã£ãã«ããããããã°ã©ã ã®åé¡ãå®æçã«æçš¿ããŠããŸãã ãHouse-2ããŸãã¯ãDancesãã®æ°åãåºããšã人ã ã¯æ¥ãã§ããããèŠãŸãã ãããªã¯æ¬è³ªçã«ãã€ã©ã«ã§ãã æšå¥šã·ã¹ãã ã¯ããã®ãããªãããªã远跡ããŠä»ã®ãŠãŒã¶ãŒã«è¡šç€ºããã®ã«åœ¹ç«ã¡ãŸãã
æã£ãŠãããã®
2015幎5æã«E-Contentaã§Rutubeã®æšå¥šã·ã¹ãã ã®æåã®ããŒãžã§ã³ãäœæããŸãããããã¯ã次ã®é ç®ã§æ§æãããŸãããnåããšã«æšå¥šãåèšç®ããã¢ã€ãã ããŒã¹ã®å調ãã£ã«ã¿ãªã³ã°ïŒ nã¯ãã£ããããæ°åã®æ°ïŒ ã€ãŸããåãããªã®èŠèŽã¯ã€ãã³ãã§ããããã®ã€ãã³ãã®ã·ãŒã±ã³ã¹çªå·ããã£ããããã·ãªãŒãºã«å«ãŸããŠããå Žåããã®ãããªãšä»ã®ãããªã®è¿æ¥åºŠãåèšç®ããŸããã ããã¯ã Tornado + Celery ïŒãããŒã«ãŒã¯RabbitMQ ïŒ+ MongoDBã®ã¹ã¿ãã¯ã䜿çšããŠå®è£ ãããŸããã ã€ãŸããããŒã¿ã¯Tornadoã«éãããããããCeleryãããªãã·ã£ãŒãä»ããŠRabbitMQã«éãããããããCeleryã³ã³ã·ã¥ãŒããŒãä»ããŠåŠçãããMongoDBã«éä¿¡ãããŸããã 1ç§ä»¥å ïŒSLAïŒã«ãŠãŒã¶ãŒã®æšå¥šãªã¯ãšã¹ãã«å¿çããå¿ èŠããããŸãã
åé¡
æåã¯ãã·ã¹ãã ã¯ããŸãæ©èœããŸãããã€ãã³ãã®ã¹ããªãŒã ãååŸããŠåŠçããæšå¥šäºé ãèšç®ããŸããã ããããããã«æ¬¡ã®åé¡ãæããã«ãªããŸããã
ãŸããæè¡çãªåé¡ã 人æ°ã®ãããããªã«å¯Ÿããæšå¥šã®åèšç®ã¯ãã·ã¹ãã å šäœããã¬ã€ã¢ãŠããããŸããã Mongoããã®èšå€§ãªæ°ã®ã€ãã³ãããã¹ãŠã®RAMãè©°ãŸãããããããã¹ãŠã®ã€ãã³ããåŠçãããšãã¹ãŠã®ã³ã¢ãè©°ãŸããŸããã ãã®ãããªå Žåããã§ã«èšç®ãããæšå¥šäºé ãè¿éããããSLAã«éåããŠæ°ããæšå¥šäºé ãåéèšãããããããšã¯ã§ããŸããã
第äºã«ãããžãã¹äžã®åé¡ã ãã£ããããã·ãªãŒãºã«å±ããiåããšã«æšå¥šäºé ãæ°ããã ãã§ããã€ã©ã«ãããªãããã«è¿œè·¡ã§ããŸããã§ããã ãããã圌ã«çãããšããã€ãã³ãã®æ°ãå¢ãç¶ããªãããå®å šãªåéèšãè¡ããã³ã«ãæéãšãªãœãŒã¹ãããããããŸããã
第äžã«ãæé»çãªãã£ãŒãããã¯åé¡ãšåŒã°ããã¢ã«ãŽãªãºã ã®åââé¡ã æšå¥šã·ã¹ãã ã¯ãè©äŸ¡ãŸãã¯è©äŸ¡ã«åºã¥ããŠããŸãã ãããªãã¥ãŒã®ã¿ãåéããŸãããã€ãŸããå®éã«ã¯ãè©äŸ¡ã·ã¹ãã ã¯ãã€ããªã§ããã1-ãããªãèŠèŽãã0-èŠèŽããŸããã§ããã
解決ç
解決çãšããŠãå®å šãªãªã¢ã«ã¿ã€ã ãžã®ç§»è¡ãææ¡ãããŸãããããã®ããã«ã¯ãªãœãŒã¹ã®èŠ³ç¹ããå®äŸ¡ãªã¢ã«ãŽãªãºã ãšãåæã«å¹ççãªã¢ã«ãŽãªãºã ãå¿ èŠã§ããã äž»ãªã€ã³ã¹ãã¬ãŒã·ã§ã³ã¯ã Tencentãçºè¡ããèšäºã§ãã ã æ°ããæšå¥šãšã³ãžã³ã®åºç€ãšããŠã圌ãã説æããã¢ã«ãŽãªãºã ã説æããŸããã
ã¢ã«ãŽãªãºã ïŒããŒãœãã©ã€ãºãããæšå¥šäºé
æ°ããã¢ã«ãŽãªãºã ã¯ãå€å žçãªã¢ã€ãã ããŒã¹ã®CFã§ãããè§åºŠäœåŒŠãè¿æ¥æ§ã®å°ºåºŠãšããŠäœ¿çšãããŸããã
æ°åŒã泚ææ·±ãèŠããšãååã®å ±åè©äŸ¡ã®åèšãšåæ¯ã®è©äŸ¡ã®2ã€ã®å¹³æ¹åã®3ã€ã®åèšã§æ§æãããŠããããšãããããŸãã ããããããåçŽãªæŠå¿µã«çœ®ãæãããšã次ã®ãã®ãåŸãããŸãã
ã§ã¯ãæ°ããã€ãã³ãïŒæ°ããè©äŸ¡ïŒãåãåã£ããšãã«æšå¥šäºé ãåèšç®ãããšã©ããªãããèããŠã¿ãŸãããã ããïŒ åãåã£ãå€ã ãéé¡ãå¢ãããŸãã ãããã£ãŠãè¿æ¥åºŠã®æ°ãã尺床ã¯æ¬¡ã®ããã«è¡šãããšãã§ããŸãã
ããã¯éåžžã«éèŠãªçµè«ã«ã€ãªãããŸãã æ¯åãã¹ãŠã®éé¡ãåéèšããå¿ èŠã¯ãããŸããã ããããä¿åããæ°ããå€ããšã«å¢ããã ãã§ååã§ãã ãã®ååã¯å¢åæŽæ°ãšåŒã°ããŸãã 圌ã®ãããã§ãæšå¥šäºé ãåèšç®ãããšãã®è² è·ãå€§å¹ ã«åæžããããªã¢ã«ã¿ã€ã åŠçã§ãã®ãããªã¢ã«ãŽãªãºã ã䜿çšããããšãå¯èœã«ãªããŸãã
åãèšäºã§ã¯ãæé»çãªãã£ãŒãããã¯ã®åé¡ã«å¯Ÿãã解決çãææ¡ãããŸããããããªãèŠãŠãããšãã®ç¹å®ã®ãŠãŒã¶ãŒã¢ã¯ã·ã§ã³ãè©äŸ¡ããããšã§ãã ããšãã°ãèŠèŽã®éå§ãäžéãŸãã¯çµäºãŸã§ã®èŠèŽãäžæåæ¢ãå·»ãæ»ããªã©ãåå¥ã«è©äŸ¡ããŸãã éã¿ã®èšå®æ¹æ³ã¯æ¬¡ã®ãšããã§ãã
ACTION_WEIGHTS = { "thirdQuartile": 0.75, "complete": 1.0, "firstQuartile": 0.25, "exitFullscreen": 0.1, "fullscreen": 0.1, "midpoint": 0.5, "resume": 0.2, "rewind": 0.2, "pause": 0.05, "start": 0.2 }
1ã€ã®ãããªã§è€æ°ã®ãŠãŒã¶ãŒã¢ã¯ã·ã§ã³ãè¡ããšãæ倧è©äŸ¡ãååŸãããŸãã
ã¢ã«ãŽãªãºã ïŒäººæ°ã®åç»
ãŸããä»ã§ã¯äººæ°ã®ããïŒãã¬ã³ãã®ïŒãããªãèæ ®ããŠããŸãã åãããªã«ã¯ã«ãŠã³ã¿ããããããã«é¢é£ä»ããããã€ãã³ããåä¿¡ãããšã1ãã€å¢å ããŸãã æã人æ°ã®ããåç»ã¯äžäœ20äœã§ãã æ°ããã€ãã³ããå°çãããã³ã«ããããªãããã20ã«ãããã©ããã確èªããŸããããã§ãªãå Žåã¯ãããã20ã®ãã¹ãŠã®ãããªã®ã«ãŠã³ã¿ãŒã1ãã€æžå°ããŸãããããã£ãŠãããªãåçãªãªã¹ããååŸããããŠã€ã«ã¹ãããªãç°¡åã«è¿œè·¡ã§ããŸãã å°åããšã«ãã®ãããªãªã¹ããç¶æããŠããŸãã ã€ãŸããããŸããŸãªå°åã®ãŠãŒã¶ãŒã«ããŸããŸãªäººæ°ã®ããåç»ããå§ãããŸãã
ãŠãŒã¶ãŒã«æšå¥šäºé ãèŠæ±ããå Žåãåé¡ã¯å人çãªæšå¥šäºé ã®85ïŒ ãšäººæ°ã®ãããããªã®15ïŒ ã§æ§æãããŸãã
ãã¯ãããžãŒ
ã¢ã«ãŽãªãºã ã決å®ããŸããã次ã«ããããå®è£ ã§ãããã¯ãããžãŒãéžæããå¿ èŠããããŸãã ã¹ããªãŒã åŠçã§èŠã€ãã£ããã¹ãŠã®ã±ãŒã¹ãèŠçŽãããšã䜿çšããããã¯ãããžãŒã®ã¹ã¿ãã¯ã¯æ¬¡ã®ããã«ãªããŸãã
ã€ãŸãããã¹ãŠã®ã€ãã³ããã¡ãã»ãŒãžãããŒã«ãŒã«éä¿¡ããã¹ããªãŒã åŠçãšã³ãžã³ã§ãããã䞊è¡ããŠåŠçããçµæãããŒå€ããŒã¿ããŒã¹ã«è¿œå ããŸãããããããªã¯ãšã¹ãã®åä¿¡æã«èªã¿åããŸãã åã¢ã€ãã ã«ç¹å®ã®ãªãã·ã§ã³ãéžæããããšã¯æ®ã£ãŠããŸãã
ãã§ã«RabbitMQããããéåžžã«æºè¶³ããŠããŸãã ãã ããã»ãšãã©ã®ã¹ããªãŒãã³ã°ãšã³ãžã³ã¯ããã¯ã¹ããã®KafkaããµããŒãããŠããŸãã ç¹ã«æè¿ãKafkaã倧ããªå¢ããç²åŸããããèªäœãååã«èšŒæãããäžè¬çã«ã¯ããªãæ®éçã§ä¿¡é Œã§ããããŒã«ã§ãããšèŠãªãããŠããããã移è¡ã«ãŸã£ããå察ããŸããã§ããã
ã¹ããªãŒãã³ã°ãšã³ãžã³ãšããŠã3ã€ã®ãªãã·ã§ã³ãã¹ãŠãæ€èšããŸããã ãã ããããã«1ã€ã®å¶éãå°å ¥ãããŸããããã¹ãŠã®ã³ãŒãã¯Pythonã§ã®ã¿èšè¿°ããå¿ èŠããããŸãã ç§ãã¡ã®ããŒã ã®ãã¹ãŠã®ã¡ã³ããŒã¯åœŒãããç¥ã£ãŠããŸãããPythonã«ã¯å¿ èŠãªãã¹ãŠã®ã©ã€ãã©ãªããããããã«ãªãã£ãã©ã€ãã©ãªã¯èªåã§æžããŸããã ãããã£ãŠãSamzaã¯Javaã®ã¿ããµããŒããããããããã«åé€ãããŸããã æåã¯Stormãè©ŠããŠã¿ããã£ãã®ã§ãããããã¥ã¡ã³ããæãäžããåŸãã³ãŒãã®äžéšïŒããããžïŒã¯Javaã§èšè¿°ãããåŠçããŒãïŒãã«ãïŒã®ã³ãŒãã®ã¿ãPythonã§èšè¿°ã§ããããšãããããŸããã åŸã«ã streamparseãšåŒã°ããStormã®çŸããPythonã©ãããŒãçºèŠããŸããã Pythonã§Stormãå®å šã«å¿ èŠãšããŠãã人ã¯ããå§ãããŸãïŒ ãã®çµæãéžæã¯Sparkã«èœã¡çããŸããã ãŸããç§ãã¡ã¯ãã§ã«åœŒãç¥ã£ãŠããŸããã 次ã«ãPythonãå®å šã«ãµããŒãããŸããã ãããŠç¬¬äžã«ã圌ããçŸåšã©ã®ãããæ¥éã«çºå±ããŠããã®ããæ¬åœã«å°è±¡çã§ãã
ããŒã¿ããŒã¹ã®éžæã¯ããã«è¡ãããŸããã ããããã«çµéšãããã«ããããããããæ°ã«å ¥ãããããŸãã ããã¯ãšã¢ãã¹ãã€ã¯ã§ãã Aerospikeã¯ãSSDãã©ã€ããåãããµãŒããŒã§ãã®å¯èœæ§ãæ倧éã«åŒãåºããŸãã Linuxãã¡ã€ã«ã·ã¹ãã ããã€ãã¹ããSSDã«åå¥ã®ãããã¯ã§çŽæ¥æžã蟌ã¿ãŸãã ãã®ããã1ã€ã®ããŒãã§100äžTPSã®ããã©ãŒãã³ã¹ãéæãããèŠæ±ã®99ïŒ ã®å¿çæéã¯1ããªç§æªæºã§ãã ç§ãã¡ã¯ãããè€æ°å䜿çšããŠãããæçã¯ããªãäžæã§ãïŒãã ããæçããããšã¯ããŸããããŸãããïŒã
ãã®çµæãã¹ã¿ãã¯ã¯æ¬¡ã®ããã«ãªããŸãã
ã¹ããŒã ãšã¹ããŒã¯ã®éžæã«ã€ããŠã®ããå°ãã®èšèãããã¯çªç¶ããã誰ãã®ããã«åœ¹ç«ã€ã§ãããã
Sparkã¹ããªãŒãã³ã°ã¯ãªã¢ã«ã¿ã€ã ãšã³ãžã³ã§ã¯ãªãããããããåŠçã䜿çšãããããããªããªã¢ã«ã¿ã€ã ã«è¿ããšã³ãžã³ã§ãã ã€ãŸããããŒã¿ã¹ããªãŒã ã¯ãæå®ãããç§æ°ã®ãµã€ãºã®ãããããã«åå²ããã䞊ååŠçãããŸãã Sparkã®æŠå¿µã«ç²ŸéããŠãã人ã«ãšã£ãŠããããããã¯RDDã«ä»ãªããŸããã Stormã¯ãªã¢ã«ã¿ã€ã ã§ãã çä¿¡ã€ãã³ãã¯ããã«åŠçãããŸãïŒãã ããStormã¯Tridentã䜿çšããŠãããããåŠçããããã«æ§æããããšãã§ããŸãïŒã èŠçŽãããšãStormã¯åŸ ã¡æéãçããSparkã¯ã¹ã«ãŒããããé«ããªããŸãã ã¬ã€ãã³ã·ã«å³ããå¶éãããå Žåã¯ãStormãéžæããå¿ èŠããããŸãã ããšãã°ãã»ãã¥ãªãã£ã¢ããªã±ãŒã·ã§ã³çšã ããã§ãªããã°ãSparkã§ååã§ãã éçšç°å¢ã§1ãæ以äžäœ¿çšããŠãããã¯ã©ã¹ã¿ãŒãé©åã«èª¿æŽããŠæèšã®ããã«æ©èœããŸãã Sparkã¯ãããã©ãŒã«ããã¬ã©ã³ãã§ãããšããæèŠããããŸãã ãã ããç§ãã¡ã®æèŠã§ã¯ãè£è¶³ããå¿ èŠããããŸã; Sparkã¯ãããã«äœ¿çšã§ãããã©ãŒã«ããã¬ã©ã³ãã§ãã ååãªæ¬²æãšã¹ãã«ã§ãStormã¯ãã®ãããªã¬ãã«ã«æã£ãŠããããšãã§ããŸãã
çµæ
ãããŠæãéèŠãªããšã§ãã ããã¯ãã¹ãŠçã«ããªã£ãŠããŸããïŒ æã£ãŠãã æšå¥šäºé ã®å質ããå§ããŸãããã ãªã³ã©ã€ã³å質ææšã䜿çšããŸããããã¯ããŠãŒã¶ãŒãå®éã«èŠèŽãããããªããåœç€Ÿãæšå¥šãããªã¹ãã«å«ãŸããŠãããã©ãããããã³ãã®å Žæã枬å®ããŸãã é åžã¯æ¬¡ã®ãšããã§ãã
å人çãªæšå¥šäºé ã®ã¿ïŒitem-item CFïŒïŒ
人æ°ã®ããã¢ã€ãã ã®ã¿ïŒãã¬ã³ãïŒïŒ
ãã€ããªããã®æšå¥šäºé ïŒ85ïŒ ã®ã¢ã€ãã -ã¢ã€ãã CFããã³15ïŒ ã®ãã¬ã³ãïŒïŒ
ããã¯ãã¡ããªãã¯ãæ倧ã§ãããããæ¬çªç°å¢ã§äœ¿çšããæåŸã®ãªãã·ã§ã³ã§ãã ã€ãŸãããŠãŒã¶ãŒãèŠèŽããåç»ã®çŽ10ïŒ ãããããããå§ãã§ãïŒ çŽ36ïŒ ãããã100ã«å ¥ã£ãŠããŸãããããã®æ°å€ããäœãããããªãå Žåã¯ã人æ°ã®ããåç»ã®ååžã確èªã§ããŸãã 人æ°ã®ããåç»ã®ã¿ããŠãŒã¶ãŒã«æšå¥šããå ŽåããŠãŒã¶ãŒãèŠèŽãããã¹ãŠã®åç»ã®0.1ïŒ ã ããæšæž¬ããŸãã ããã¯ããããªãæšæž¬ãã確çã1 /ïŒ126äžïŒã§ããã©ã³ãã ååžãšæ¯èŒããå Žåã«ãåªããŠããŸãã
æ確ã«ããããã«ã以äžã«ã¡ããªãã¯ã®ã°ã©ãã瀺ããŸãã
14:00ãã15:30ãŸã§ã®12.02ã®éšåãæãäºæããªãïŒèµ€ïŒã¯ããã¬ã³ãé ç®ã®ã¿ã§æšå¥šäºé ããã¹ãããã ãã§ãã ãã®å-ã¢ã€ãã -ã¢ã€ãã CFããããŠãã®åŸ-ãã€ããªããã¢ãã«ã ã芧ã®ãšãããããªã¢ã«ã¿ã€ã ãã®ãããã§ãåœç€Ÿã®æšå¥šã·ã¹ãã ã¯æ°ããæ§æã«ãã°ããé©å¿ããŸãã ã¡ãªã¿ã«ãã·ã¹ãã ãæåããèµ·åãããšãäžèšã®ã€ã³ãžã±ãŒã¿ã«30åé衚瀺ãããŸãã
MongoDBããAerospikeãžã®ç§»è¡ã®ãããã§ãæšå¥šäºé ã®èŠæ±ã«å¯Ÿããå¹³åå¿çæéãççž®ãããŸããã 以äžã¯ãå€ããšã³ãžã³ããæ°ãããšã³ãžã³ã«åãæ¿ããç¬éã§ãã
ã芧ã®ãšãããå¿çæéã¯çŽ5åã«ãªããŸããã ããã¯ãSLAã«ã€ããŠããå¿é ããªãã®ã§ãç§ãã¡ã«ãšã£ãŠãRutubeèªäœã«ãšã£ãŠãå¿«é©ã§ãã
éã«é¢ããŠã¯ã3å°ã®ãã·ã³ã«æ°ããã¯ã©ã¹ã¿ãŒïŒClouderaïŒããããã€ããŸããã ä»ã®ãšãããããã§ååã§ãã ã·ã¹ãã å šäœããã©ãŒã«ããã¬ã©ã³ããªã®ã§ã皌åçã¯99.9ïŒ ã§ãã ããã«å ããŠãã¹ã±ãŒã©ããªãã£ããããŸããã¯ã©ã¹ã¿ãŒã®è² è·ãå€§å¹ ã«å¢å ãããªããããã€ã§ãæ°ãããã·ã³ããåºå®ãã§ããŸãã
次ã¯äœã§ãã
ããã§2ã€ã®ãã€ã³ãã«èå³ããããŸããã€ãã³ãã®éã¿ïŒèŠèŽã®éå§ãéäžãŸã§ã®èŠèŽãäžæåæ¢ãªã©ïŒãšãæšå¥šã®çºè¡ã«ããã人æ°ã®ããåç»ã®ã·ã§ã¢ã§ãã ãããã®ææšãšä»ã®ææšã®äž¡æ¹ã¯ãå°é家ã®æ¹æ³ãã€ãŸããç®ã§ãã«ãã£ãŠèšå®ãããŸãã:)ããã«ãããããããäž¡æ¹ã®ã±ãŒã¹ã§æãå¹æçãªææšã決å®ããããšæããŸãã ã»ãšãã©ã®å Žåã Metric Optimization EngineïŒMOEïŒã䜿çšããŸãã ããã¯ãA / Bãã¹ãã«åºã¥ããŠã·ã¹ãã ãã©ã¡ãŒã¿ã決å®ããããã®ãã¬ãŒã ã¯ãŒã¯ã§ãã èå³æ·±ãçµæãåŸãããããããã«æžããŠãã ããã
ã±ãŒã¹ãšã¹ããªãŒã åŠçå šè¬ã«ã€ããŠè³ªåãããå Žåã¯ãã³ã¡ã³ãã§ãå°ããã ãããå šå¡ã«åçããããåªããŸãã