Search before asking
Description
In our company's promotion of Skywalking, we found that some project team feedback after adding Skywalking-java will make the application startup time longer (35s -> 60s). The way to verify this is to use JMeter to continuously send Http requests to the application, then record the time and start the application again, until JMeter's request no longer return error, then calculate the time gap.
I've hardcoded the time spent on the following methods
SkyWalkingAgent#premian
SkyWalkingAgent.Transformer#transform
ProtectiveShieldMatcher#matches
like this
@Override
public boolean matches(T target) {
try {
if (LOGGER.isDebugEnable()) {
long start = System.currentTimeMillis();
boolean matches = this.matcher.matches(target);
COST.addAndGet(System.currentTimeMillis() - start);
LOGGER.debug("So far the Byte-buddy matches has took : {} ms", COST.get());
return matches;
} else {
return this.matcher.matches(target);
}
} catch (Throwable t) {
if (LOGGER.isDebugEnable()) {
LOGGER.debug(t, "Byte-buddy occurs exception when match type.");
}
return false;
}
}
Until the application is able to handle http requests correctly, the most time-consuming method is ProtectiveShieldMatcher#matches, it cost 16s+. The application contains a large number of classes, mostly prefixed with com.our.company, which do not need to be enhanced. I got a huge reduction in startup time by ignoring this prefixed class in Bytebuddy.
Use case
For applications that are sensitive to startup time and require fast deployment and scaling, applications are less tolerant of increased startup time. Reduce the startup time increase by ignoring classes that enhance the specified prefix. This prefix can probably be configured in agent.config
Related issues
No response
Are you willing to submit a pull request to implement this on your own?
Code of Conduct
Search before asking
Description
In our company's promotion of Skywalking, we found that some project team feedback after adding Skywalking-java will make the application startup time longer (35s -> 60s). The way to verify this is to use JMeter to continuously send Http requests to the application, then record the time and start the application again, until JMeter's request no longer return error, then calculate the time gap.
I've hardcoded the time spent on the following methods
SkyWalkingAgent#premianSkyWalkingAgent.Transformer#transformProtectiveShieldMatcher#matcheslike this
Until the application is able to handle http requests correctly, the most time-consuming method is
ProtectiveShieldMatcher#matches, it cost 16s+. The application contains a large number of classes, mostly prefixed withcom.our.company, which do not need to be enhanced. I got a huge reduction in startup time by ignoring this prefixed class in Bytebuddy.Use case
For applications that are sensitive to startup time and require fast deployment and scaling, applications are less tolerant of increased startup time. Reduce the startup time increase by ignoring classes that enhance the specified prefix. This prefix can probably be configured in
agent.configRelated issues
No response
Are you willing to submit a pull request to implement this on your own?
Code of Conduct