{"id":1421,"date":"2015-01-03T01:16:27","date_gmt":"2015-01-02T16:16:27","guid":{"rendered":"http:\/\/tech.akat.info\/?p=1421"},"modified":"2015-01-03T23:47:17","modified_gmt":"2015-01-03T14:47:17","slug":"mod_fcgid","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=1421","title":{"rendered":"mod_fcgid"},"content":{"rendered":"<h1>\u6982\u8981<\/h1>\n<p>apache\u3067\u306fFastCGI\u3092fcgid\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<br \/>\nfastcgi(mod_fastcgi)\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u3042\u308b\u304c\u3001\u554f\u984c\u304c\u3042\u308b\u3089\u3057\u304f\u5f8c\u767a\u306efcgid\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u8a18\u8f09\u3059\u308b<\/p>\n<h1>FastCGI\u3068\u306f<\/h1>\n<p>CGI\u306f\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u8981\u6c42\u304c\u3042\u308b\u5ea6\u306b\u30d7\u30ed\u30bb\u30b9\u306e\u751f\u6210\u3068\u7834\u68c4\u304c\u884c\u308f\u308c\u308b<br \/>\nFastCGI\u306f\u30d7\u30ed\u30bb\u30b9\u3092\u30e1\u30e2\u30ea\u4e0a\u306b\u6c38\u7d9a\u5316\u3055\u305b\u308b\u3053\u3068\u3067\u3001\u305d\u306e\u8d77\u52d5\u3068\u7d42\u4e86\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u30ab\u30c3\u30c8\u3057<br \/>\n\u7d50\u679c\u3068\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u52d5\u4f5c\u901f\u5ea6\u306e\u5411\u4e0a\u304a\u3088\u3073\u30b5\u30fc\u30d0\u8ca0\u8377\u306e\u4f4e\u4e0b\u3092\u5b9f\u73fe\u3059\u308b<br \/>\n\u5177\u4f53\u7684\u306b\u306f\u3001\u3042\u3089\u304b\u3058\u3081\u8907\u6570\u306e CGI \u30d7\u30ed\u30bb\u30b9\u3092\u5f85\u6a5f\u72b6\u614b\u3067\u8d77\u52d5\u3057\u3066\u304a\u304f<br \/>\n\u305d\u3057\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u3042\u3063\u305f\u3068\u304d\u306b\u305d\u306e\u4e2d\u306e\u3072\u3068\u3064\u3092\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3057\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3001\u7d50\u679c\u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u8fd4\u5374\u3059\u308b<br \/>\n\u5b9f\u884c\u3057\u7d42\u308f\u3063\u305f\u30d7\u30ed\u30bb\u30b9\u306f\u518d\u3073\u5f85\u6a5f\u72b6\u614b\u306b\u306a\u308a(\u3064\u307e\u308afork\/exec\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u304c\u53d6\u308a\u9664\u304b\u308c\u308b)\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u5f85\u3064<br \/>\n(fcgid-script\u3068\u3057\u3066\u30cf\u30f3\u30c9\u30e9\u30fc\u306b\u6e21\u3055\u308c\u305f\u3082\u306e\u306f\u3001FastCGI\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u51e6\u7406\u3055\u308c\u308b)<br \/>\n(FastCGI\u30d7\u30ed\u30bb\u30b9\u306fhttpd\u306e\u52d5\u3044\u3066\u3044\u308b\u5225\u306e\u30b5\u30fc\u30d0\u3067\u52d5\u304b\u3059\u3053\u3068\u3082\u53ef\u80fd)<br \/>\n\u6b20\u70b9\u3068\u3057\u3066\u3001FastCGI\u306b\u3088\u3063\u3066\u8d77\u52d5\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u30ea\u30bd\u30fc\u30b9\u3092\u6d88\u8cbb\u3057\u7d9a\u3051\u308b<br \/>\n\u7d99\u7d9a\u7684\u306b\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u3082\u3001\u7ba1\u7406\u8005\u304c\u3072\u3068\u3064\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3069\u308c\u304f\u3089\u3044\u30ea\u30bd\u30fc\u30b9\u3092\u6d88\u8cbb\u3059\u308b\u304b\u3092\u8003\u3048\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044<\/p>\n<h1>\u74b0\u5883<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@hostname:\/home\/shimizu# uname -a\r\nLinux hostname 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u2 x86_64 GNU\/Linux\r\nroot@hostname:\/home\/shimizu# apache2 -v\r\nServer version: Apache\/2.2.22 (Debian)\r\nServer built:   Jul 24 2014 15:34:00\r\nroot@hostname:\/home\/shimizu# php-cgi -v\r\nPHP 5.4.36-0+deb7u1 (cgi-fcgi) (built: Dec 31 2014 07:33:54)\r\nCopyright (c) 1997-2014 The PHP Group\r\nZend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies\r\nroot@hostname:\/home\/shimizu# aptitude search mod-fcgi | grep ^i\r\ni   libapache2-mod-fcgid            - an alternative module compat with mod_fast\r\ni   libapache2-mod-fcgid-dbg        - debugging symbols for mod_fcgid\r\nroot@hostname:\/home\/shimizu# apache2ctl -M | grep cgi\r\nSyntax OK\r\n cgi_module (shared)\r\n fcgid_module (shared)\r\n<\/pre>\n<p><a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/01\/2015-01-03_010136.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/01\/2015-01-03_010136.png\" alt=\"2015-01-03_010136\" width=\"781\" height=\"266\" class=\"alignnone size-full wp-image-1422\" \/><\/a><\/p>\n<h1>\u8a2d\u5b9a<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@hostname:\/home\/shimizu# cat \/etc\/apache2\/mods-enabled\/fcgid.conf\r\n&lt;IfModule mod_fcgid.c&gt;\r\n  ### .php\u30d5\u30a1\u30a4\u30eb\u3068.fcgi\u30d5\u30a1\u30a4\u30eb\u304c\u3001fcgid-script\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3088\u3046\u306b\u306a\u308b\r\n  AddHandler    fcgid-script .php .fcgi\r\n  AddType application\/x-httpd-php .php\r\n  ### FastCGI\u306b\u6e21\u3059\u74b0\u5883\u5909\u6570\u540d\u3068\u5024\u3092\u6307\u5b9a\u3059\u308b\u3002\u3069\u3046\u3082php\u306e\u74b0\u5883\u5909\u6570\r\n  ### \u540c\u6642\u8d77\u52d5\u3059\u308b\u5b50\u30d7\u30ed\u30bb\u30b9\u6570\u30020\u3088\u308a\u5927\u304d\u3044\u5834\u5408\u3001PHP_FCGI_MAX_REQUESTS\u306f\u5b50\u30d7\u30ed\u30bb\u30b9\u306b\u95a2\u3057\u3066\u6709\u52b9\u3068\u306a\u308b\r\n  ### \u5b50\u30d7\u30ed\u30bb\u30b9\u304c\u8981\u6c42\u56de\u6570\u3092\u6e80\u305f\u3057\u3001\u81ea\u52d5\u7684\u306b\u7d42\u4e86\u3057\u3066\u3082\u89aa\u30d7\u30ed\u30bb\u30b9\u304c\u5b50\u30d7\u30ed\u30bb\u30b9\u3092\u518d\u8d77\u52d5\u3059\u308b\r\n  FcgidInitialEnv PHP_FCGI_CHILDREN 2\r\n  ### \u30ea\u30af\u30a8\u30b9\u30c8\u306e\u6570\u304c PHP_FCGI_MAX_REQUESTS \u306e\u5024\u306b\u9054\u3059\u308b\u3068\u3001 PHP \u306f\u30d7\u30ed\u30bb\u30b9\u3092 kill \u3059\u308b\r\n  FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 20\r\n  ### FastCGI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d7\u30ed\u30bb\u30b9\u306e\u6700\u5927\u6570\r\n  FcgidMaxProcesses 4\r\n  ### FastCGI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30af\u30e9\u30b9\u306b\u304a\u3051\u308b\u6700\u5927\u30d7\u30ed\u30bb\u30b9\u6570(Max process count of one class of FastCGI application)\r\n  FcgidMaxProcessesPerClass 1\r\n  ### FastCGI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30af\u30e9\u30b9\u306b\u304a\u3051\u308b\u6700\u5c0f\u30d7\u30ed\u30bb\u30b9\u6570(Min process count of one class of FastCGI application)\r\n  FcgidMinProcessesPerClass 1\r\n  ### \u4f7f\u7528\u3059\u308b\u30e9\u30c3\u30d1\u30fc\u3092\u6307\u5b9a\u3059\u308b\r\n  FcgidWrapper \/usr\/bin\/php-cgi .php\r\n  SocketPath \/var\/lib\/apache2\/fcgid\/sock\r\n  DefaultInitEnv PHPRC=\/etc\/php5\/cgi\r\n  ### windows\u306e\u305f\u3081\u306e\u5f85\u3061\u6642\u9593\u3002UNIX\u306b\u306f\u9069\u7528\u3055\u308c\u306a\u3044\r\n  FcgidConnectTimeout 20\r\n  ### FCGI\u30b5\u30fc\u30d0\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u3042\u3063\u3066\u304b\u3089\u3001\u5f85\u6a5f\u3092\u3057\u3066\u3044\u308b\u6642\u9593\u3002FastCGI\u30b5\u30fc\u30d0\u3078\u306e\u901a\u4fe1\u306e\u969b\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\r\n  ### \u5168\u3066\u306eFCGI\u3092\u4f7f\u7528\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u9069\u7528\u3055\u308c\u308b\u3002\u7279\u5b9a\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u307f\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\r\n  FcgidIOTimeout 3600\r\n  ### \u30a2\u30a4\u30c9\u30eb\u30d7\u30ed\u30bb\u30b9\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\r\n  FcgidIdleTimeout 300\r\n  ### \u30a2\u30a4\u30c9\u30eb\u30d7\u30ed\u30bb\u30b9\u304c\u306a\u3044\u304b\u3053\u306e\u9593\u9694\u3067\u76e3\u8996(FcgidIdleTimeout \u3068 FcgidProcessLifeTime\u3092\u76e3\u8996)\r\n  FcgidIdleScanInterval 120\r\n  ### \u3053\u306e\u671f\u9593\u7d4c\u904e\u3057\u305f\u3089\u3001FCGI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092kill\u3059\u308b\u3002\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u3092\u6b62\u3081\u308b\u305f\u3081\u306e\u6a5f\u69cb\r\n  FcgidBusyTimeout 600\r\n  ### FcgidBusyTimeout\u3092\u76e3\u8996\u3059\u308b\u9593\u9694\r\n  FcgidBusyScanInterval 120\r\n  ### \u4fdd\u7559\u4e2d\u306e\u30d7\u30ed\u30bb\u30b9\u306e\u7d42\u4e86\u3092\u51e6\u7406\u3059\u308b\u9593\u9694(FcgidIdleTimeout \u3068 FcgidProcessLifeTime\u3092\u8d85\u3048\u3066\u3044\u308b\u30d7\u30ed\u30bb\u30b9\u3092\u76e3\u8996)\r\n  FcgidErrorScanInterval 3\r\n  ### \u30be\u30f3\u30d3\u30d7\u30ed\u30bb\u30b9\u306e\u76e3\u8996\u9593\u9694\r\n  FcgidZombieScanInterval 3\r\n  ### \u30d7\u30ed\u30bb\u30b9\u304c\u751f\u6210\u3055\u308c\u308b\u969b\u306e\u901f\u5ea6\u3092\u8abf\u6574\u3059\u308b\u3002FCGI\u3054\u3068\u306b\u57fa\u6e96(\u30b9\u30b3\u30a2)\u304c\u5b58\u5728\u3057\u3001\u73fe\u5728\u306e\u5024\u304c\u3053\u306e\u57fa\u6e96\u4ee5\u4e0a\u3067\u3042\u308c\u3070\u65b0\u3057\u304f\u30d7\u30ed\u30bb\u30b9\u3092\u751f\u6210\u3057\u306a\u3044\r\n  FcgidSpawnScoreUpLimit 10\r\n  ### \u5404spawn\u306f\u30d7\u30ed\u30bb\u30b9\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u306e\u30b9\u30b3\u30a2\u306b\u3053\u306e\u5024\u3092\u8ffd\u52a0\r\n  FcgidSpawnScore 1\r\n  ### \u305d\u308c\u305e\u308c\u7d42\u4e86\u3057\u305f\u30d7\u30ed\u30bb\u30b9\u306f\u3001\u30d7\u30ed\u30bb\u30b9\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u306e\u30b9\u30b3\u30a2\u306b\u3053\u306e\u5024\u3092\u8ffd\u52a0\u3059\u308b\r\n  FcgidTerminationScore 2\r\n  ### \u5404FastCGI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u51e6\u7406\u3059\u308b\u6700\u5927\u30ea\u30af\u30a8\u30b9\u30c8\r\n  FcgidMaxRequestsPerProcess 0\r\n  ### \u6700\u5927HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u9577\u3055\r\n  FcgidMaxRequestLen 1073741824\r\n  ### \u30a2\u30a4\u30c9\u30eb\u30d7\u30ed\u30bb\u30b9\u306e\u5bff\u547d\u3002\u3082\u3057\u30d7\u30ed\u30bb\u30b9\u6570\u304cFcgidMinProcessesPerClass\u3092\u8d85\u3048\u3066\u304a\u308a\u3001\u3053\u306e\u5024\u3082\u8d85\u3048\u3066\u3044\u308c\u3070\u7d42\u4e86\u3059\u308b\r\n  FcgidProcessLifeTime 3600\r\n&lt;\/IfModule&gt;\r\n<\/pre>\n<p>\u30fbapache\u3092\u505c\u6b62\u3057\u305f\u3089\u3001php-cgi\u306e\u30d7\u30ed\u30bb\u30b9\u306f\u5168\u3066\u7d42\u4e86\u3059\u308b<br \/>\n\u30fb\u306a\u305c\u30d7\u30ed\u30bb\u30b9\u306e\u518d\u8d77\u52d5\u304c\u5fc5\u8981\u306a\u306e\u304b\u3068\u3044\u3046\u3068<br \/>\n\u3000PHP\u306e\u5834\u5408\u3001\u3069\u3046\u3057\u3066\u3082\u30e1\u30e2\u30ea\u304c\u81a8\u308c\u4e0a\u304c\u3063\u305f\u308a\u3001\u30ea\u30fc\u30af\u3059\u308b\u5371\u967a\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u3042\u308b\u7a0b\u5ea6\u51e6\u7406\u3057\u305f\u3089\u30d7\u30ed\u30bb\u30b9\u3092\u5165\u308c\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b<br \/>\n\u3000\u3057\u304b\u3057\u3001\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u305d\u308c\u306f\u3001PHP_FCGI_MAX_REQUESTS\u3092\u8d85\u3048\u305f\u51e6\u7406\u3092\u8981\u6c42\u3057\u305f\u5834\u5408\u3001<br \/>\n\u3000php-cgi\u306f\u3001\u8d85\u3048\u305f\u3068\u5224\u65ad\u3057\u305f\u3089\u51e6\u7406\u3092\u7121\u6761\u4ef6\u306b\u7d42\u4e86\u3059\u308b\u3002\u3064\u307e\u308a500\u3001503\u30a8\u30e9\u30fc\u3092\u51fa\u529b\u3059\u308b<br \/>\n\u3000\u56de\u907f\u7b56\u3068\u3057\u3066\u306f\u3001FcgidMaxRequestsPerProcess\u306bPHP_FCGI_MAX_REQUESTS\u306e\u6570\u5024\u4ee5\u4e0b\u306e\u6570\u5b57\u3092\u6307\u5b9a\u3057\u305f\u308a\u3001\u4e21\u65b9\u306e\u5909\u6570\u30920\u306b\u3059\u308b<br \/>\n\u30fb\u307e\u305f\u3001\u8981\u6c42\u6570\u3092\u7121\u99c4\u306a\u30ea\u30bd\u30fc\u30b9\u306a\u304f\u52b9\u7387\u7684\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5b50\u30d7\u30ed\u30bb\u30b9\u306f\u5229\u7528\u3059\u308b\u3079\u304d\u3067\u306a\u3044<br \/>\n\u3000mod_fcgid\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001PHP_FCGI_CHILDREN=0\u3067\u5b50\u30d7\u30ed\u30bb\u30b9\u3092\u7121\u52b9\u63a8\u5968<\/p>\n<h1>\u8a2d\u5b9a\u5185\u5bb9\u78ba\u8a8d<\/h1>\n<h2>PHP_FCGI_CHILDREN\u30fbPHP_FCGI_MAX_REQUESTS<\/h2>\n<p>1\u3064\u306ephp\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001(PHP_FCGI_CHILDREN\u304c\u6709\u52b9\u306a\u5834\u5408\u306f)PHP_FCGI_CHILDREN\u500b\u306e\u5b50\u30d7\u30ed\u30bb\u30b9\u304c\u4e00\u6c17\u306b\u8d77\u52d5\u3057<br \/>\n\u305d\u306ePHP_FCGI_CHILDREN\u500b\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u305d\u308c\u305e\u308cPHP_FCGI_MAX_REQUESTS\u4ef6\u51e6\u7406\u3059\u308b\u3068\u518d\u8d77\u52d5\u3059\u308b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@hostname:\/home\/shimizu# cat \/var\/www\/htdocs\/getpid.php\r\n&lt;?php\r\n        $PID=getmypid();\r\n        echo $PID.&quot;\\n&quot;;\r\n?&gt;\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/getpid.php\r\n7069\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/getpid.php\r\n7068\r\n\r\nroot@hostname:\/home\/shimizu# ps afx\r\n...\r\n 7043 ?        Ss     0:00 \/usr\/sbin\/apache2 -k start\r\n 7047 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 7066 ?        Ss     0:00  |   \\_ \/usr\/bin\/php-cgi\r\n 7068 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n 7069 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n 7049 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 7050 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n\r\n### \u305d\u308c\u305e\u308c20\u56de\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001PID\u304c\u5909\u66f4\u3057\u305f ###\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/getpid.php\r\n7068\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/getpid.php\r\n7069\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/getpid.php\r\n7120\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/getpid.php\r\n7122\r\nroot@hostname:\/home\/shimizu# ps afx\r\n...\r\n 7043 ?        Ss     0:00 \/usr\/sbin\/apache2 -k start\r\n 7047 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 7066 ?        Ss     0:00  |   \\_ \/usr\/bin\/php-cgi\r\n 7120 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n 7122 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n 7049 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 7050 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n<\/pre>\n<h2>FcgidBusyTimeout<\/h2>\n<p>120\u79d2\u4ee5\u4e0a\u304b\u304b\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u65bd\u3057\u3066\u307f\u308b<br \/>\n\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u529b\u3055\u308c\u3001\u5185\u90e8\u7684\u306bkill\u3055\u308c\u3066\u3044\u308b\u6a21\u69d8<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\nroot@hostname:\/home\/shimizu# cat \/var\/www\/htdocs\/time.php\r\n&lt;?php\r\n\/\/ \u73fe\u5728\u306e\u6642\u523b\r\necho date('l jS \\of F Y h:i:s A').&quot;\\n&quot; ;\r\n\/\/ 10 \u79d2\u9593\u9045\u5ef6\u3055\u305b\u308b\r\nsleep(240);\r\n\/\/ \u73fe\u5728\u306e\u6642\u523b\r\necho date('l jS \\of F Y h:i:s A').&quot;\\n&quot; ;\r\n?&gt;\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/time.php\r\nSaturday 3rd of January 2015 08:05:21 PM\r\nSaturday 3rd of January 2015 08:07:29 PM\r\n\r\n### \u30a8\u30e9\u30fc\u30ed\u30b0\u306b\u306f ###\r\n&#x5B;Sat Jan 03 20:07:29 2015] &#x5B;info] &#x5B;client 49.212.204.46] mod_fcgid: \/time.php took longer than busy timeout (120 secs)\r\n### \u3053\u306e\u9593\u306b\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u30a8\u30e9\u30fc ###\r\n&#x5B;Sat Jan 03 20:06:40 2015] &#x5B;warn] &#x5B;client 49.243.165.176] mod_fcgid: can't apply process slot for \/usr\/bin\/php-cgi\r\n<\/pre>\n<p>time.php\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u9593\u306b\u4ed6\u306ephp\u30d7\u30ed\u30b0\u30e9\u30e0\u306f503\u3068\u306a\u308b\u305f\u3081\u7406\u7531\u3092\u8ffd\u3063\u3066\u307f\u308b<br \/>\n\u3053\u306e\u9593html\u30d5\u30a1\u30a4\u30eb\u306f\u554f\u984c\u306a\u304f\u8fd4\u5374\u3055\u308c\u308b<br \/>\n\u8a66\u3057\u306b\u4ee5\u4e0b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u3088\u3046\u306bsleep\u3092\u5206\u5272\u3059\u308b\u3068\u3001\u9014\u4e2d\u3067kill\u3055\u308c\u305a\u5b9f\u884c\u3055\u308c\u305f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@hostname:\/home\/shimizu# cat \/var\/www\/htdocs\/time2.php\r\n&lt;?php\r\nfor ($i = 1; $i &lt;= 30; $i++) {\r\n\/\/ \u73fe\u5728\u306e\u6642\u523b\r\necho date('l jS \\of F Y h:i:s A').&quot;\\n&quot; ;\r\n\/\/ PID\u3092\u8868\u793a\r\n$PID=getmypid();\r\necho $PID.&quot;\\n&quot;;\r\n\/\/ 10 \u79d2\u9593\u9045\u5ef6\u3055\u305b\u308b\r\nsleep(10);\r\n}\r\n?&gt;\r\nroot@hostname:\/home\/shimizu# curl http:\/\/49.212.204.46\/time2.php\r\nSaturday 3rd of January 2015 08:49:14 PM\r\n8884\r\nSaturday 3rd of January 2015 08:49:24 PM\r\n8884\r\nSaturday 3rd of January 2015 08:49:34 PM\r\n8884\r\nSaturday 3rd of January 2015 08:49:44 PM\r\n8884\r\nSaturday 3rd of January 2015 08:49:54 PM\r\n8884\r\nSaturday 3rd of January 2015 08:50:04 PM\r\n8884\r\nSaturday 3rd of January 2015 08:50:14 PM\r\n8884\r\nSaturday 3rd of January 2015 08:50:24 PM\r\n8884\r\nSaturday 3rd of January 2015 08:50:34 PM\r\n8884\r\nSaturday 3rd of January 2015 08:50:44 PM\r\n8884\r\nSaturday 3rd of January 2015 08:50:54 PM\r\n8884\r\nSaturday 3rd of January 2015 08:51:04 PM\r\n8884\r\nSaturday 3rd of January 2015 08:51:14 PM\r\n8884\r\nSaturday 3rd of January 2015 08:51:21 PM\r\n8884\r\nSaturday 3rd of January 2015 08:51:31 PM\r\n8884\r\nSaturday 3rd of January 2015 08:51:41 PM\r\n8884\r\nSaturday 3rd of January 2015 08:51:51 PM\r\n8884\r\nSaturday 3rd of January 2015 08:52:01 PM\r\n8884\r\nSaturday 3rd of January 2015 08:52:11 PM\r\n8884\r\nSaturday 3rd of January 2015 08:52:21 PM\r\n8884\r\nSaturday 3rd of January 2015 08:52:31 PM\r\n8884\r\nSaturday 3rd of January 2015 08:52:41 PM\r\n8884\r\nSaturday 3rd of January 2015 08:52:51 PM\r\n8884\r\nSaturday 3rd of January 2015 08:53:01 PM\r\n8884\r\nSaturday 3rd of January 2015 08:53:11 PM\r\n8884\r\nSaturday 3rd of January 2015 08:53:21 PM\r\n8884\r\nSaturday 3rd of January 2015 08:53:31 PM\r\n8884\r\nSaturday 3rd of January 2015 08:53:41 PM\r\n8884\r\nSaturday 3rd of January 2015 08:53:51 PM\r\n8884\r\nSaturday 3rd of January 2015 08:54:01 PM\r\n8884\r\n<\/pre>\n<p>time2.php\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u9593\u3001\u5225\u30b3\u30f3\u30bd\u30fc\u30eb\u3067ps\u3092\u78ba\u8a8d\u3059\u308b\u3068<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306bphp-cgi\u304capache\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u306f\u306a\u304f\u3001\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u3068\u3057\u3066\u5b9f\u884c\u3055\u308c\u3066\u3044\u305f\u6a21\u69d8\u3002\u3002<br \/>\n\u305d\u306e\u305f\u3081mod_fcgid: \/time2.php took longer than busy timeout (120 secs) \u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u8868\u793a\u3055\u308c\u3066\u3044\u305f\u304c\u3001kill\u3055\u308c\u305a\u306b\u6700\u5f8c\u307e\u3067\u5b9f\u884c\u3055\u308c\u305f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n 8792 ?        Ss     0:00 \/usr\/sbin\/apache2 -k start\r\n 8796 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 8882 ?        Zs     0:00  |   \\_ &#x5B;php-cgi] &lt;defunct&gt;\r\n 8798 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 8862 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 8888 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 8891 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n 8884 ?        S      0:00 \/usr\/bin\/php-cgi\r\n<\/pre>\n<p>\u6700\u7d42\u7684\u306b\u3001<br \/>\n\u3000PHP_FCGI_CHILDREN=4<br \/>\n\u3000FcgidMaxProcesses=2<br \/>\n\u3000FcgidMaxProcessesPerClass=10<br \/>\n\u3068\u3057\u305f\u3068\u3053\u308d\u3001time.php\u3092\u5b9f\u884c\u4e2d\u306b\u3001\u5225\u306ephp\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u3082\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3057\u305f<br \/>\n\u4ee5\u4e0b\u306b\u30d7\u30ed\u30bb\u30b9\u3092\u8a18\u8f09\u3057\u3066\u3044\u308b\u304c\u30012\u3064\u76ee\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u8d77\u52d5\u3057\u3001\u51e6\u7406\u3057\u305f\u6a21\u69d8<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n12054 ?        Ss     0:00 \/usr\/sbin\/apache2 -k start\r\n12058 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n12076 ?        Ss     0:00  |   \\_ \/usr\/bin\/php-cgi\r\n12078 ?        S      0:00  |   |   \\_ \/usr\/bin\/php-cgi\r\n12079 ?        S      0:00  |   |   \\_ \/usr\/bin\/php-cgi\r\n12080 ?        S      0:00  |   |   \\_ \/usr\/bin\/php-cgi\r\n12081 ?        S      0:00  |   |   \\_ \/usr\/bin\/php-cgi\r\n12090 ?        Ss     0:00  |   \\_ \/usr\/bin\/php-cgi\r\n12092 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n12093 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n12094 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n12095 ?        S      0:00  |       \\_ \/usr\/bin\/php-cgi\r\n12060 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n...\r\n<\/pre>\n<h2>FcgidMaxProcesses\u30fbFcgidMaxProcessesPerClass<\/h2>\n<p>PHP_FCGI_CHILDREN\u30920\u306b\u3057\u3066\u5927\u91cf\u30a2\u30af\u30bb\u30b9\u3057\u305f\u5834\u5408\u3001FcgidMaxProcesses\u304c4\u306e\u5834\u5408\u306f\u3001php-cgi\u304c4\u30d7\u30ed\u30bb\u30b9\u7acb\u3061\u4e0a\u304c\u3063\u305f<br \/>\nFcgidMaxProcessesPerClass\u30923\u306b\u3057\u305f\u5834\u5408\u306f\u30013\u30d7\u30ed\u30bb\u30b9\u3057\u304b\u7acb\u3061\u4e0a\u304c\u3089\u306a\u3044\u305f\u3081\u3001\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u6642\u306f\u4e21\u65b9\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n10701 ?        Ss     0:00 \/usr\/sbin\/apache2 -k start\r\n10705 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n10753 ?        S      0:00  |   \\_ \/usr\/bin\/php-cgi\r\n10754 ?        S      0:00  |   \\_ \/usr\/bin\/php-cgi\r\n10839 ?        S      0:00  |   \\_ \/usr\/bin\/php-cgi\r\n10841 ?        S      0:00  |   \\_ \/usr\/bin\/php-cgi\r\n10707 ?        S      0:00  \\_ \/usr\/sbin\/apache2 -k start\r\n...\r\n<\/pre>\n<h1>mod_fcgid: can&#8217;t apply process slot for<\/h1>\n<p>\u56de\u907f\u7b56\u3068\u3057\u3066\u306f\u3001<br \/>\n\u30fbFcgidMaxRequestsPerProcess\u306bPHP_FCGI_MAX_REQUESTS\u306e\u6570\u5024\u4ee5\u4e0b\u306e\u6570\u5b57\u3092\u6307\u5b9a\u3059\u308b\u3001\u307e\u305f\u306f\u4e21\u65b9\u51710\u306b\u3059\u308b(\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3088\u3063\u3066\u306f\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059)<br \/>\nPHP_FCGI_MAX_REQUESTS\u3092\u8d85\u3048\u305f\u51e6\u7406\u3092\u8981\u6c42\u3057\u305f\u5834\u5408\u3001php-cgi\u306f\u8d85\u3048\u305f\u3068\u5224\u65ad\u3057\u305f\u3089\u3001\u51e6\u7406\u3092\u7121\u6761\u4ef6\u306b\u7d42\u4e86\u3057500\u3084503\u3092\u8fd4\u5374\u3059\u308b<br \/>\n\u3053\u306e\u3068\u304d\u306b\u3053\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u6642\u304c\u3042\u308b<br \/>\n\u30fb\u539f\u56e0\u304c\u8907\u96d1\u306a\u5834\u5408\u3082\u3042\u308b\u3002PHP-FRM\u306b\u4e57\u308a\u63db\u3048\u306a\u3088<br \/>\nhttp:\/\/www.megalinux.net\/mod_fcgid-cant-apply-process-slot\/<br \/>\n\u30fbMaxProcessCount\u304c\u5c0f\u3055\u3044\u306e\u304b\u3082<br \/>\nhttp:\/\/www.webhostingtalk.com\/showthread.php?t=1203229<br \/>\nhttp:\/\/linuxtechme.wordpress.com\/2013\/08\/24\/mod_fcgid-cant-apply-process-slot-for-usrlocalcpanelcgi-sysphp5\/<\/p>\n<h1>\u53c2\u8003URL<\/h1>\n<p>Apache Module mod_fcgid<br \/>\nhttp:\/\/httpd.apache.org\/mod_fcgid\/mod\/mod_fcgid.html<br \/>\napache \u306e FastCGI(mod_fcgid) \u3067 php\u3092\u52d5\u304b\u3057\u3066\u307f\u308b<br \/>\nhttp:\/\/server-setting.info\/centos\/apache_fastcgi_fcgid_php.html<br \/>\nApache with fcgid: acceptable performance and better resource utilization<br \/>\nhttp:\/\/2bits.com\/articles\/apache-fcgid-acceptable-performance-and-better-resource-utilization.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 apache\u3067\u306fFastCGI\u3092fcgid\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b fastcgi(mod_fastcgi)\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u3042\u308b\u304c\u3001\u554f\u984c\u304c\u3042\u308b\u3089\u3057\u304f\u5f8c\u767a\u306efcgid\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u8a18\u8f09\u3059\u308b FastCG [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[17,9],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1421"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1421"}],"version-history":[{"count":7,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1421\/revisions"}],"predecessor-version":[{"id":1429,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1421\/revisions\/1429"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}