• ログイン

本書は、お客様のご参考のために原文の英語版を機械翻訳したものです。

英語版と齟齬がある場合、英語版の定めが優先するものとします。より詳しい情報については、本リンクをご参照ください。

問題を作成する

PythonエージェントとFastCGIウェブサーバ

Python エージェントは flup と連携して FastCGI と一緒に使うことができます。知られている特別な要件や制限はありませんので、 Install the Python agent の一般的な統合手順に従うことができます。

アドミンスクリプトの統合例

FastCGI の場合、Web アプリケーションは常に外部プロセスとして管理されます。flupのFastCGI/WSGIアダプタを統合している場合は、以下のようになります。

#!/usr/bin/env python
import sys
from fcgi import WSGIServer
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
ret = WSGIServer(application).run()

また、FastCGIプロセスをPythonで直接Pythonスクリプトとして起動している場合は、 python app.py 、代わりに実行します。

NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program python app.py

インストールプロセスの詳細については、 Pythonエージェントのインストール を参照してください。

Copyright © 2022 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.