php-cp
php-cp copied to clipboard
php-cp/redis/yaf 发现php-fpm卡死,php-cp大量报错
报错信息:
[2018-07-19 17:28:04] cpReactor_client_release: The fd 396 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18859 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: The fd 1025 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: The fd 1228 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18897 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: The fd 1250 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18847 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18836 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: The fd 1112 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: The fd 1020 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18901 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18851 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: The fd 1209 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: The fd 1271 is closed and remove from the queue but no conn dispatch , maybe have slow query [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18865 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18839 error. Error: No such process [3] [2018-07-19 17:28:04] cpReactor_client_release: send sig 2 18905 error. Error: No such process [3]
使用方法:
public function prepareConnection(){ $this->redis = new redisProxy(); $this->redis->connect( $this->ip, $this->port); return $this->redis; }
$redisConnection = $this->redis->prepareConnection(); $result = $redisConnection->hGet($mapname, $keyname); $redisConnection->release();
配置:
pool.ini 与config.ini.example 一样,一行都没动,目录创建了
[root@server srv]# /usr/local/bin/pool_server status server with pid 9510 is running well. group number: 2
group 0: 10.2.6.4:22151:0 have used 20,the max conn num is 20, the min num is 1,the queue len is 612
group 1: 10.2.6.5:22151:0 have used 1,the max conn num is 20, the min num is 1,the queue len is 0
启动以后,php-fpm 开始疯长
[root@server srv]# ps aux | grep php-fpm | wc -l 664 [root@server srv]# ps aux | grep php-fpm | wc -l 670 [root@server srv]# ps aux | grep php-fpm | wc -l 828 [root@server srv]# ps aux | grep php-fpm | wc -l 984
直到 1200个php-fpm 全部用完 最后nginx 开始报 502 Gateway time out 2018/07/19 17:37:21 [error] 7649#0: *762116165 upstream timed out (110: Connection timed out) while reading response header from upstream
求问下,我哪里搞错了么? [root@server srv]# /usr/local/php/bin/php -v PHP 7.1.8 (cli) (built: Sep 19 2017 16:49:53) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.8, Copyright (c) 1999-2017, by Zend Technologies
[root@server srv]# /usr/local/webserver/php/bin/php -m [PHP Modules] bcmath connect_pool Core ctype curl connection_pool 是存在的
多谢大家,多谢大家