0

VPS: DigitalOcean Amplify: v0.43 Nginx: v1.13.0 PHP-FPM: v7.0.19 OS: 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責任があります。

4

1 に答える 1