{"id":61,"date":"2010-05-20T13:39:09","date_gmt":"2010-05-20T04:39:09","guid":{"rendered":"http:\/\/labs.gree.jp\/blog-stg\/?p=61"},"modified":"2021-04-27T14:59:54","modified_gmt":"2021-04-27T05:59:54","slug":"post61","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2010\/05\/61\/","title":{"rendered":"Gree Fast Processor: PHP\u30923\u500d(\u304f\u3089\u3044)\u901f\u304f"},"content":{"rendered":"<p>\u3054\u3042\u3044\u3055\u3064\u30a8\u30f3\u30c8\u30ea\u3060\u3051\u3068\u3044\u3046\u306e\u3082\u306a\u3093\u306a\u306e\u3067\u3001\u5f15\u304d\u7d9a\u304dfujimoto\u3067\u3059\u3002\u5b9f\u8cea\u4e0a1\u3064\u3081\u306e\u3088\u3046\u306a\u6c17\u304c\u3059\u308b\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u3067\u306f\u3001PHP\u304c3\u500d\u304f\u3089\u3044(\u5c11\u306a\u304f\u3068\u30822\u500d\u304f\u3089\u3044\u306f...)\u901f\u304f\u306a\u308bGree Fast Processor\u3068\u3044\u3046\u306e\u3092\u5148\u6708\u4f5c\u3063\u3066\u307f\u305f\u306e\u3067\u3054\u7d39\u4ecb\u3067\u3059\u3002<\/p>\n<h3 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_0\"> \u3059\u3050\u308f\u304b\u308b\u307e\u3068\u3081<\/h3>\n<p>Gree Fast Processor\u3068\u3044\u3046\u306e\u3092\u4f7f\u3063\u3066\u307f\u308b\u3068\u3001\u30b7\u30f3\u30d7\u30eb\u306asymfony\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8(<a href=\"http:\/\/xav.cc\/\">xav.cc<\/a>\u3067\u8a66\u3057\u307e\u3057\u305f)\u3067\u30822\u500d\u5f31\u3001\u7d50\u69cb\u8907\u96d1\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3060\u30687\u500d\u304f\u3089\u3044\u901f\u304f\u306a\u3063\u305f\u308a\u3057\u307e\u3059\u3002\u3044\u304f\u3064\u304b\u306e\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u98e2\u3048\u3066\u3044\u308b\u304b\u305f\u306f\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u3061\u3089\u306f\u306a\u3093\u304b\u3059\u3054\u3044\u901f\u304f\u306a\u3063\u3066\u3044\u308b\u611f\u3058\u306e\u30b0\u30e9\u30d5(\u4e00\u756a\u4e0a\u304c\u901f\u304f\u306a\u3063\u305f\u7248\u306eRequests per Second\u3001\u8d64\u304c\u901a\u5e38\u7248\u306eRequests per Second):<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2010\/05\/61\/gfp-graph-3\/\" rel=\"attachment wp-att-93\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-3-600x280.png\" alt=\"\" title=\"gfp-graph-3\" width=\"360\" height=\"168\" class=\"aligncenter size-medium wp-image-93\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-3-600x280.png 600w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-3.png 816w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/a><\/p>\n<p>\u3053\u308c\u306f\u3055\u3059\u304c\u306bbest case\u3059\u304e\u308b\u6c17\u304c\u3057\u307e\u3059\u304c\u3001\u666e\u901a\u306b\u3084\u3063\u3066\u30822\u500d\u5f31\u304f\u3089\u3044\u306f\u901f\u304f\u306a\u308b\u306f\u305a\u306a\u30b0\u30e9\u30d5:<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2010\/05\/61\/gfp-graph-2\/\" rel=\"attachment wp-att-90\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-2.png\" alt=\"\" title=\"gfp-graph-2\" width=\"360\" height=\"190\" class=\"aligncenter size-full wp-image-90\" \/><\/a><\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u8208\u5473\u3092\u6301\u305f\u308c\u305f\u65b9\u306f\u4ee5\u4e0b\u304c\u8a73\u7d30\u3067\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<h3 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_1\"> APC or eAccelerator\u3067\u5341\u5206?<\/h3>\n<p>\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3068\u3001\u4f8b\u3048\u3070RDBMS\u306e\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306e\u8a71\u3084\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u306b\u3064\u3044\u3066\u306e\u8a71\u984c\u306f\u975e\u5e38\u306b\u8c4a\u5bcc\u306a\u306e\u3067\u3059\u304c\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u306e\u307b\u3046\u306f\u3042\u307e\u308a\u8a71\u984c\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002\u305f\u3057\u304b\u306b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u306f\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u306e\u4e0b\u306b\u30b5\u30fc\u30d0\u3092\u4e26\u3079\u3066\u3044\u3051\u3070\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u3092\u78ba\u4fdd\u51fa\u6765\u305d\u3046\u3067\u3059\u3057\u3001PHP\u3092\u4f7f\u3063\u3066\u3044\u308c\u3070(\u3061\u306a\u307f\u306bGREE\u3067\u306f\u5e78\u304b\u4e0d\u5e78\u304b\u3001\u591a\u304f\u306e\u30b3\u30fc\u30c9\u304cPHP\u3067\u66f8\u304b\u308c\u3066\u3044\u307e\u3059)<a href=\"http:\/\/pecl.php.net\/package\/APC\">APC<\/a>\u3084<a href=\"http:\/\/eaccelerator.net\/\">eAccelerator<\/a>\u3092\u5229\u7528\u3057\u3066\u300c\u3046\u3093\u3001\u7d50\u69cb\u901f\u304f\u306a\u3063\u305f\u300d\u3068\u3044\u3046\u3068\u3053\u308d\u3067\u6e80\u8db3\u3057\u3066\u3057\u307e\u3044\u304c\u3061\u3067\u3059(\u6700\u8fd1core\u6570\u3082\u5897\u3048\u308b\u4e00\u65b9\u3067\u3059\u3057)\u3002<\/p>\n<p>\u3057\u304b\u3057\u306a\u304c\u3089\u3001\u5f53\u7136\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u3082\u901f\u3051\u308c\u3070\u901f\u3044\u307b\u3069\u3088\u3044\u308f\u3051\u3067\u3059\u3002\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u901f\u3044\u307b\u3046\u304c\u6e80\u8db3\u5ea6\u3082\u4e0a\u304c\u308b\u3067\u3057\u3087\u3046\u3057\u3001\u306a\u306b\u3088\u308a1\u30ea\u30af\u30a8\u30b9\u30c8\u3042\u305f\u308a\u3067\u5229\u7528\u3059\u308b\u30de\u30b7\u30f3\u30ea\u30bd\u30fc\u30b9(\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u306e\u5834\u5408\u306f\u5f80\u3005\u306b\u3057\u3066cpu\u30ea\u30bd\u30fc\u30b9)\u304c\u5c11\u306a\u3051\u308c\u3070\u3001\u30b5\u30fc\u30d0\u306e\u53f0\u6570\u3082\u5c11\u306a\u304f\u3066\u3059\u307f\u307e\u3059\u3002\u4f8b\u3048\u3070\u4eca\u30b5\u30fc\u30d020\u53f0\u3067\u52d5\u304b\u3057\u3066\u3044\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c2\u500d\u901f\u304f\u306a\u308c\u3070\u30b5\u30fc\u30d0\u309210\u53f0\u306b\u6e1b\u3089\u305b\u308b(\u304b\u3082\u3057\u308c\u306a\u3044)\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u30021\u53f0\u00a540,000\/month\u3068\u304b\u3060\u3068\u3059\u308b\u3068\u00a5400,000\u3082\u30b3\u30b9\u30c8\u304c\u4e0b\u304c\u308a\u307e\u3059\u3057\u3001\u3053\u308c\u304c1,000\u53f0\u3068\u304b\u3060\u3068\u5f71\u97ff\u306f\u3055\u3089\u306b\u5927\u304d\u304f\u306a\u308a\u307e\u3059\u3002\u4f55\u306b\u3057\u3066\u3082\u3001\u901f\u3044\u3053\u3068\u306f\u3044\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_2\"> \u3069\u3053\u3092\u901f\u304f\u3057\u307e\u3057\u3087\u3046\uff1f<\/h3>\n<p>\u3068\u306f\u3044\u3048\u3001\u901f\u304f\u3057\u3088\u3046\u3068\u601d\u3063\u305f\u3089\u901f\u304f\u306a\u308b\u308f\u3051\u3067\u3082\u306a\u3044\u306e\u3067\u3001\u3044\u308d\u3044\u308d\u3068\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002\u3067\u3001\u3068\u308a\u3042\u3048\u305arequire\u306e\u30b3\u30b9\u30c8\u3063\u3066(\u305f\u3068\u3048\u30b3\u30f3\u30d1\u30a4\u30eb\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3082)\u7d50\u69cb\u9ad8\u3044\u3088\u306a\u30fc\u3001\u3068\u3044\u3046\u304bGREE\u306f\u30b7\u30b9\u30c6\u30e0\u3068\u3057\u3066\u7d50\u69cb\u6b74\u53f2\u304c\u9577\u3044\u4e0a\u306b\u62e1\u5f35\u3092\u7d9a\u3051\u3066\u3044\u308b\u306e\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u6570\u304c\u81a8\u5927\u306a\u306e\u3067\u3084\u306f\u308a\u3053\u306e\u30b3\u30b9\u30c8\u306f\u3070\u304b\u306b\u306a\u3089\u306a\u3044\u306a\u3001\u3068\u601d\u3044\u306f\u3058\u3081\u305f\u6b21\u7b2c\u3067\u3059\u3002\u6b63\u78ba\u306b\u3044\u3046\u3068\u3001\u524d\u304b\u3089\u305a\u3063\u3068\u601d\u3063\u3066\u305f\u3093\u3067\u3059\u304c\u7279\u306b\u4f55\u3082\u3057\u3066\u3053\u306a\u304b\u3063\u305f\u3068\u3044\u3046\u3053\u3068\u306a\u3093\u3067\u3059\u304c\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3068\u308a\u3042\u3048\u305a\u3082\u306e\u3059\u3054\u3044\u30b7\u30f3\u30d7\u30eb\u306a\u4f8b\u3067\u8a66\u3057\u3066\u307f\u307e\u3059\u3002\u307e\u305a\u4f55\u3082\u3057\u306a\u3044\u3072\u3068(A\u3068\u3057\u307e\u3059):<\/p>\n<pre class=\"superpre php\">\n<?php\n\/\/ \u4ee5\u4e0a\u304a\u308f\u308a<\/pre>\n<p>\u3053\u308c\u3068\u3001require\u30921\u56de\u3059\u308b\u3072\u3068(B\u3068\u3057\u307e\u3059):<\/p>\n<pre class=\"superpre php\">\n<?php\nrequire_once 'b-1.php';\n\/\/ 1\u884c\u3075\u3048\u305f<\/pre>\n<p>\u6700\u5f8c\u306b\u3001require\u3055\u308c\u308b\u30d5\u30a1\u30a4\u30eb:<\/p>\n<pre class=\"superpre php\">\n<?php\n\/\/ \u306a\u3093\u3068\u306a\u304farray()\u30921000\u884c\u304f\u3089\u3044\u66f8\u3044\u3066\u307f\u307e\u3059\n$bar = array(\n    'key1' => 'value1',\n    'key2' => 'value2',\n...\n    'key1000' => 'value1000',\n);<\/pre>\n<p>\u3082\u3046\u3053\u306e\u6642\u70b9\u3067\u300c\u3044\u3084\u3044\u3084require\u306f\u7d76\u5bfe\u30d1\u30b9\u3067\u66f8\u304f\u3060\u308d\u3001\u5e38\u8b58\u7684\u306b\u300d\u3068\u304b\u300cautoload\u3058\u3083\u306a\u3044\u306e\uff1f\u300d\u3068\u304b\u300c&lt;?php\u3001\u306d\u300d\u3068\u304b\u3044\u308d\u3044\u308d\u805e\u3053\u3048\u3066\u304d\u305d\u3046\u3067\u3059\u304c\u3001\u805e\u3053\u3048\u306a\u3044\u30d5\u30ea\u3067\u3059\u3002\u3068\u3044\u3046\u304b\u5225\u306brequire\u3059\u308b\u5fc5\u8981\u3082\u306a\u304f\u3066\u76f4\u63a5\u304b\u3051\u3070\u3044\u3044\u306e\u3067\u3059\u304c\u3002<\/p>\n<p>\u3067\u3001\u3053\u308c\u3092PHP 5.2.6 w\/ eAccelerator 0.9.6\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30de\u30b7\u30f3(Intel Core2Duo 2.20GHz x 2)\u3067\u3001\u539f\u59cb\u7684\u306bab -c 4 -n 1000\u304f\u3089\u3044\u3057\u3066\u307f\u308b\u3068<\/p>\n<pre class=\"superpre \">\n A: Requests per second:    4340.75 [#\/sec] (mean)\n B: Requests per second:    1670.98 [#\/sec] (mean)<\/pre>\n<p>\u3068\u304b\u306b\u306a\u308a\u307e\u3059\u3002\u8abf\u5b50\u306b\u306e\u3063\u306610,000\u884c\u304f\u3089\u3044\u3042\u308barray()\u3060\u3051\u3092\u66f8\u3044\u305f\u30d5\u30a1\u30a4\u30eb(C\u3068\u3057\u307e\u3059)\u3092require\u3057\u3066\u307f\u308b\u3068(\u3044\u3084\u3060\u304b\u3089\u76f4\u63a5\u66f8\u3044\u3066\u3082\u3044\u3044\u3093\u3067\u3059\u304c)<\/p>\n<pre class=\"superpre \">\n C: Requests per second:    270.11 [#\/sec] (mean)<\/pre>\n<p>\u9806\u8abf\u306b\u9045\u304f\u306a\u308a\u307e\u3059\u3002\u4eca\u5ea6\u306freturn true\u3059\u308b\u3060\u3051\u306e\u30e1\u30bd\u30c3\u30c9\u304c10,000\u3042\u308b\u30af\u30e9\u30b9\u304c\u8a18\u8ff0\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb(D\u3068\u3057\u307e\u3059)\u3092require\u3057\u3066\u307f\u308b\u3068<\/p>\n<pre class=\"superpre \">\n D: Requests per second:    178.17 [#\/sec] (mean)<\/pre>\n<p>\u3068\u306a\u3063\u3066\u304d\u307e\u3059\u3002\u610f\u5916\u306b\u5f71\u97ff\u3059\u308b\u3093\u3067\u3059\u306d\u30fc\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u306a\u3093\u3068\u306a\u304f\u30b0\u30e9\u30d5\u306b\u3059\u308b\u3068\u3053\u3093\u306a\u72b6\u6cc1\u3067\u3059:<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2010\/05\/61\/gfp-graph-1\/\" rel=\"attachment wp-att-66\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-1.png\" alt=\"\" title=\"gfp-graph-1\" width=\"564\" height=\"291\" class=\"aligncenter size-full wp-image-66\" \/><\/a><\/p>\n<p>\u3068\u3001\u3044\u3046\u3053\u3068\u3067\u300c\u3060\u3063\u305f\u3089\u3001require\u3060\u3051\u3057\u3066(socket\u304b\u4f55\u304b\u3067)\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u5f85\u3063\u3066\u3044\u308b\u3072\u3068\u304c\u3044\u308c\u3070\u901f\u304f\u306a\u308b\u3093\u3058\u3083\u306a\u3044\uff1f\u300d\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u3002mod_perl\u3068\u304b\u3001\u305d\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<h3 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_3\"> Gree Fast Processor<\/h3>\n<p>\u524d\u632f\u308a\u304c\u601d\u3044\u307b\u304b\u9577\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u304c\u3001\u3088\u3046\u3084\u304f\u672c\u984c\u3067\u3059\u3002\u306a\u3093\u3068\u306a\u304f\u901f\u304f\u306a\u308a\u305d\u3046...\u304b\u3082\u3057\u308c\u306a\u3044\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u300crequire\u3057\u3066\u307e\u3063\u3066\u3044\u308b\u3072\u3068\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u3066\u307f\u308b\u300d\u4ed5\u7d44\u307f\u3067\u672c\u5f53\u306b\u901f\u304f\u306a\u308b\u306e\u304b\u6c17\u306b\u306a\u3063\u3066\u3057\u304b\u305f\u306a\u304f\u306a\u3063\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u300cGree Fast Processor\u300d\u3068\u540d\u3065\u3051\u3066\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u52d5\u4f5c\u30a4\u30e1\u30fc\u30b8\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059:<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2010\/05\/61\/gree_fast_processor\/\" rel=\"attachment wp-att-75\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gree_fast_processor-554x400.png\" alt=\"\" title=\"Gree Fast Processor Image\" width=\"554\" height=\"400\" class=\"aligncenter size-medium wp-image-75\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gree_fast_processor-554x400.png 554w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gree_fast_processor-276x200.png 276w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gree_fast_processor.png 615w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/a><\/p>\n<p>\u3068\u3001\u3053\u308c\u3060\u3051\u3067\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u9069\u5f53\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u8a66\u3057\u3066\u307f\u307e\u3059\u3002GREE\u3067\u8a66\u3057\u305f\u4f8b\u3092\u304a\u898b\u305b\u3067\u304d\u308c\u3070\u697d\u3057\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u5b9f\u969b\u306b\u8a66\u3057\u3084\u3059\u3044\u3088\u3046\u306b\u3068\u3044\u3046\u3053\u3068\u3067\u3001<a href=\"http:\/\/www.symfony-project.org\/\">symfony<\/a>\u3067\u4f5c\u3089\u308c\u3066\u3044\u308bURL\u77ed\u7e2e\u30b5\u30fc\u30d3\u30b9:<a href=\"http:\/\/xav.cc\/\">xav.cc<\/a>\u3092\u4f8b\u306bGree Fast Processor\u3092\u4eca\u56de\u306e\u5bfe\u8c61\u306b\u3057\u3066\u307f\u307e\u3059(\u305f\u307e\u305f\u307e\u898b\u3064\u3051\u307e\u3057\u305f)\u3002<\/p>\n<h4 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_4\"> \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>\u672c\u984c\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u7d30\u304b\u3044\u3068\u3053\u308d\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u3082\u308d\u3082\u308d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u307e\u305a\u306fxav.cc\u3067\u3059:<\/p>\n<pre class=\"superpre \">\n$ svn co https:\/\/opensource.lacot.org\/xav.cc\/svn\/trunk\/ \/path\/to\/project\/\n$ cp config\/app.yml-dist config\/app.yml; mv config\/databases.yml-dist config\/databases.yml\n(\u9069\u5f53\u306b\u7de8\u96c6)\n$ .\/symfony doctrine:build --all\n$ chmod 777 cache log<\/pre>\n<p>\u304b\u3093\u305f\u3093\u3067\u3059\u3002\u6b21\u306bextension\u3068\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u81ea\u5206\u3067\u3082\u8a66\u3057\u3066\u307f\u305f\u3044\u3001\u3068\u3044\u3046\u4e00\u98a8\u5909\u308f\u3063\u305f\u304b\u305f\u306f\u3001<a href=\"http:\/\/labs.gree.jp\/data\/source\/gree_fast_processor-0.0.1.tgz\">\u3053\u3061\u3089<\/a>\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u3042\u308b\u306e\u3067\u3054\u5229\u7528\u304f\u3060\u3055\u3044(\u3061\u306a\u307f\u306b\u3001\u307e\u3060\u3082\u306e\u3059\u3054\u3044\u52e2\u3044\u3067\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u306a\u306e\u3067\u3001\u4f55\u3082\u4fdd\u8a3c\u3067\u304d\u307e\u305b\u3093\u3057\u3001\u30b3\u30fc\u30c9\u3082gdgd\u3067\u3059)\u3002<\/p>\n<pre class=\"superpre \">\n$ tar zxvf gree_fast_processor-0.0.1.tgz\n$ cd gree_fast_processor-0.0.1\/\n$ phpize; .\/configure; make; sudo make install\n$ cp gree_fast_processor.php gree_fast_processor_listener.php \/path\/to\/project\/lib\/vendor\/gree\/<\/pre>\n<p>\u3075\u3064\u3046\u3067\u3059\u3002\u3042\u3068\u306fphp.ini\u306bextension=gree_fast_processor.so\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u3057\u3066\u3001\u3068\u308a\u3042\u3048\u305a\u3053\u306e\u72b6\u614b\u3067\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306eRequests Per Secod\u304c\u3069\u308c\u304f\u3089\u3044\u3067\u308b\u304b\u307f\u3066\u307f\u308b\u3068<\/p>\n<pre class=\"superpre \">\nRequests per second:    63.12 [#\/sec] (mean)<\/pre>\n<p>\u307e\u3041\u3053\u3093\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<h4 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_5\"> index.php<\/h4>\n<p>\u3064\u304e\u306b\u4e0a\u306e\u56f3\u306eindex.php\u306b\u3042\u305f\u308b\u90e8\u5206\u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002symfony\u306f\u3059\u3079\u3066\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092index.php\u3067\u53d7\u3051\u308b\u306e\u3067\u975e\u5e38\u306b\u90fd\u5408\u304c\u3088\u3044\u3067\u3059(\/path\/to\/project\/web\/frontend\/index.php):<\/p>\n<pre class=\"superpre php\">\n  2 require_once '\/path\/to\/project\/lib\/vendor\/gree\/gree_fast_processor.php';\n  3 \n  4 if (Gree_Fast_Processor::run('xav') == false) {\n  5     require_once(dirname(__FILE__).'\/..\/..\/config\/ProjectConfiguration.class.php');\n  6 \n  7     $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);\n  8     sfContext::createInstance($configuration)->dispatch();\n  9 }<\/pre>\n<p>5-8\u884c\u76ee\u304c\u30aa\u30ea\u30b8\u30ca\u30eb\u306a\u51e6\u7406\u3067\u3059\u3002\u8ffd\u52a0\u3057\u3066\u3044\u308b\u306e\u306fGree Fast Processor\u306ePHP\u30e9\u30a4\u30d6\u30e9\u30ea\u306erequire\u3068Gree_Fast_Proessor::run()\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3073\u51fa\u3057\u306e\u307f\u3067\u3059\u3002\u3053\u306e\u72b6\u614b\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001listener\u306e\u30bd\u30b1\u30c3\u30c8\u304c\u5b58\u5728\u305b\u305a\u306brun()\u304cfalse\u3092\u8fd4\u3059\u306e\u3067\u4eca\u307e\u3067\u3069\u304a\u308a\u306e\u51e6\u7406\u304c\u884c\u308f\u308c\u307e\u3059\u3001\u5b89\u5fc3\u3067\u3059\u3002<\/p>\n<p>\u3044\u305a\u308c\u306b\u305b\u3088\u3001\u3053\u306erun()\u30e1\u30bd\u30c3\u30c9\u304c\u3001\u56f3\u306eunix domain socket\u3092\u901a\u3058\u305flistener\u3068\u306eI\/O\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_6\"> listener<\/h4>\n<p>\u6b21\u306b\u4e0a\u8a18run()\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u4ed8\u3051\u308blistener\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002\u305d\u306e\u524d\u306b\u3001run()\u306b\u5f15\u6570\u3067\u6e21\u3055\u308c\u308b\u8b58\u5225\u5b50\u3068handler\u3068\u306e\u95a2\u9023\u3092gree_fast_processor.php\u306b\u8a18\u8ff0\u3057\u3066\u304a\u304d\u307e\u3059:<\/p>\n<pre class=\"superpre php\">\n 23     var $ident_list = array(\n 24         'xav'   => '\/path\/to\/project\/lib\/vendor\/gree\/gree_fast_processor_handler.php',\n 25     ); <\/pre>\n<p>\u3042\u3068\u306flistener\u3092\u8d77\u52d5\u3057\u307e\u3059(\u4e0a\u306e\u56f3\u306egree_fast_processor_listener\u306e\u90e8\u5206\u3067\u3059)\u3002\u3053\u308c\u3067unix domain socket\u304c\u4f5c\u6210\u3055\u308c\u3001run()\u3092\u901a\u3058\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059(\u304c\u3001\u5b9f\u969b\u306b\u306fhandler\u304c\u306a\u3044\u306e\u3067\u4f55\u3082\u8d77\u3053\u308a\u307e\u305b\u3093)\u3002<\/p>\n<pre class=\"superpre \">\n$ \/path\/to\/project\/lib\/vendor\/gree\/gree_fast_processor_listener.php --start --concurrency=4 --max-request=1024 --ident=xav<\/pre>\n<h4 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_7\"> handler<\/h4>\n<p>\u6700\u5f8c\u306b\u3001listener\u304c\u53d7\u3051\u4ed8\u3051\u305f\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3059\u308bhandler\u3092\u6e96\u5099\u3057\u307e\u3059\u3002listener\u306f\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u4ed8\u3051\u308b\u3068\u3001concurrency\u306e\u6570\u3060\u3051\u8d77\u52d5\u3055\u308c\u3066\u3044\u308bhandler\u306e\u3069\u308c\u304b\u306brequest\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u3061\u3087\u3063\u3068\u9577\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u304c\u8cbc\u3063\u3066\u3057\u307e\u3046\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059:<\/p>\n<pre class=\"superpre php\">\n  3 require_once '\/path\/to\/lib\/vendor\/gree\/gree_fast_processor.php';\n  4 $gfp = new Gree_Fast_Processor(); $gfp->initialize();\n  5 \/\/ requires (anything you want)\n  6 require_once '\/path\/to\/project\/config\/ProjectConfiguration.class.php';\n  7 for (;;) {\n  8     $gfp->startup();\n  9     $request = $gfp->getRequest();\n 10     ob_start(null);\n 11     $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);\n 12     sfContext::createInstance($configuration)->dispatch();\n 13     $content = ob_get_contents();\n 14     ob_end_clean();\n 15     $gfp->setResponse($content, strlen($content));\n 16     $gfp->shutdown();\n 17 }<\/pre>\n<p>handler\u306f\u8d77\u52d5\u3055\u308c\u308b\u30689\u884c\u76ee\u306egetRequest()\u3067listener\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u5f85\u3061\u307e\u3059\u3002\u3067\u300111-12\u884c\u76ee\u306b\u66f8\u3044\u3066\u3042\u308b\u51e6\u7406\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3054\u3068\u306b\u5b9f\u884c\u3057\u3066\u3001\u51fa\u529b\u3092listener\u306b\u8fd4\u3059\u3053\u3068\u3067\u3001\u3050\u308b\u3050\u308b\u3068\u51e6\u7406\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_8\"> \u30d9\u30f3\u30c1\u30de\u30fc\u30af<\/h4>\n<p>\u3068\u308a\u3042\u3048\u305aab\u3057\u3066\u307f\u308b\u3068:<\/p>\n<pre class=\"superpre \">\nRequests per second:    107.98 [#\/sec] (mean)<\/pre>\n<p>\u3093\u30fc\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3060\u30682\u500d\u307e\u3067\u306f\u3044\u304b\u306a\u3044\u3067\u3059\u304c\u3001\u901f\u304f\u306f\u306a\u308b\u307f\u305f\u3044\u3067\u3059\u3002\u7d50\u69cb\u8352\u3044\u30c7\u30fc\u30bf\u3067\u3059\u304c\u3001\u4e26\u5217\u65701\u301c8\u3067Requests per Second\u3092\u307f\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f:<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2010\/05\/61\/gfp-graph-2\/\" rel=\"attachment wp-att-90\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-2.png\" alt=\"\" title=\"gfp-graph-2\" width=\"550\" height=\"291\" class=\"aligncenter size-full wp-image-90\" \/><\/a><\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u4ed5\u7d44\u3060\u3068\u30b3\u30fc\u30c9\u304c\u591a\u3051\u308c\u3070\u591a\u3044\u307b\u3069\u901f\u304f\u306a\u308b\u306f\u305a\u3067(\u9006\u306b\u3001\u30b3\u30fc\u30c9\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3082\u51e6\u7406\u304c\u91cd\u3044\u30b1\u30fc\u30b9\u3067\u306f\u3042\u307e\u308a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5411\u4e0a\u306f\u671f\u5f85\u3067\u304d\u307e\u305b\u3093)\u3001\u3068\u3042\u308b\u30b5\u30fc\u30d0\u3092\u501f\u308a\u3066\u3001\u3068\u3042\u308b\u91cd\u3081\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3092\u4ee5\u524d\u3068\u3063\u3066\u307f\u308b\u3068\u30017\u500d\u4ee5\u4e0a\u901f\u304b\u3063\u305f\u308a\u3057\u307e\u3057\u305f(\u305f\u3076\u3093\u3053\u306e\u3042\u305f\u308a\u304cbest case\u3067\u3059\u306d)\u3002<\/p>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/2010\/05\/61\/gfp-graph-3\/\" rel=\"attachment wp-att-93\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-3-600x280.png\" alt=\"\" title=\"gfp-graph-3\" width=\"600\" height=\"280\" class=\"aligncenter size-medium wp-image-93\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-3-600x280.png 600w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2010\/05\/gfp-graph-3.png 816w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3 id=\"hs_9f5b2de33b095c9584a895aee53fa79e_header_9\"> \u3055\u3044\u3054\u306b (\u3068\u6ce8\u610f\u70b9)<\/h3>\n<p>\u3053\u3053\u307e\u3067\u8aad\u3093\u3067\u3044\u305f\u3060\u3044\u305f\u76f8\u5f53\u306b\u8f9b\u62b1\u5f37\u3044\u7686\u69d8\u306f\u304a\u6c17\u3065\u304d\u306e\u901a\u308a\u3001Gree Fast Processor\u306f\u65e2\u5b58\u306e\u30b3\u30fc\u30c9\u3092\u307b\u3068\u3093\u3069\u5909\u66f4\u305b\u305a\u306b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u3044\u304f\u3064\u304b\u306e\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\n static\u5909\u6570\u3084global\u5909\u6570\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3054\u3068\u306b\u30af\u30ea\u30a2\u3055\u308c\u307e\u305b\u3093<\/p>\n<ul>\n<li> \u306a\u306e\u3067\u3001\u304a\u884c\u5100\u3088\u304f(\u3042\u308b\u3044\u306f\u3042\u308b\u7a0b\u5ea6\u610f\u8b58\u3057\u3066)\u30b3\u30fc\u30c9\u3092\u304b\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/li>\n<li> global\u5909\u6570\u306funset()\u3057\u307e\u304f\u308c\u3070\u3044\u3044\u3093\u3067\u3059\u304c\u3001static\u5909\u6570\u3092\u521d\u671f\u5024\u306b\u623b\u3059\u306e\u306f\u7d50\u69cb\u9762\u5012\u306a\u306e\u3067\u3084\u3063\u3066\u3044\u307e\u305b\u3093 (zend_extension\u3092\u66f8\u3051\u3070\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u304c\u3001\u305d\u308c\u3082\u3069\u3046\u304b\u3001\u3068\u3044\u3046)<\/li>\n<li> \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3059\u308b\u30b3\u30fc\u30c9\u4e2d\u3067define()\u3057\u3066\u3044\u308b\u30682\u56de\u76ee\u4ee5\u964dwarning\u304c\u51fa\u307e\u3059 (undef()\u306f\u5b9f\u88c5\u306f\u7c21\u5358\u306a\u306e\u3067\u3059\u304c...)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>\n exit()\u3057\u3066\u3044\u308b\u3068\u53f0\u306a\u3057\u3067\u3059<\/p>\n<ul>\n<li> \u305f\u3060\u3001\u305d\u306e\u5834\u5408run()\u304b\u3089false\u304c\u8fd4\u308b\u306e\u3067\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u51e6\u7406\u3055\u308c\u307e\u3059<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>\n header()\u95a2\u6570\u3084session\u306f\u3069\u3046\u3059\u308b\u306e\uff1f<\/p>\n<ul>\n<li> Gree_Fast_Processor::header()\u3092\u3064\u304b\u3048\u3070\u5927\u4e08\u592b\u3067\u3059<\/li>\n<li> session\u3082session_cache_limiter(false)\u306a\u3089\u554f\u984c\u3042\u308a\u307e\u305b\u3093 (\u540c\u69d8\u306e\u6a5f\u80fd\u306f\u3061\u3087\u3063\u3068\u304c\u3093\u3070\u308c\u3070\u5b9f\u73fe\u3067\u304d\u308b\u3093\u3067\u3059\u304c\u307e\u3060\u3084\u3063\u3066\u306a\u3044\u3060\u3051\u306a\u72b6\u614b\u3067\u3059)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5b89\u5b9a\u52d5\u4f5c\u306b\u306f\u3082\u3046\u5c11\u3057\u30c6\u30b9\u30c8\u306a\u3069\u304c\u5fc5\u8981\u3067\u3059\u304c\u3001\u3046\u307e\u304f\u306f\u307e\u308b\u30b1\u30fc\u30b9\u306a\u3089\u5272\u3068\u4f4e\u3044\u52b4\u529b\u3067\u6570\u500d\u901f\u304f\u306a\u308b\u3001\u304b\u3082\u3001\u3057\u308c\u307e\u305b\u3093(\u500b\u4eba\u7684\u306b\u306f<a href=\"http:\/\/developers.facebook.com\/blog\/post\/358\">HipHop for PHP<\/a>\u3088\u308a\u3082\u4f7f\u3048\u308b\u30b1\u30fc\u30b9\u306f\u3042\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u304b\u601d\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u3082\u305d\u3082\u9ad8\u901f\u5316\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u5168\u304f\u4ee5\u3066\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u304c)\u3002<\/p>\n<p>\u305f\u3060\u3001\u307e\u3060\u73fe\u72b6\u306f\u300c\u307b\u3093\u3068\u306b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3067\u308b\u306e\u304b\u3068\u308a\u3042\u3048\u305a\u5b9f\u88c5\u3057\u3066\u8a66\u3057\u3066\u307f\u305f\u7248\u300d\u306a\u306e\u3067\u3001\u4eba\u67f1\u3055\u3093\u3084\u30d1\u30c3\u30c1\u3001\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u6700\u5f8c\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001GREE Engineers' Blog\u3092\u4eca\u5f8c\u3068\u3082\u3088\u308d\u3057\u304f\u304a\u306d\u304c\u3044\u3057\u307e\u3059:)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3054\u3042\u3044\u3055\u3064\u30a8\u30f3\u30c8\u30ea\u3060\u3051\u3068\u3044\u3046\u306e\u3082\u306a\u3093\u306a\u306e\u3067\u3001\u5f15\u304d\u7d9a\u304dfujimoto\u3067\u3059\u3002\u5b9f\u8cea\u4e0a1\u3064\u3081\u306e\u3088\u3046\u306a\u6c17\u304c\u3059\u308b\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u3067\u306f\u3001PHP\u304c3\u500d\u304f\u3089\u3044(\u5c11\u306a\u304f\u3068\u30822\u500d\u304f\u3089\u3044\u306f...)\u901f\u304f\u306a\u308bGree Fast Processor\u3068\u3044 [&hellip;]<\/p>\n","protected":false},"author":112,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[8],"class_list":["post-61","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-info","tag-php"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/61","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\/112"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":21124,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions\/21124"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}