Giter Club home page Giter Club logo

Comments (3)

willarmiros avatar willarmiros commented on July 28, 2024

Hi @dan-lind,

Thanks for raising this issue. I experienced this while developing the agent as well and spent quite a long time investigating it without too many results. I achieved incremental results by reducing our usage of Jackson Object Mappers and lowering the timeout of some of the metadata endpoint requests our plugins make during initialization. But none of these seemed to address the root cause of the very long startup time. My latest findings were that the slowdown definitely involves the initial agent configuration (in XRaySDKConfiguation) and might have something to do with loading the AWS SDK.

I'll leave this open as a bug while I continue to investigate it.

from aws-xray-java-agent.

dan-lind avatar dan-lind commented on July 28, 2024

I did some more digging on my side. It looks to me like the xray agent itself doesn't add that much time, maybe around 3-5 seconds or so in. Rather it seems to be the disco agent that adds most of the overhead. For example each SdkClient takes a second or so, with the first one taking 3-5 seconds.

[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
SsmClient: 3580 ms
[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
DDB Enhanced client: 807 ms
[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
SesClient: 904 ms
[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
CloudWatch client: 342 ms

Same init without the agent

SsmClient: 276 ms
DDB Enhanced client: 38 ms
SesClient: 41 ms
CloudWatch client: 15 ms

Also noticed that in my case, Disco lists the same DataAccessor 5 times as an "installable" for the web plugin. Not sure if it adds to the overhead or not.

[software.amazon.disco.agent.DiscoAgent] DiSCo(Agent) Plugin name: disco-java-agent-web-plugin.jar
        Bootstrap: no
        Installables: software.amazon.disco.agent.web.servlet.HttpServletServiceInterceptor,
software.amazon.disco.agent.web.apache.httpclient.ApacheHttpClientInterceptor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor

These numbers only account for around 10 of the ~25 seconds of slowdown to the startup that I see when running locally, so there is probably more overhead coming from the disco agent. So I guess that this slowdown is patially/mostly an issue for another repo.

from aws-xray-java-agent.

willarmiros avatar willarmiros commented on July 28, 2024

Hmm yeah this makes sense, since ByteBuddy does have to do some magic to change the bytecode of all those AWS SDK clients when their classes are loaded for auto-instrumentation to occur. The Disco team is working on removing the DataAccessor pattern altogether since it's somewhat of a legacy way of doing introspection anyway. They're also working on more general performance improvements. Feel free to raise this issue over with them as well: https://github.com/awslabs/disco

from aws-xray-java-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.