ããã«ã¡ã¯ãHabrïŒ Matt Kleinã«ããèšäº
ãEnvoy threading modelãã®ç¿»èš³ã玹ä»ããŸãã
ãã®èšäºã¯ç§ã«ãšã£ãŠååã«èå³æ·±ããã®ã§ããããŸããEnvoyã¯ãistioããŸãã¯åã«ãã€ã³ã°ã¬ã¹ã³ã³ãããŒã©ãŒãã®kubernetesã®äžéšãšããŠäœ¿çšãããããšãæãå€ããããã»ãšãã©ã®äººã¯ãããšãã°å
žåçãªNginxãŸãã¯Haproxyã®ã€ã³ã¹ããŒã«ãšåãçŽæ¥ã®ããåãã¯ãããŸããã ãã ããäœããå£ããå Žåã¯ãå
éšããã©ã®ããã«æ©èœããããç解ããããšããå§ãããŸãã ç§ã¯ãããèŠãã®ãèŠãã人ã®ããã«ãã§ããã ãå€ãã®ããã¹ããç¹å¥ãªåèªãå«ããŠãã·ã¢èªã«ç¿»èš³ããããšããŸããããªãªãžãã«ãæ¬åŒ§å
ã«æ®ããŸããã ç«ãžããããã
Envoyã³ãŒãããŒã¹ã«é¢ããäœã¬ãã«ã®æè¡ææžã¯çŸåšéåžžã«å°ãªãã§ãã ãããä¿®æ£ããããã«ãããŸããŸãªEnvoyãµãã·ã¹ãã ã«é¢ããäžé£ã®ããã°èšäºãäœæããäºå®ã§ãã ããã¯æåã®èšäºã§ããããã次ã®èšäºã§ããªããèããŠããããšãèå³ãããããšãæããŠãã ããã
Envoyã«é¢ããŠæãããããæè¡çãªè³ªåã®1ã€ã¯ã䜿çšããã¹ã¬ããã¢ãã«ã®äœã¬ãã«ã®èª¬æãæ±ããããšã§ãã ãã®æçš¿ã§ã¯ãEnvoyãã¹ã¬ãããžã®æ¥ç¶ããããããæ¹æ³ãšãã³ãŒãããã䞊åã§é«æ§èœã«ããããã«å
éšçã«äœ¿çšãããThread Local Storageã·ã¹ãã ã«ã€ããŠèª¬æããŸãã
ã¹ã¬ããã®æŠèŠ
Envoyã¯3çš®é¡ã®ã¹ããªãŒã ã䜿çšããŸãã- ã¡ã€ã³ïŒãã®ã¹ã¬ããã¯ãããã»ã¹ã®éå§ãšçµäºãDNSãå«ãXDSïŒxDiscovery ServiceïŒAPIã®ãã¹ãŠã®åŠçããã«ã¹ãã§ãã¯ãäžè¬çãªã¯ã©ã¹ã¿ãŒããã³ãµãŒãã¹ç®¡çïŒå®è¡æïŒãçµ±èšãªã»ããã管çããã³äžè¬ç®¡çãå¶åŸ¡ããŸãããã»ã¹-Linuxã·ã°ãã«ãããããªã¹ã¿ãŒããªã©ããã®ã¹ã¬ããã§çºçããããšã¯ãã¹ãŠéåæã§ãããéããããã³ã°ã§ãã äžè¬ã«ãã¡ã€ã³ã¹ã¬ããã¯ãæ©èœã®éèŠãªããã»ã¹ããã¹ãŠèª¿æŽããŸããããã«ã¯ãå®äºããããã«å€æ°ã®CPUãå¿
èŠãšããŸããã ããã«ãããã»ãšãã©ã®å¶åŸ¡ã³ãŒããã·ã³ã°ã«ã¹ã¬ããã®ããã«èšè¿°ã§ããŸãã
- ã¯ãŒã«ãŒïŒããã©ã«ãã§ã¯ãEnvoyã¯ã·ã¹ãã å
ã®åããŒããŠã§ã¢ã¹ã¬ããã«å¯ŸããŠã¯ãŒã«ãŒã¹ã¬ãããäœæããŸããããã¯
--concurrency
ãªãã·ã§ã³ã䜿çšããŠå¶åŸ¡ã§ããŸãã åã¯ãŒã«ãŒã¹ã¬ããã¯ãéããããã³ã°ãã€ãã³ãã«ãŒããèµ·åããŸããããã¯ãåãªã¹ããŒã®ãªã¹ãã³ã°ãæ
åœããŸããå·çæç¹ïŒ2017幎7æ29æ¥ïŒã§ã¯ããªã¹ããŒã®ã·ã£ãŒãã£ã³ã°ã¯ãªããæ°ãããªã¹ããŒãåãåããŸããæ¥ç¶ãæ¥ç¶ãããã£ã«ã¿ãŒã¹ã¿ãã¯ã®ã€ã³ã¹ã¿ã³ã¹ã®äœæãããã³æ¥ç¶ã®æå¹æéäžã®ãã¹ãŠã®I / Oæäœã®åŠçã ç¹°ãè¿ããŸãããããã«ãããã»ãšãã©ã®æ¥ç¶åŠçã³ãŒããã·ã³ã°ã«ã¹ã¬ããã®ããã«æžãããšãã§ããŸãã - ãã¡ã€ã«ãã©ãã·ã£ãŒïŒ Envoyãæžã蟌ãåãã¡ã€ã«ãäž»ã«ã¢ã¯ã»ã¹ãã°ã«ã¯ãçŸåšãç¬ç«ããããããã³ã°ã¹ããªãŒã ããããŸãã ããã¯ã
O_NONBLOCK
ã䜿çšããŠããå Žåã§ãããã¡ã€ã«ã·ã¹ãã ã«ãã£ãŠãã£ãã·ã¥ããããã¡ã€ã«ãžã®æžã蟌ã¿ããããã¯ãããå Žåãããããã§ãïŒããæ¯ïŒã ã¯ãŒã«ãŒã¹ã¬ããããã¡ã€ã«ã«æžã蟌ãå¿
èŠãããå ŽåãããŒã¿ã¯å®éã«ã¡ã¢ãªå
ã®ãããã¡ãŒã«ç§»åãããæçµçã«ãã¡ã€ã«ãã©ãã·ã¥ã¹ããªãŒã ãä»ããŠãã©ãã·ã¥ãããŸãã ããã¯ãæè¡çã«ãã¹ãŠã®ã¯ãŒã«ãŒã¹ã¬ãããã¡ã¢ãªãããã¡ãåããããšããŠããéã«åãããã¯ããããã¯ã§ããã³ãŒãã®1ã€ã®é åã§ãã
æ¥ç¶åŠç
äžèšã§ç°¡åã«èª¬æããããã«ããã¹ãŠã®ã¯ãŒã¯ãããŒã¯ã»ã°ã¡ã³ããŒã·ã§ã³ãªãã§ãã¹ãŠã®ãªã¹ããŒããªãã¹ã³ããŸãã ãããã£ãŠãã«ãŒãã«ã¯ãåä¿¡ãããœã±ãããã¯ãŒã«ãŒã¹ã¬ããã«æ£ããéä¿¡ããããã«äœ¿çšãããŸãã çŸä»£ã®ã«ãŒãã«ã¯äžè¬çã«ãããéåžžã«åªããŠãããåããœã±ããã§ãªãã¹ã³ããä»ã®ã¹ã¬ããã䜿çšãå§ããåã«ãå
¥åºåïŒIOïŒã®åªå
床ãäžããŠã¹ã¬ãããä»äºã§ãã£ã±ãã«ãããªã©ã®æ©èœã䜿çšãã埪ç°ããã¯ã䜿çšããŸããïŒã¹ãã³ããã¯ïŒåãªã¯ãšã¹ããåŠçããŸãã
æ¥ç¶ãã¯ãŒã«ãŒã¹ã¬ããã§åãå
¥ãããããšããã®ã¹ã¬ãããé¢ããããšã¯ãããŸããã ãã以éã®ãã¹ãŠã®æ¥ç¶åŠçã¯ã転éåäœãå«ããã¯ãŒã«ãŒã¹ã¬ããã§å®å
šã«åŠçãããŸãã
ããã«ã¯ãããã€ãã®éèŠãªçµæããããŸãã- Envoyã®ãã¹ãŠã®æ¥ç¶ããŒã«ã¯ã¯ãŒã¯ãããŒå
ã«ãããŸãã ãããã£ãŠãHTTP / 2æ¥ç¶ããŒã«ã¯äžåºŠã«åã¢ããã¹ããªãŒã ãã¹ãã«1ã€ã®æ¥ç¶ã®ã¿ãäœæããŸããã4ã€ã®ã¯ãŒã«ãŒã¹ã¬ãããããå Žåãå®å®ããç¶æ
ã§ã¢ããã¹ããªãŒã ãã¹ãã«4ã€ã®HTTP / 2æ¥ç¶ããããŸãã
- Envoyããã®ããã«æ©èœããçç±ã¯ããã¹ãŠã1ã€ã®ã¯ãŒã¯ãããŒã«ä¿åããããšã«ãããã»ãšãã©ãã¹ãŠã®ã³ãŒãããããã¯ããããšãªãããŸãã§ã·ã³ã°ã«ã¹ã¬ããã§ãããã®ããã«æžãããšãã§ããããã§ãã ãã®èšèšã«ãããå€ãã®ã³ãŒãã®èšè¿°ã容æã«ãªããã»ãŒç¡å¶éã®æ°ã®ã¯ãŒã¯ãããŒã«å¯ŸããŠéåžžã«åªããæ¡åŒµæ§ãåŸãããŸãã
- ãã ããäž»ãªçµè«ã®1ã€ã¯ãã¡ã¢ãªããŒã«ãšæ¥ç¶å¹çã®èŠ³ç¹ãããå®éã«ã¯
--concurrency
ãã©ã¡ãŒã¿ãŒãæ§æããããšãéåžžã«éèŠã§ãã--concurrency
ããšã§ãã å¿
èŠä»¥äžã®ã¯ãŒã«ãŒã¹ã¬ããããããšãã¡ã¢ãªã倱ãããéã¢ã¯ãã£ããªæ¥ç¶ãå€ããªããæ¥ç¶ããŒã«ãžã®ã¢ã¯ã»ã¹é床ãäœäžããŸãã Lyftã§ã¯ãç§ãã¡ã®ç¹äœ¿ãµã€ãã«ãŒã³ã³ããã¯éåžžã«äœãåæå®è¡æ§ã§åäœãããããããã©ãŒãã³ã¹ã¯é£ã«ãããµãŒãã¹ãšã»ãŒåçã§ãã Envoyã¯ãåæå®è¡æ§ãæ倧ã®ãšããžãããã·ïŒãšããžïŒãšããŠã®ã¿å®è¡ãããŸãã
ãã³ããããã³ã°ãšã¯ã©ãããæå³ã§ããïŒ
ãããŸã§ã®ãšããããéããããã³ã°ããšããçšèªã¯ãã¡ã€ã³ã¹ã¬ãããšã¯ãŒã«ãŒã¹ã¬ãããã©ã®ããã«æ©èœããããè°è«ããéã«äœåºŠã䜿çšãããŠããŸããã äœããããã¯ãããªãéãããã¹ãŠã®ã³ãŒããèšè¿°ãããŸãã ãã ããããã¯å®å
šã«çå®ã§ã¯ãããŸããïŒå®å
šã«çå®ã§ã¯ãããŸãããïŒïŒã
Envoyã¯ããã€ãã®é·ãããã»ã¹ããã¯ã䜿çšããŸãã- ãã§ã«è¿°ã¹ãããã«ãã¢ã¯ã»ã¹ãã°ãæžã蟌ããšãããã¹ãŠã®ã¯ãŒã«ãŒã¹ã¬ããã¯ã¡ã¢ãªå
ã®ãã°ãããã¡ãåããåã«åãããã¯ãååŸããŸãã ããã¯ä¿ææéã¯éåžžã«çãããå¿
èŠããããŸããããã®ããã¯ã¯é«ãåæå®è¡æ§ãšé«ãã¹ã«ãŒãããã§ãã£ã¬ã³ãžãããå¯èœæ§ããããŸãã
- Envoyã¯ãã¹ããªãŒã ã«ããŒã«ã«ãªçµ±èšãåŠçããããã«éåžžã«æŽç·Žãããã·ã¹ãã ã䜿çšããŸãã ããã¯å¥ã®æçš¿ã®ãããã¯ã«ãªããŸãã ãã ãããããŒçµ±èšã®ããŒã«ã«åŠçã®äžéšãšããŠãäžå€®ã®ãçµ±èšã¹ãã¢ãã®ããã¯ãååŸããå¿
èŠãããå Žåãããããšãç°¡åã«èª¬æããŸãã ãã®ããã¯ã¯å¿
èŠãããŸããã
- ã¡ã€ã³ã¹ã¬ããã¯ããã¹ãŠã®ã¯ãŒã¯ãããŒãšå®æçã«èª¿æŽããå¿
èŠããããŸãã ããã¯ãã¡ã€ã³ã¹ã¬ããããã¯ãŒã«ãŒã¹ã¬ããã«ããŸãæã«ã¯ã¯ãŒã«ãŒã¹ã¬ããããã¡ã€ã³ã¹ã¬ããã«ããããªãã·ã¥ãããããšã§è¡ãããŸãã éä¿¡ã®å Žåããããªãã·ã¥ãããã¡ãã»ãŒãžãåŸç¶ã®é
ä¿¡ã®ããã«ãã¥ãŒã«å
¥ããããããã«ãããããã³ã°ãå¿
èŠã§ãã ãããã®ããã¯ã¯æ±ºããŠæ·±å»ãªç«¶äºã«ãããããã¹ãã§ã¯ãããŸããããæè¡çã«ãããã¯ããããšãã§ããŸãã
- Envoyãã·ã¹ãã ãšã©ãŒã¹ããªãŒã ïŒæšæºãšã©ãŒïŒã«ãã°ãæžã蟌ããšãããã»ã¹å
šäœã§ããã¯ãåãåããŸãã äžè¬ã«ãEnvoyã®ããŒã«ã«ãã®ã³ã°ã¯ããã©ãŒãã³ã¹ã®ç¹ã§ã²ã©ããã®ãšèŠãªãããŠããããããã®æ¹åã«ã¯ããŸã泚æãæãããŠããŸããã
- ä»ã«ãããã€ãã®ã©ã³ãã ããã¯ããããŸããããããã¯ã©ããããã©ãŒãã³ã¹ãéèŠã§ã¯ãªãããã決ããŠäºãã¹ãã§ã¯ãããŸããã
ã¹ã¬ããããŒã«ã«ã¹ãã¬ãŒãž
Envoyãã¡ã€ã³ã¹ã¬ããã®è²¬ä»»ãã¯ãŒã¯ãããŒã®è²¬ä»»ããåé¢ããæ¹æ³ã®ãããã¡ã€ã³ã¹ã¬ããã§è€éãªåŠçãå®è¡ããé«åºŠãªäžŠè¡æ§ã§åã¯ãŒã¯ãããŒã«æäŸã§ããå¿
èŠããããŸãã ãã®ã»ã¯ã·ã§ã³ã§ã¯ãEnvoyã¹ã¬ããããŒã«ã«ã¹ãã¬ãŒãžïŒTLSïŒã·ã¹ãã ã«ã€ããŠé«ã¬ãã«ã§èª¬æããŸãã 次ã®ã»ã¯ã·ã§ã³ã§ã¯ãã¯ã©ã¹ã¿ãŒã®ç®¡çã«ã©ã®ããã«äœ¿çšããããã説æããŸãã
æ¢ã«èª¬æããããã«ãã¡ã€ã³ã¹ã¬ããã¯ãã»ãŒãã¹ãŠã®ç®¡çæ©èœãšEnvoyããã»ã¹ã®ã³ã³ãããŒã«ãã¬ãŒã³ã®æ©èœãåŠçããŸãã 管çãã¬ãŒã³ã¯ããã§ã¯å°ãéè² è·ã«ãªã£ãŠããŸãããEnvoyããã»ã¹èªäœã§ãããèŠãŠãã¯ãŒã¯ãããŒãå®è¡ãã転éãšæ¯èŒãããšãããã¯é©åãªããã§ãã äžè¬çãªã«ãŒã«ãšããŠãã¡ã€ã³ã¹ã¬ããããã»ã¹ã¯äœããã®äœæ¥ãè¡ãããã®äœæ¥ã®çµæã«åŸã£ãŠåã¯ãŒã«ãŒã¹ã¬ãããæŽæ°
ããå¿
èŠããããŸãããã¯ãŒã«ãŒã¹ã¬ããã¯ãã¹ãŠã®ã¢ã¯ã»ã¹ã«ããã¯ãèšå®ããå¿
èŠã¯ãããŸãã ã
TLSïŒã¹ã¬ããããŒã«ã«ã¹ãã¬ãŒãžïŒEnvoyã·ã¹ãã ã¯æ¬¡ã®ããã«æ©èœããŸãã- ã¡ã€ã³ã¹ã¬ããã§å®è¡ãããã³ãŒãã¯ãããã»ã¹å
šäœã«TLSã¹ããããå²ãåœãŠãããšãã§ããŸãã ããã¯æœè±¡åãããŠããŸãããå®éã«ã¯OïŒ1ïŒã¢ã¯ã»ã¹ãæäŸãããã¯ãã«å
ã®ã€ã³ããã¯ã¹ã§ãã
- ã¡ã€ã³ã¹ããªãŒã ã¯ããã®ã¹ãããã«ä»»æã®ããŒã¿ãèšå®ã§ããŸãã ãããå®äºãããšãããŒã¿ã¯åã¯ãŒã¯ãããŒã§éåžžã®ã€ãã³ãã«ãŒãã€ãã³ããšããŠå
¬éãããŸãã
- ã¯ãŒã«ãŒã¹ã¬ããã¯ãTLSã¹ãããããèªã¿åããããã§äœ¿çšå¯èœãªããŒã«ã«ã¹ã¬ããããŒã¿ãååŸã§ããŸãã
ããã¯éåžžã«ã·ã³ãã«ã§ä¿¡ããããªãã»ã©åŒ·åãªãã©ãã€ã ã§ãããRCUããããã³ã°ã®æŠå¿µïŒRead-Copy-UpdateïŒãšéåžžã«äŒŒãŠããŸãã æ¬è³ªçã«ãã¯ãŒã¯ãããŒã§ã¯ãå®è¡æã«TLSã¹ãããã§ããŒã¿ã®å€æŽã衚瀺ãããããšã¯ãããŸããã å€æŽã¯ãäœæ¥ã€ãã³ãéã®äŒæ©æéäžã«ã®ã¿çºçããŸãã
Envoyã¯ããã2ã€ã®ç°ãªãæ¹æ³ã§äœ¿çšããŸãã- åã¯ãŒã¯ãããŒã«ããŸããŸãªããŒã¿ãä¿åããããšã«ããããã®ããŒã¿ãžã®ã¢ã¯ã»ã¹ã¯ãããã¯ãããããšãªãå®è¡ãããŸãã
- åã¯ãŒã«ãŒã¹ã¬ããã§èªã¿åãå°çšã¢ãŒãã§ã°ããŒãã«ããŒã¿ãžã®ã°ããŒãã«ãã€ã³ã¿ãŒãæ ŒçŽããã ãããã£ãŠãåã¯ãŒã¯ãããŒã«ã¯ããŒã¿åç
§ã«ãŠã³ã¿ãŒããããäœæ¥ã®å®è¡äžã«æžããããšã¯ã§ããŸããã ãã¹ãŠã®ã¯ãŒã«ãŒãèœã¡çããŠæ°ããå
±æããŒã¿ãã¢ããããŒãããå Žåã«ã®ã¿ãå€ãããŒã¿ãç Žæ£ãããŸãã RCUãšåãã§ãã
ã¯ã©ã¹ã¿ãŒæŽæ°ã¹ã¬ãã
ãã®ã»ã¯ã·ã§ã³ã§ã¯ãTLSïŒã¹ã¬ããããŒã«ã«ã¹ãã¬ãŒãžïŒã䜿çšããŠã¯ã©ã¹ã¿ãŒã管çããæ¹æ³ã«ã€ããŠèª¬æããŸãã ã¯ã©ã¹ã¿ãŒç®¡çã«ã¯ãxDSããã³/ãŸãã¯DNS APIåŠçãããã³ãã«ã¹ãã§ãã¯ãå«ãŸããŸãã
ã¯ã©ã¹ã¿ãããŒç®¡çã«ã¯ã次ã®ã³ã³ããŒãã³ããšæé ãå«ãŸããŸãã- Cluster Managerã¯ãæ¢ç¥ã®ãã¹ãŠã®ã¯ã©ã¹ã¿ãŒã¢ããã¹ããªãŒã ãCDSïŒã¯ã©ã¹ã¿ãŒæ€åºãµãŒãã¹ïŒAPIãSDSïŒç§å¯æ€åºãµãŒãã¹ïŒããã³EDSïŒãšã³ããã€ã³ãæ€åºãµãŒãã¹ïŒAPIãDNSãããã³ã¢ã¯ãã£ããªå€éšãã§ãã¯ã管çããEnvoyå
ã®ã³ã³ããŒãã³ãã§ããã«ã¹ïŒãã«ã¹ãã§ãã¯ïŒã 圌ã¯ãæ€åºããããã¹ããšãã«ã¹ã¹ããŒã¿ã¹ãå«ãåã¢ããã¹ããªãŒã ã¯ã©ã¹ã¿ãŒã®ãæçµçã«äžè²«ãããè¡šçŸãäœæãã責任ããããŸãã
- ãã«ã¹ãã§ãã«ãŒã¯ã¢ã¯ãã£ããªãã«ã¹ãã§ãã¯ãå®è¡ãããã«ã¹ç¶æ
ã®å€åãã¯ã©ã¹ã¿ãŒãããŒãžã£ãŒã«å ±åããŸãã
- CDSïŒã¯ã©ã¹ã¿ãŒãã£ã¹ã«ããªãŒãµãŒãã¹ïŒ/ SDSïŒã·ãŒã¯ã¬ãããã£ã¹ã«ããªãŒãµãŒãã¹ïŒ/ EDSïŒãšã³ããã€ã³ããã£ã¹ã«ããªãŒãµãŒãã¹ïŒ/ DNSã¯ãã¯ã©ã¹ã¿ãŒã¡ã³ããŒã·ããã決å®ããããã«å®è¡ãããŸãã ç¶æ
ã®å€æŽã¯ã¯ã©ã¹ã¿ãŒãããŒãžã£ãŒã«è¿ãããŸãã
- åã¯ãŒã«ãŒã¹ã¬ããã¯ãã€ãã³ãã«ãŒããç¶ç¶çã«å®è¡ããŸãã
- ã¯ã©ã¹ã¿ãŒã®ç¶æ
ãå€åãããšã¯ã©ã¹ã¿ãŒãããŒãžã£ãŒãå€æãããšãæ°ããèªã¿åãå°çšã¯ã©ã¹ã¿ãŒã¹ãããã·ã§ãããäœæããåã¯ãŒã«ãŒã¹ã¬ããã«éä¿¡ããŸãã
- 次ã®äŒæ¢æéäžãã¯ãŒã¯ãããŒã¯å°çšTLSã¹ãããã®ã¹ãããã·ã§ãããæŽæ°ããŸãã
- ãã¹ããããŒããã©ã³ã·ã³ã°ã®ããã«æ±ºå®ããå¿
èŠãããI / Oã€ãã³ãäžã«ãããŒããã©ã³ãµãŒã¯ãã¹ãæ
å ±ãååŸããããã«TLSã¹ãããïŒã¹ã¬ããããŒã«ã«ã¹ãã¬ãŒãžïŒãèŠæ±ããŸãã ããã«ã¯ããã¯ã¯å¿
èŠãããŸããã ãŸããTLSã¯ã¢ããã°ã¬ãŒãäžã«ã€ãã³ããããªã¬ãŒã§ãããããããŒããã©ã³ãµãŒãä»ã®ã³ã³ããŒãã³ãããã£ãã·ã¥ãããŒã¿æ§é ãªã©ãåã«ãŠã³ãã§ããããšã«ã泚æããŠãã ããã ããã¯ãã®æçš¿ã®ç¯å²å€ã§ãããã³ãŒãå
ã®ããŸããŸãªå Žæã§äœ¿çšãããŠããŸãã
äžèšã®æé ã䜿çšãããšãEnvoyã¯ïŒåè¿°ã®ããã¯ä»¥å€ã®ïŒããã¯ãªãã§åãªã¯ãšã¹ããåŠçã§ããŸãã TLSã³ãŒãèªäœã®è€éãã«å ããŠãã»ãšãã©ã®ã³ãŒãã¯ãã«ãã¹ã¬ããã®ä»çµã¿ãç解ããå¿
èŠããªããã·ã³ã°ã«ã¹ã¬ããã¢ãŒãã§èšè¿°ã§ããŸãã ããã«ãããåªããããã©ãŒãã³ã¹ã«å ããŠãã»ãšãã©ã®ã³ãŒããèšè¿°ãããããªããŸãã
TLSã䜿çšããä»ã®ãµãã·ã¹ãã
TLSïŒã¹ã¬ããããŒã«ã«ã¹ãã¬ãŒãžïŒããã³RCUïŒèªã¿åãã³ããŒæŽæ°ïŒã¯ãEnvoyã§åºã䜿çšãããŠããŸãã
䜿çšäŸïŒ- å®è¡äžã«æ©èœãå€æŽããã¡ã«ããºã ïŒæå¹ãªæ©èœã®çŸåšã®ãªã¹ãã¯ãã¡ã€ã³ã¹ã¬ããã§èšç®ãããŸãã åã¯ãŒã¯ãããŒã«ã¯ãRCUã»ãã³ãã£ã¯ã¹ã䜿çšããèªã¿åãå°çšã¹ãããã·ã§ãããæäŸãããŸãã
- ã«ãŒãããŒãã«ã®çœ®ãæã ïŒRDSïŒã«ãŒããã£ã¹ã«ããªãµãŒãã¹ïŒãæäŸããã«ãŒãããŒãã«ã®å Žåãã«ãŒãããŒãã«ã¯ã¡ã€ã³ã¹ã¬ããã§äœæãããŸãã èªã¿åãå°çšã¹ãããã·ã§ããã¯ãRCUã»ãã³ãã£ã¯ã¹ïŒèªã¿åãã³ããŒæŽæ°ïŒã䜿çšããŠåã¯ãŒã¯ãããŒã«åŸã§æäŸãããŸãã ããã«ãããã«ãŒãããŒãã«ã®å€æŽãååçã«å¹ççã«ãªããŸãã
- HTTPããããŒãã£ãã·ã¥ïŒå€æããããã«ãåãªã¯ãšã¹ãã®HTTPããããŒã®èšç®ïŒã³ã¢ãããã25K + RPSãå®è¡ããå ŽåïŒã¯éåžžã«é«äŸ¡ã§ãã Envoyã¯ãããããŒãçŽ0.5ç§ããšã«éäžçã«èšç®ããTLSããã³RCUãä»ããŠãã¹ãŠã®åŸæ¥å¡ã«æäŸããŸãã
ä»ã®å ŽåããããŸããã以åã®äŸã¯TLSãäœã®ããã«äœ¿çšãããŠããããããç解ããã¯ãã§ãã
æ¢ç¥ã®ããã©ãŒãã³ã¹ã®èœãšãç©Ž
Envoyã¯å
šäœçã«éåžžã«è¯å¥œã«æ©èœããŸãããéåžžã«é«ãåæå®è¡æ§ãšåž¯åå¹
ã§äœ¿çšããå Žåã«æ³šæãå¿
èŠãªããã€ãã®æåãªé åããããŸãã
- ãã®èšäºã§æ¢ã«èª¬æããããã«ãçŸåšããã¹ãŠã®ã¯ãŒã«ãŒã¹ã¬ããã¯ã¢ã¯ã»ã¹ãã°ã¡ã¢ãªãããã¡ãŒã«æžã蟌ããšãã«ããã¯ãåãåããŸãã åæå®è¡æ§ãé«ããã¹ã«ãŒããããé«ãå Žåãæçµãã¡ã€ã«ãžã®æžã蟌ã¿æã®é
ä¿¡ãé äžåã§ãããããåã¯ãŒã¯ãããŒã®ã¢ã¯ã»ã¹ãã°ãããã±ãŒãžåããå¿
èŠããããŸãã ãŸãã¯ãã¯ãŒã¯ãããŒããšã«åå¥ã®ã¢ã¯ã»ã¹ãã°ãäœæã§ããŸãã
- çµ±èšã¯éåžžã«æé©åãããŠãããéåžžã«é«ãåæå®è¡æ§ãšã¹ã«ãŒããããåããŠããŸãããåã
ã®çµ±èšã«ã€ããŠã¯ã¢ãããã¯ãªç«¶åãããå¯èœæ§ããããŸãã ãã®åé¡ã®è§£æ±ºçã¯ãã¯ãŒã«ãŒã¹ã¬ããããšã®ã«ãŠã³ã¿ãŒãšãäžå€®ã«ãŠã³ã¿ãŒã®å®æçãªãªã»ããã§ãã ããã«ã€ããŠã¯ãåŸç¶ã®æçš¿ã§èª¬æããŸãã
- 倧éã®åŠçãªãœãŒã¹ãå¿
èŠãšããæ¥ç¶ãéåžžã«å°ãªãã·ããªãªã§Envoyãå±éãããšãæ¢åã®ã¢ãŒããã¯ãã£ã¯ããŸãæ©èœããŸããã éä¿¡ãã¯ãŒã¯ãããŒéã§åçã«åæ£ããããšããä¿èšŒã¯ãããŸããã ããã¯ãã¯ãŒã¯ãããŒéã®æ¥ç¶ã亀æããæ©èœãå®çŸãããäœæ¥æ¥ç¶ã®ãã©ã³ã¹ãåãããšã§è§£æ±ºã§ããŸãã
ãããã«
Envoyã¹ã¬ããã¢ãã«ã¯ãæ£ããæ§æãããŠããªãå Žåãã¡ã¢ãªãšæ¥ç¶ãç¡é§ã«äœ¿çšããå¯èœæ§ããããããããã°ã©ãã³ã°ã®å®¹æããšå€§èŠæš¡ãªåæå®è¡æ§ãæäŸããããã«èšèšãããŠããŸãã ãã®ã¢ãã«ã«ãããéåžžã«å€ãã®ã¹ã¬ãããšã¹ã«ãŒãããã§éåžžã«ããŸãæ©èœããŸãã
Twitterã§ç°¡åã«è¿°ã¹ãããã«ããã¶ã€ã³ã¯ãDPDKïŒData Plane Development KitïŒãªã©ã®ãã«æ©èœã®ãããã¯ãŒã¯ã¹ã¿ãã¯äžã§ãŠãŒã¶ãŒã¢ãŒãã§å®è¡ããããšãã§ããŸãã ä»åŸæ°å¹Žã§äœãæ§ç¯ãããããèŠãã®ã¯éåžžã«èå³æ·±ãã§ãããã
æåŸã®ç°¡åãªã³ã¡ã³ãïŒEnvoyã«C ++ãéžãã çç±ã¯äœåºŠãèãããŸããã 以åã®ããã«ããã®æçš¿ã§èª¬æãããŠããã¢ãŒããã¯ãã£ãæ§ç¯ããããã®å¯äžã®åºã話ãããŠããç£æ¥ã¬ãã«ã®èšèªã§ããããã§ãã C ++ã¯ããã¹ãŠã®ãããžã§ã¯ããå€ãã®ãããžã§ã¯ãã«é©ããŠããããã§ã¯ãããŸããããç¹å®ã®ãŠãŒã¹ã±ãŒã¹ã§ã¯ããžã§ããå®è¡ããïŒãžã§ããå®è¡ããïŒããã®å¯äžã®ããŒã«ã§ãã
ã³ãŒããžã®ãªã³ã¯
ãã®æçš¿ã§èª¬æãããŠããã€ã³ã¿ãŒãã§ã€ã¹ãšããããŒå®è£
ãæã€ãã¡ã€ã«ãžã®ãªã³ã¯ïŒ