-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] SkyWalking Java Agent performance degradation after upgrading to 9.0 #11460
Comments
Basically I wouldn't be surprised of this, considering what was changed for 9.0.0 kernel. |
You could try the version without the change, I believe the latency will be gone. |
After some investigation, I found that .with(AgentBuilder.DescriptionStrategy.Default.POOL_FIRST); changing this strategy leads to almost double CPU usage during the startup. What is the motivation for the change from apache/skywalking-java#561? @kylixs |
What was the value by default? |
HYBRID |
@lujiajing1126 The POOL_FIRST solution is to solve the retransform failure problem by obtaining the original bytecode and reprocessing it. |
I see.
No. Only SkyWalking agent is mounted
As shown in the logs, 79 in total. |
@lujiajing1126 Please try this patch: apache/skywalking-java#634 |
@lujiajing1126 Please try about new solution: apache/skywalking-java#637 |
### Improve the performance of type description of byte-buddy The goal is to get the original class description at re-transform, so as to generate consistent results when the Skywalking agent is enhanced again (including implementing the EnhancedInstance interface, auxiliary fields and methods, etc.) The previous type description used the `AgentBuilder.DescriptionStrategy.Default.POOL_FIRST` policy to get origin type description, which slows down the application startup, due to heavy I/O operations and parsing bytecode. New way is to remove dynamic fields, methods and interfaces generated by SkyWalking Agent from `TypeDescription`, and **make it as origin type descripton**. **Key feature** : * No need to cache `TypeDescription` objects, less memory used. * It only applies to the re-transform class processing flow and does not affect the startup process. **Process flow:** 1. Find `TypeDescription` from commonly used type cache, such as primitive class. 2. Delegate to `AgentBuilder.DescriptionStrategy.Default.HYBRID` 3. Wrap `TypeDescription` by `SWTypeDescriptionWrapper` , remove fields, methods, interface generated by SkyWalking. **Relative Issue:** apache/skywalking#11460
Search before asking
Apache SkyWalking Component
Java Agent (apache/skywalking-java)
What happened
After upgrading to SW 9.0, we've observed increasing application start-up in the production cluster.
For the same application, using two different Agent versions,
2023-10-26 19:12:37.143 [main] INFO com.wosai.middleware.Application.logStarted - Started Application in 10.733 seconds (JVM running for 21.072)
2023-10-26 19:18:12.700 [main] INFO com.wosai.middleware.Application.logStarted - Started Application in 10.538 seconds (JVM running for 16.828)
What you expected to happen
Roughly the same start-up time and CPU consumption.
How to reproduce
Run a Java application with 8 and 9.
Anything else
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct
The text was updated successfully, but these errors were encountered: