rollbar / rollbar/rollbar-java

Native agent adds 10x startup time to Spring Boot app

Open
#227 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
78
Forks
74
PR merge metrics
No merged PRs in 30d

Description

I added a sample project to reproduce it at https://github.com/phillipuniverse/rollbar-native-test. Without the agent, startup time is ~2s. With the agent, startup time is ~20s. The project uses the .dylib and .so files that I used to validate with, both with the same results (although Linux was slightly faster). I build the .dylib and .so files from the master branch just to make sure I had all the changes.

In this example it isn't so bad, but it takes a different Spring Boot project (that has Spring Data, Rabbit, Mongo, JPA, etc etc) go from ~15s startup time to ~400s which makes the whole native agent a non-starter.

I will say though, once it starts up I get locals in my Rollbar traces which is why I would really like this to work!!

image

Might be relevant, but when I turn on debug logging with ROLLBAR_LOG=debug I get this:

 INFO  rollbar_java_agent > Agent load begin
 INFO  rollbar_java_agent > Agent load complete success
 DEBUG rollbar_java_agent > JNI call failed: 'com/rollbar/jvmti/ThrowableCache class not found: com/rollbar/jvmti/ThrowableCache'
 DEBUG rollbar_java_agent > JNI call failed: 'com/rollbar/jvmti/ThrowableCache class not found: com/rollbar/jvmti/ThrowableCache'
 DEBUG rollbar_java_agent > JNI call failed: 'com/rollbar/jvmti/ThrowableCache class not found: com/rollbar/jvmti/ThrowableCache'
 DEBUG rollbar_java_agent > JNI call failed: 'com/rollbar/jvmti/ThrowableCache class not found: com/rollbar/jvmti/ThrowableCache'
 DEBUG rollbar_java_agent > JNI call failed: 'com/rollbar/jvmti/ThrowableCache class not found: com/rollbar/jvmti/ThrowableCache'
 DEBUG rollbar_java_agent > JNI call failed: 'com/rollbar/jvmti/ThrowableCache class not found: com/rollbar/jvmti/ThrowableCache'
 DEBUG rollbar_java_agent > JNI call failed: 'com/rollbar/jvmti/ThrowableCache class not found: com/rollbar/jvmti/ThrowableCache'
...
...

The ThrowableCache class not found is emitted an insane amount of times. If I were to bet, it seems to indicate that the cache is not being used by the native agent, which contributes to the super slow startup times??

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the sample project at https://github.com/phillipuniverse/rollbar-native-test with and without the .dylib and .so agents, recording startup times. Enable ROLLBAR_LOG=debug and investigate the repeated ThrowableCache class-not-found messages. Done means the agent no longer causes the reported startup slowdown and the repeated debug failures are resolved or explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.