High Performance Browser Networking
ä¸é¨ï¼ï¼ï¼ã«éè¦ããã£ããããªã®ã§ãåæ²ã
å®ã¯ã¾ã å ¨é¨èªãã§ããããç©ç層ããã©ã³ã¹ãã¼ã層ã®è©±ãè±ãã¦ã¢ããªã±ã¼ã·ã§ã³å±¤ã¨ãããHTTPã«æ¥ãæã
åã主ã«èå³ãæ¹ãããã®ã¯TCPå¨ãã®è©±ãªã®ã§ããã®è¾ºã ãã¾ã¨ãããèªãã æ¬ã®è¦ç´ï¼ã¨ããã®ã¯ããã¿ãããèä½æ¨©ä¾µå®³ã¨ãããå 容ãã®ãã®ã®å¼åãã«ãªã£ã¦ãã¾ãããã§é£ããã
話ã®åæ
- TCPã¯ä¸å®å®ã§ç´°ãåç·ãåæã¨ãã¦å ã ä½ããããããã³ã«ãªã®ã§ãç¾ä»£ã®æ¯è¼çå®å®ãã太ãåç·ã®ä¸ã§ã¯éå¹çãªé¨åãå¤ã ãã
- ã¢ããªã±ã¼ã·ã§ã³ããã¼ã¿éãå§ããåã«ãããã3-way handshakeã®ããã®éä¿¡ããã£ã¡ããã£ã¡ããããªãã¨ãããªããããã«ãããæéã¯ãããã«å¸¯åãåºãã¨ãã¬ã¤ãã³ã·ã«å¼ã£å¼µããã¦ãã¾ãã
- ãã®é¨åã®ãã¹ã¯ããããHTTP keepaliveã§åé¿ã§ãããã®ã ã...
- ãããã¦handshakeããå¾ã«ã¾ããã£ã¡ããã£ã¡ãcongestion window sizeãåºãã¦ãããªããã°ãããªããè¦ã¯åãããã¢ãªã¢ãªå¸¯åã使ããã¨ã¯åºæ¥ãªãã
- ãã£ããåºããwindow sizeããå½ç¶ãªããæ°ããconnectionãå¼µãã°ã¾ãæåããããç´ã
- keepaliveãã¦ã¦ãããã°ããéä¿¡ãã¦ãªããã°window sizeã¯ç¸®ãããã¦ã¾ãä¸ããããç´ã
- keepaliveã¯3-way handshakeã®ã³ã¹ããã ãããæ¸ãããã®ã§ãã£ã¦éã®å¼¾ä¸¸ã§ã¯ãªã
TCP Fast Open
ç°¡åã«è¨ãã¨ã3-way handshakeã®éã«ã¤ãã§ã«ãã¼ã¿éã£ã¡ããã°ããããã¼ã£ã¦ããã®ãTCP Fast OpenãLinuxã§å¯¾å¿ãã¦ããã®ã¯3.7以éãClientã¨Serverã両æ¹å¯¾å¿ãã¦ãªãã¨ãããªãããå®éã«ã¢ãªã¢ãªä½¿ããããã«ãªãã®ã¯ãã°ããå¾ã ã¨æãããããGoogle調ã¹ã«ããã¨ããã ãã§Web Pageã®ãã¼ãæéãå¹³å10%åæ¸ã§ãããããªãç¹ã«keepaliveã§ããªãäºæ ã®ããç°å¢ã§å¹æãããããã
SSR (Slow-Start Restart)
ç°¡åã«è¨ãã¨ãkeepaliveãã¦ã¦ããã°ããéä¿¡ããªãã£ããcongestion window sizeãresetãã¦ãããï¼ãããã¯ã¼ã¯ã®ç¶æ³å¤ãã£ã¦ããããããããããªï¼ã¨ããæ©è½ãkeepaliveãå©ç¨ãã¦ããããã¤è¼»è¼³ãå°ãªãç°å¢ã§ã¯ããã¯éã«offã«ãªã£ã¦ããæ¹ãå¹çã¯ããã¨æãããããæå ã®Linuxã§enableãã©ããã¯ä»¥ä¸ã®ã³ãã³ãã§ã
sysctl net.ipv4.tcp_slow_start_after_idle
Window Scaling (RFC 1323)
ç°¡åã«è¨ãã¨ãæ大65535byteã¨æ±ºã¾ã£ã¦ããTCPã®window sizeãæ大1GB(!)ã¾ã§ãã±ã¼ããã¡ããããï¼ã£ã¦ãã話ãããã¯æ¢ã«å¤ãã®OSã§ããã©ã«ãONã«ãªã£ã¦ãããããããä¸éã®ãããã¯ã¼ã¯æ©å¨ããªãã·ã§ã³ãå¤ãã¦ãã¾ãå ´åããããããããæå ã®Linuxã§enableãã©ããã¯ä»¥ä¸ã®ã³ãã³ãã§ã
sysctl net.ipv4.tcp_window_scaling
PRR (Propotional Rate Reduction)
ç°¡åã«è¨ãã¨ãpacket lossãçºçããæã«ç¸®ããwindow sizeããªãªã¸ãã«ã®ã¢ã«ã´ãªãºã (AIMD)ããç´ æ©ãrecoverãããããã®ã¢ã«ã´ãªãºã ãã®ååãLinux3.2以éã§ããã©ã«ããpacket lossããã£ãå ´åã®ã¬ã¤ãã³ã·ãå¾æ¥ã«æ¯ã¹ã¦å¹³å3-10%åæ¸ã§ããããããªããããGoogle調ã¹ã
è²ã ãããã§ããªãã
ãããã®ã