【问题标题】:Java application startup time with newrelic agent使用 newrelic 代理的 Java 应用程序启动时间
【发布时间】:2017-08-23 06:50:10
【问题描述】:

我正在使用 newrelic 代理在 Heroku 上运行一个 java 应用程序。我从日志中看到,启动 newrelic 代理可能需要 8 秒以上的时间 - 有时更多。从下面的示例来看,加载仪器需要 2 秒,连接到新的 relic 服务器可能需要 5 秒。

有什么办法可以加快速度吗?有时事情似乎比平时慢,我达到了 90 年代的启动 heroku 限制 (Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch)。

下面显示的大部分仪器都不是必需的。

谢谢。

05:56:21 +0000 [4 1] com.newrelic INFO: New Relic Agent: Loading configuration file "/app/newrelic/./newrelic.yml"
05:56:21 +0000 [4 1] com.newrelic INFO: New Relic Agent v3.37.0 is initializing...
05:56:22 +0000 [4 1] com.newrelic.agent.deps.org.reflections.Reflections WARN: given scan urls are empty. set urls in the configuration
... 46 others
05:56:22 +0000 [4 8] com.newrelic INFO: Instrumentation com.newrelic.instrumentation.akka-2.2 is enabled. Loading.
05:56:23 +0000 [4 11] com.newrelic INFO: Instrumentation com.newrelic.instrumentation.async-http-client-2.0.0 is enabled. Loading.
... 128 others
05:56:23 +0000 [4 6] com.newrelic INFO: Instrumentation com.newrelic.instrumentation.solr-1.4.0 is enabled. Loading.
05:56:27 +0000 [4 1] com.newrelic.agent.RPMServiceManagerImpl INFO: Configured to connect to New Relic at collector.newrelic.com:443
05:56:27 +0000 [4 1] com.newrelic INFO: Setting audit_mode to false
05:56:27 +0000 [4 1] com.newrelic INFO: Setting protocol to "https"
05:56:28 +0000 [4 1] com.newrelic.agent.config.ConfigServiceImpl INFO: Configuration file is /app/newrelic/./newrelic.yml
05:56:28 +0000 [4 1] com.newrelic INFO: New Relic Agent v3.37.0 has started
05:56:28 +0000 [4 1] com.newrelic INFO: Agent class loader: com.newrelic.bootstrap.BootstrapAgent$JVMAgentClassLoader@533ddba
05:56:28 +0000 [4 1] com.newrelic INFO: Premain startup complete in 7,981ms

【问题讨论】:

    标签: heroku newrelic


    【解决方案1】:

    如何改变这个配置值?

    https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-configuration-config-file

    同步启动 类型 Boolean 默认 false 让代理在应用启动时立即连接 New Relic 收集器。

    【讨论】:

    • 谢谢,我试试看
    • 看起来sync_startup: false 无论如何都是默认值。明确设置它没有区别。
    • 使用sync_startup: true 似乎有所作为。检测仍然需要 10 秒,但在我的应用程序开始启动后似乎连接到服务器可能会发生(从日志看来是 ASYNC)。如果仪器可以加快速度就好了。
    • 我的运气仍然不佳。我想我只需要删除 newrelic - 它只是增加了太多的启动时间。
    猜你喜欢
    • 2013-04-21
    • 1970-01-01
    • 1970-01-01
    • 2017-03-06
    • 2010-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多