ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Django NewRelic Quickstart (gunicorn.d + Django 1.3 hack)

Django NewRelic Quickstart (gunicorn.d + Django 1.3 hack)

原创 Linux操作系统 作者:jieforest 时间:2012-05-30 09:46:57 0 删除 编辑
[i=s] 本帖最后由 jieforest 于 2012-5-30 09:46 编辑

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/,如需转载,请注明出处,否则将追究法律责任。

下一篇: Hadoop进入2.0时代
请登录后发表评论 登录
全部评论

注册时间:2008-04-23

  • 博文量
    443
  • 访问量
    508212