VPS:DigitalOcean Amplify:v0.43 Nginx:v1.13.0 PHP-FPM:v7.0.19操作系统:CentOS7
我正在尝试在Nginx-Amplify报告工具中启用php-fpm-metrics 。它工作了几分钟,然后在服务重新启动后出现错误/var/log/amplify-agent/agent.log
agent.conf(相关部分):
[credentials]
api_key = ******************
hostname =
uuid = *******************
imagename =
[nginx]
user = nginx
stub_status = /nginx_status
[extensions]
phpfpm = True
agent.log(错误):
2017-05-30 21:30:48,374 [21034] supervisor running /usr/sbin/nginx -t -c /etc/nginx/nginx.conf
2017-05-30 21:31:18,079 [21034] supervisor failed to find php-fpm bin path, last attempt: "ls -la /proc/24400/exe" failed due to AmplifySubprocessError
2017-05-30 20:37:18,394 [9929] supervisor run failed
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/amplify/agent/managers/abstract.py", line 135, in _run
self._start_objects()
File "/usr/lib/python2.7/site-packages/amplify/agent/managers/abstract.py", line 123, in _start_objects
child_obj.start()
File "/usr/lib/python2.7/site-packages/amplify/agent/objects/abstract.py", line 149, in start
context.log.debug('starting object "%s" %s' % (self.type, self.definition_hash))
File "/usr/lib/python2.7/site-packages/amplify/agent/objects/abstract.py", line 84, in definition_hash
definition_string = str(map(lambda x: u'%s:%s' % (x, self.definition[x]), sorted(self.definition.keys())))
File "/usr/lib/python2.7/site-packages/amplify/ext/abstract/object.py", line 47, in definition
return {'type': self.type, 'local_id': self.local_id, 'root_uuid': self.root_uuid}
File "/usr/lib/python2.7/site-packages/amplify/agent/objects/abstract.py", line 115, in local_id
self._local_id = hashlib.sha256('_'.join(self.local_id_args)).hexdigest()
TypeError: sequence item 0: expected string, list found
PHP-FPM /etc/php-fpm.d/www.conf
(相关部分):
[www]
user = nginx
group = nginx
listen = /var/run/php-fpm/php-fpm.sock
listen.backlog = 16383
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 25
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500
pm.status_path = /php_status
Nginx.conf(相关部分):
user nginx nginx;
如文档中所述,这有效:
$ SCRIPT_NAME=/php_status SCRIPT_FILENAME=/php_status QUERY_STRING= REQUEST_METHOD=GET cgi-fcgi -bind -connect /var/run/php-fpm/php-fpm.sock
结果:
X-Powered-By: PHP/7.0.19
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-type: text/plain;charset=UTF-8
pool: www
process manager: dynamic
start time: 29/May/2017:15:40:29 +0200
start since: 107193
accepted conn: 806252
listen queue: 0
max listen queue: 0
listen queue len: 0
idle processes: 10
active processes: 14
total processes: 24
max active processes: 25
max children reached: 1840
slow requests: 330
我想问题是,一段时间后重新启动过程和“更改” pid:
supervisor failed to find php-fpm bin path, last attempt: "ls -la /proc/24400/exe" failed due to AmplifySubprocessError
不确定,但可能pm.max_requests = 500
对此负责。