{"id":15777,"date":"2016-01-18T16:53:49","date_gmt":"2016-01-18T07:53:49","guid":{"rendered":"http:\/\/labs.gree.jp\/blog\/?p=15777"},"modified":"2016-01-18T16:53:49","modified_gmt":"2016-01-18T07:53:49","slug":"dc%e5%86%85%e9%80%9a%e4%bf%a1%e3%81%aehttp2%e5%8c%96%e3%82%92%e6%a4%9c%e8%a8%8e%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2016\/01\/15777\/","title":{"rendered":"DC\u5185\u901a\u4fe1\u306eHTTP\/2\u5316\u3092\u691c\u8a0e\u3059\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u90e8\u306e\u5f8c\u85e4\u3067\u3059\u3002<\/p>\n<p>\u61f2\u308a\u305a\u306bHTTP\/2\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p>HTTP\/2\u3092\u5b9f\u30b5\u30fc\u30d3\u30b9\u306b\u6295\u5165\u3059\u308b\u306e\u306b\u306f\u69d8\u3005\u306a\u969c\u58c1\u304c\u3042\u308a\u3001\u8b70\u8ad6\u304c\u8db3\u308a\u3066\u306a\u3044\u90e8\u5206\u3060\u3068\u611f\u3058\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30b5\u30a4\u30c8\u306eHTTPS\u5316<\/li>\n<li>TLS ALPN, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 \u30b5\u30dd\u30fc\u30c8<\/li>\n<li>\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30fb\u76e3\u8996<\/li>\n<li>Dependency Based Priority\u3068RUM<\/li>\n<li>\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u306e\u751f\u5b58\u6642\u9593\u304c\u9577\u304f\u3001\u904b\u7528\u4e0a\u306eDNS\u3092\u7528\u3044\u305f\u30b5\u30fc\u30d0\u5207\u308a\u66ff\u3048\u3068\u76f8\u6027\u304c\u60aa\u3044(GOAWAY\u51fa\u305b\u308b\u3082\u306e\u3082\u3042\u308b\u304c)<\/li>\n<li>ELB\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306fTCP\u3067\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b<\/li>\n<\/ul>\n<p>\u305d\u3082\u305d\u3082L7\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u5834\u5408\u3082\u3042\u308b\u304b\u3068\u304a\u3082\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u305d\u3053\u3067\u3001\u4eca\u56de\u306f\u6bd4\u8f03\u7684\u5bb9\u6613\u306aDC\u5185\u306eHTTP\u901a\u4fe1\u3092HTTP\/2\u5316\u3059\u308b\u3053\u3068\u3092\u8003\u3048\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>DC\u5185HTTP\u901a\u4fe1\u306eHTTP\/2\u5316<\/h2>\n<p>DC\u5185\u3067\u30b5\u30fc\u30d0\u9593\u306eHTTP\/2\u901a\u4fe1\u3067\u3042\u308c\u3070\u3001h2c(\u5e73\u6587\u3067\u306e\u901a\u4fe1)\u304c\u51fa\u6765\u307e\u3059\u306e\u3067\u5c0e\u5165\u6642\u306b\u8003\u3048\u308b\u3053\u3068\u304c\u5c11\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u63a5\u7d9a\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3084\u90e8\u5206\u5c0e\u5165\u3082\u6bd4\u8f03\u7684\u5bb9\u6613\u3067\u3059\u3002<\/p>\n<p>DC\u5185\u3067HTTP\u901a\u4fe1\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u3068\u3053\u308d\u3068\u3044\u3048\u3070\u3001\u307e\u305aProxy - Application\u30b5\u30fc\u30d0\u9593\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002\u7c21\u5358\u306a\u56f3\u3067\u793a\u3059\u3068\u3001\u4ee5\u4e0b\u306e\"\u3053\u3053\"\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15779 size-medium\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572584-829808fd01a57e9adcdd343095e9e50f243485ef-452x400.png\" alt=\"proxy-and-http\" width=\"452\" height=\"400\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572584-829808fd01a57e9adcdd343095e9e50f243485ef-452x400.png 452w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572584-829808fd01a57e9adcdd343095e9e50f243485ef-226x200.png 226w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572584-829808fd01a57e9adcdd343095e9e50f243485ef.png 502w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u4eca\u56de\u306fProxy\u3068Application\u30b5\u30fc\u30d0\u306b<a href=\"https:\/\/nghttp2.org\/\">nghttp2<\/a>\u306enghttpx\u3092\u5c0e\u5165\u3057\u3001\u30b5\u30fc\u30d0\u9593\u901a\u4fe1\u306eHTTP\/2\u5316\u3092\u884c\u3044\u307e\u3057\u305f(\u672c\u756a\u5c0e\u5165\u306f\u3057\u3066\u307e\u305b\u3093)\u3002nghttpx\u9593\u306f\u5e73\u6587\u306eHTTP\/2(h2c)\u3067\u901a\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15781 size-medium\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572603-29d1efe304638f9955ff5cbba61c26ab2bc4799f-257x400.png\" alt=\"nginx-and-nghttpx\" width=\"257\" height=\"400\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572603-29d1efe304638f9955ff5cbba61c26ab2bc4799f-257x400.png 257w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572603-29d1efe304638f9955ff5cbba61c26ab2bc4799f-128x200.png 128w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2016\/01\/2572603-29d1efe304638f9955ff5cbba61c26ab2bc4799f.png 294w\" sizes=\"auto, (max-width: 257px) 100vw, 257px\" \/><\/p>\n<h3>Proxy\u5074<\/h3>\n<p>nghttpx<\/p>\n<pre class=\"lang:sh decode:true\">$ nghttpx \u00a0--http2-bridge -f unix:\/var\/tmp\/sock --backend-no-tls --frontend-no-tls \n-b app1,3000 \n-b app2,3000 \n-b app3,3000\n<\/pre>\n<p>nginx.conf<\/p>\n<pre class=\"lang:sh decode:true\"> upstream local_nghttp2 {\n   server unix:\/var\/tmp\/sock;\n }\n\n server {\n   listen 80 default_server;\n   location \/ {\n     proxy_pass http:\/\/local_nghttp2\/;\n     proxy_set_header host $host;\n   }\n ...<\/pre>\n<h3>App\u5074<\/h3>\n<p>nghttpx<\/p>\n<pre class=\"lang:sh decode:true\">$ nghttpx --frontend-no-tls -f *,3000 -b unix:\/var\/tmp\/sock \n<\/pre>\n<p>nginx.conf<\/p>\n<pre class=\"lang:sh decode:true\">server {\n listen 80 default_server;\n listen unix:\/var\/tmp\/sock;\n ...<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u7c21\u5358\u306a\u8a08\u6e2c<\/h2>\n<p>Apache Bench\u3067\u7c21\u5358\u306b\u6e2c\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001Proxy -\u00a0Application\u30b5\u30fc\u30d0\u30921\u5bfe1\u3068\u3057\u3001App\u30b5\u30fc\u30d0\u306f\u9759\u7684\u306a\u30da\u30fc\u30b8\u3092\u8fd4\u3059\u7c21\u5358\u306a\u3082\u306e\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\uff08\u540c\u4e00HTTP\u30d8\u30c3\u30c0\u306e\u307f\u3092\u6271\u3046\u305f\u3081\u3001\u901a\u5e38\u7528\u9014\u3088\u308a<a href=\"https:\/\/http2.github.io\/http2-spec\/compression.html\">HPACK<\/a>\u52b9\u7387\u304c\u6709\u5229\u306b\u50cd\u3044\u3066\u308b\u304b\u3068\u306f\u601d\u3044\u307e\u3059\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>http1.1\u3067proxy\u3059\u308b\u5834\u5408<\/p>\n<pre class=\"lang:sh decode:true\">$ ab -n 50000 -c 100 http:\/\/proxy-dev\/use-http1\/\n...\nTime taken for tests: 4.784 seconds<\/pre>\n<p>http2\u3067proxy\u3059\u308b\u5834\u5408<\/p>\n<pre class=\"lang:sh decode:true\">$ ab -n 50000 -c 100 http:\/\/proxy-dev\/use-http2\/\n...\nTime taken for tests: 4.053 seconds<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5358\u7d14\u306a\u8a08\u6e2c\u3067\u3042\u308b\u304c\u3001\u4f55\u5ea6\u304b\u6e2c\u5b9a\u3057\u3066\u3082HTTP\/2\u3092\u5229\u7528\u3057\u305f\u307b\u3046\u304c\u591a\u5c11\u65e9\u3044\u3068\u3044\u3046\u7d50\u679c\u3068\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>DC\u5185\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u30b5\u30fc\u30d0\u9593\u306eRTT\u306f\u975e\u5e38\u306b\u5c0f\u3055\u304f\u3001HTTP\/1.1\u3067\u3082TCP 3\u30a6\u30a7\u30a4\u30cf\u30f3\u30c9\u30b7\u30a7\u30a4\u30af\u3084\u30b9\u30ed\u30fc\u30b9\u30bf\u30fc\u30c8\u306e\u5f71\u97ff\u306f\u5927\u304d\u304f\u306a\u3044\u306e\u3067HTTP\/2\u306b\u3088\u308a\u5287\u7684\u306b\u6539\u5584\u306f\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3082\u3046\u5c11\u3057RTT\u306e\u304b\u304b\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3060\u3068\u3088\u308a\u52b9\u529b\u3092\u767a\u63ee\u3057\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u4f7f\u7528\u3059\u308b\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5927\u304d\u304f\u306a\u304b\u3063\u305f\u3068\u3044\u3046\u306e\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u8a08\u6e2c\u3059\u308b\u3068HPACK\u306b\u3088\u308b\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u524a\u6e1b\u306f\u4e00\u5b9a\u306e\u52b9\u679c\u304c\u3042\u308b\u3088\u3046\u306b\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u306fDC\u5185\u306e\u30b5\u30fc\u30d0\u306bnghttpx\u3092\u5c0e\u5165\u3057\u3001Proxy -\u00a0Application\u30b5\u30fc\u30d0\u9593\u306eHTTP\u901a\u4fe1\u3092HTTP\/2\u3067\u884c\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>Apache Bench\u3092\u7528\u3044\u3066\u7c21\u5358\u306b\u8a08\u6e2c\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u30b5\u30fc\u30d0\u9593\u306eRTT\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u5927\u304d\u304f\u306f\u6539\u5584\u51fa\u6765\u306a\u304b\u3063\u305f\u3082\u306e\u306e\u3001\u4e00\u5b9a\u306e\u52b9\u679c\u304c\u5f97\u3089\u308c\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u90e8\u306e\u5f8c\u85e4\u3067\u3059\u3002 \u61f2\u308a\u305a\u306bHTTP\/2\u306e\u8a18\u4e8b\u3067\u3059\u3002 HTTP\/2\u3092\u5b9f\u30b5\u30fc\u30d3\u30b9\u306b\u6295\u5165\u3059\u308b\u306e\u306b\u306f\u69d8\u3005\u306a\u969c\u58c1\u304c\u3042\u308a\u3001\u8b70\u8ad6\u304c\u8db3\u308a\u3066\u306a\u3044\u90e8\u5206\u3060\u3068\u611f\u3058\u3066\u3044\u307e\u3059\u3002 \u30b5\u30a4\u30c8\u306eHTTPS\u5316 TLS ALPN, [&hellip;]<\/p>\n","protected":false},"author":109,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[87],"class_list":["post-15777","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-http2"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/users\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=15777"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15777\/revisions"}],"predecessor-version":[{"id":15848,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15777\/revisions\/15848"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=15777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=15777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=15777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}