Django NewRelic Quickstart (gunicorn.d + Django 1.3 hack)
New Relic is an excellent webapplication performance reporting tool. After a great experience using it onHeroku, I went to enable it for an existing self-hosted application. WhileDjango 1.4 has an excellent WSGI configuration build-in, Django 1.3 makes it alittle trickier. To complicate matters even more, I was using debian's gunicornpackage, which not not make changing the Django executable easy.
New Relic has excellent documentation for downloading, installing andconfiguring their tools. Here are my crib notes:
CODE:
1.view plainprint?2.
3.pip install newrelic django-newrelic-extensions
4.# sign up on newrelic.com, get $LICENSE_KEY under "Account Settings"
5.mkdir /etc/newrelic
6.newrelic-admin generate-config $LICENSE_KEY /etc/newrelic/newrelic.ini
7.newrelic-admin validate-config /etc/newrelic/newrelic.ini
[size=11.5pt]You should now be able to log in tonew relic and see an application called "Python Agent Test". Thismeans that the test worked; new relic can communicate with the hosted servers.You can run gunicorn manually from the command line with new relic as follows:
CODE:
1.view plainprint?2.
3.cd /opt/my-django-project
4.export NEW_RELIC_CONFIG_FILE=/etc/newrelic/newrelic.ini
5.newrelic-admin run-program python manage.py run_gunicorn
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-731438/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Django REST Framework Quickstart 專案DjangoRESTFrameworkUI
- Django(2) - Django模板Django
- Django1.4和1.3的靜態檔案路徑配置Django
- Django(33)Django操作cookieDjangoCookie
- Django(5)django配置資訊Django
- Django(37)配置django日誌Django
- Django(1) - 初識Django框架Django框架
- django REST框架- Django-ninjaDjangoREST框架
- 【Django】Django快取系統Django快取
- 【Django】Django
- djangoDjango
- Django(13)django時區問題Django
- Django教程(三) Django表單FormDjangoORM
- 【Django】Django 中介軟體(middleware)Django
- Python Django 的 django templatedoesnotexistPythonDjango
- 使用Django annotation,提升django查詢效能Django
- 【Django】Django定時任務之-crontabDjango
- Django --URLDjango
- Django restframeworkDjangoRESTFramework
- Django模板Django
- Django ORMDjangoORM
- Django 路由Django路由
- Django初探Django
- Django - querysetDjango
- Django 模型Django模型
- Django命令Django
- django 開發網站-建立 django 專案Django網站
- Django報錯django.utils.datastructures.MultiValueDictKeyErrorDjangoASTStructError
- DJango部署 Gunicorn+Nginx+Django+supervisor+VirtualenvDjangoNginx
- Django教程(一) Django檢視與網址Django
- Django2.0(一)Django框架開發流程Django框架
- Django(27)Django類檢視新增裝飾器Django
- [Django青銅修煉手冊] 初識DjangoDjango
- django下載excel,使用django-excel外掛DjangoExcel
- django搭建完畢執行顯示hello djangoDjango
- Django定時任務Django-crontab的使用Django
- Django(73)django-debug-toolbar除錯工具Django除錯
- 【Django】將Django模板引擎更改為Jinja2Django