避免New Relic附加到Heroku上的leiningen

时间:2012-11-16 16:50:50

标签: heroku clojure leiningen newrelic

我为在Heroku上运行的Clojure应用程序启用了New Relic监控。为了避免在Leiningen的JVM进程中嵌套我的应用程序的开销,我启动了lein trampoline run

这显然增加了New Relic附加到最初的Leiningen流程的一些开销,然后关闭并启动我的应用程序,导致New Relic再次连接延迟。这有时会导致在30秒启动超时窗口内无法启动并导致停机。

日志输出显示两个New Relic代理启动:

heroku/web.1:  Starting process with command `lein trampoline run`
app/web.1: [date] NewRelic 1 INFO: Agent is using Log4j
app/web.1: [date] NewRelic 1 INFO: Loading configuration file "/app/newrelic/./newrelic.yml"
app/web.1: [date] NewRelic 1 INFO: Agent Host: 866e2426-7a0f-4293-ae89-b55c0332253e IP: 10.159.0.212
app/web.1: [date] NewRelic 1 INFO: Setting audit_mode to false
app/web.1: [date] NewRelic 1 INFO: Setting protocol to "http"
app/web.1: [date] NewRelic 1 INFO: Configuration file is /app/newrelic/./newrelic.yml
app/web.1: [date] NewRelic 1 INFO: New Relic Agent v2.9.0 has started
app/web.1: [date] NewRelic 1 INFO: Java version: 1.6.0_20
app/web.1: [date] NewRelic 1 INFO: Agent class loader: sun.misc.Launcher$AppClassLoader@7ea2dfe
app/web.1: [date] NewRelic 5 INFO: JVM is shutting down
app/web.1: [date] NewRelic 5 INFO: New Relic Agent has shutdown
app/web.1: [date] NewRelic 1 INFO: Agent is using Log4j
app/web.1: [date] NewRelic 1 INFO: Loading configuration file "/app/newrelic/./newrelic.yml"
app/web.1: [date] NewRelic 1 INFO: Agent Host: 866e2426-7a0f-4293-ae89-b55c0332253e IP: 10.159.0.212
app/web.1: [date] NewRelic 1 INFO: Configured to connect to New Relic at collector.newrelic.com:80
app/web.1: [date] NewRelic 1 INFO: Setting audit_mode to false
app/web.1: [date] NewRelic 1 INFO: Setting protocol to "http"
app/web.1: [date] NewRelic 1 INFO: Configuration file is /app/newrelic/./newrelic.yml
app/web.1: [date] NewRelic 1 INFO: New Relic Agent v2.9.0 has started
app/web.1: [date] NewRelic 1 INFO: Java version: 1.6.0_20
app/web.1: [date] NewRelic 1 INFO: Agent class loader: sun.misc.Launcher$AppClassLoader@7ea2dfe

有没有办法避免New Relic附加到leiningen过程?

1 个答案:

答案 0 :(得分:0)

您是否可以在Heroku配置的JVM_OPTS中设置-javaagent:newrelic/newrelic.jar,而不是在:jvm-opts的生产资料project.clj中设置它?