Skip to content

Type resolver's use of URL caches should be configurable#5805

Merged
mcculls merged 1 commit into
masterfrom
mcculls/resolver-configurable-url-caches
Aug 29, 2023
Merged

Type resolver's use of URL caches should be configurable#5805
mcculls merged 1 commit into
masterfrom
mcculls/resolver-configurable-url-caches

Conversation

@mcculls

@mcculls mcculls commented Aug 29, 2023

Copy link
Copy Markdown
Contributor

Some deployments will want to use URL caches for performance reasons. Others may want to skip URL caches as they can lead to JarFiles being pinned in memory (or keeping files locked in Windows)

The Java tracer will now use the default URLConnection 'UseCaches' setting, but this can be overriden (to false or true) by adding this JVM option:

-Ddd.resolver.use.url.caches=false

or by setting this environment variable:

DD_RESOLVER_USE_URL_CACHES=false

Some deployments will want to use URL caches for performance reasons.
Others may want to skip URL caches as they can lead to JarFiles being
pinned in memory (or keeping files locked in Windows)

The Java tracer will now use the default URLConnection 'UseCaches' setting,
but this can be overriden (to false or true) by adding this JVM option:
```
-Ddd.resolver.use.url.caches=false
```
or by setting this environment variable:
```
DD_RESOLVER_USE_URL_CACHES=false
```
@mcculls mcculls added comp: core Tracer core tag: performance Performance related changes labels Aug 29, 2023
@mcculls
mcculls requested a review from a team as a code owner August 29, 2023 15:58
uc.setUseCaches(false);
if (null != USE_URL_CACHES) {
uc.setUseCaches(USE_URL_CACHES);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. If nothing's set it uses the default.

@pr-commenter

pr-commenter Bot commented Aug 29, 2023

Copy link
Copy Markdown

Benchmarks

Startup

Parameters

Baseline Candidate
commit 1.20.0-SNAPSHOT~be378f24bc 1.20.0-SNAPSHOT~2e44c07cd9
config baseline candidate
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
module Agent Agent
parent None None
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 62 cases.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.20.0-SNAPSHOT~2e44c07cd9, baseline=1.20.0-SNAPSHOT~be378f24bc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.009 s) : 0, 1008549
Total [baseline] (9.208 s) : 0, 9207830
Agent [candidate] (995.126 ms) : 0, 995126
Total [candidate] (9.153 s) : 0, 9152941
section appsec
Agent [baseline] (1.083 s) : 0, 1082617
Total [baseline] (9.341 s) : 0, 9341196
Agent [candidate] (1.075 s) : 0, 1074756
Total [candidate] (9.265 s) : 0, 9264613
section iast
Agent [baseline] (1.096 s) : 0, 1095740
Total [baseline] (9.426 s) : 0, 9426131
Agent [candidate] (1.096 s) : 0, 1095684
Total [candidate] (9.421 s) : 0, 9421407
section profiling
Agent [baseline] (1.159 s) : 0, 1158648
Total [baseline] (9.514 s) : 0, 9513616
Agent [candidate] (1.162 s) : 0, 1161817
Total [candidate] (9.435 s) : 0, 9434720
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.009 s -
Agent appsec 1.083 s 74.067 ms (7.3%)
Agent iast 1.096 s 87.191 ms (8.6%)
Agent profiling 1.159 s 150.098 ms (14.9%)
Total tracing 9.208 s -
Total appsec 9.341 s 133.366 ms (1.4%)
Total iast 9.426 s 218.301 ms (2.4%)
Total profiling 9.514 s 305.786 ms (3.3%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 995.126 ms -
Agent appsec 1.075 s 79.63 ms (8.0%)
Agent iast 1.096 s 100.559 ms (10.1%)
Agent profiling 1.162 s 166.691 ms (16.8%)
Total tracing 9.153 s -
Total appsec 9.265 s 111.672 ms (1.2%)
Total iast 9.421 s 268.466 ms (2.9%)
Total profiling 9.435 s 281.779 ms (3.1%)
gantt
    title petclinic - break down per module: candidate=1.20.0-SNAPSHOT~2e44c07cd9, baseline=1.20.0-SNAPSHOT~be378f24bc

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (626.8 ms) : 0, 626800
BytebuddyAgent [candidate] (617.109 ms) : 0, 617109
GlobalTracer [baseline] (289.707 ms) : 0, 289707
GlobalTracer [candidate] (286.232 ms) : 0, 286232
AppSec [baseline] (50.172 ms) : 0, 50172
AppSec [candidate] (50.654 ms) : 0, 50654
Remote Config [baseline] (672.278 µs) : 0, 672
Remote Config [candidate] (665.639 µs) : 0, 666
Telemetry [baseline] (6.095 ms) : 0, 6095
Telemetry [candidate] (6.004 ms) : 0, 6004
section appsec
BytebuddyAgent [baseline] (618.688 ms) : 0, 618688
BytebuddyAgent [candidate] (613.887 ms) : 0, 613887
GlobalTracer [baseline] (287.031 ms) : 0, 287031
GlobalTracer [candidate] (284.891 ms) : 0, 284891
AppSec [baseline] (135.701 ms) : 0, 135701
AppSec [candidate] (135.234 ms) : 0, 135234
Remote Config [baseline] (725.596 µs) : 0, 726
Remote Config [candidate] (724.903 µs) : 0, 725
Telemetry [baseline] (5.779 ms) : 0, 5779
Telemetry [candidate] (5.726 ms) : 0, 5726
section iast
BytebuddyAgent [baseline] (721.867 ms) : 0, 721867
BytebuddyAgent [candidate] (721.907 ms) : 0, 721907
GlobalTracer [baseline] (271.684 ms) : 0, 271684
GlobalTracer [candidate] (271.603 ms) : 0, 271603
AppSec [baseline] (46.983 ms) : 0, 46983
AppSec [candidate] (46.896 ms) : 0, 46896
Remote Config [baseline] (569.782 µs) : 0, 570
Remote Config [candidate] (577.845 µs) : 0, 578
Telemetry [baseline] (5.755 ms) : 0, 5755
Telemetry [candidate] (5.812 ms) : 0, 5812
IAST [baseline] (14.466 ms) : 0, 14466
IAST [candidate] (14.454 ms) : 0, 14454
section profiling
ProfilingAgent [baseline] (75.444 ms) : 0, 75444
ProfilingAgent [candidate] (77.252 ms) : 0, 77252
BytebuddyAgent [baseline] (626.261 ms) : 0, 626261
BytebuddyAgent [candidate] (626.85 ms) : 0, 626850
GlobalTracer [baseline] (347.989 ms) : 0, 347989
GlobalTracer [candidate] (349.203 ms) : 0, 349203
AppSec [baseline] (49.488 ms) : 0, 49488
AppSec [candidate] (49.152 ms) : 0, 49152
Remote Config [baseline] (646.651 µs) : 0, 647
Remote Config [candidate] (647.912 µs) : 0, 648
Telemetry [baseline] (6.033 ms) : 0, 6033
Telemetry [candidate] (5.977 ms) : 0, 5977
Profiling [baseline] (75.469 ms) : 0, 75469
Profiling [candidate] (77.277 ms) : 0, 77277
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.20.0-SNAPSHOT~2e44c07cd9, baseline=1.20.0-SNAPSHOT~be378f24bc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (988.547 ms) : 0, 988547
Total [baseline] (8.643 s) : 0, 8643008
Agent [candidate] (987.097 ms) : 0, 987097
Total [candidate] (8.687 s) : 0, 8686588
section appsec
Agent [baseline] (1.082 s) : 0, 1081521
Total [baseline] (8.767 s) : 0, 8767026
Agent [candidate] (1.074 s) : 0, 1074123
Total [candidate] (8.731 s) : 0, 8731298
section iast
Agent [baseline] (1.094 s) : 0, 1093694
Total [baseline] (9.178 s) : 0, 9178111
Agent [candidate] (1.093 s) : 0, 1092850
Total [candidate] (9.155 s) : 0, 9154751
section profiling
Agent [baseline] (1.16 s) : 0, 1160086
Total [baseline] (8.871 s) : 0, 8871406
Agent [candidate] (1.162 s) : 0, 1161910
Total [candidate] (8.857 s) : 0, 8856990
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 988.547 ms -
Agent appsec 1.082 s 92.974 ms (9.4%)
Agent iast 1.094 s 105.148 ms (10.6%)
Agent profiling 1.16 s 171.539 ms (17.4%)
Total tracing 8.643 s -
Total appsec 8.767 s 124.017 ms (1.4%)
Total iast 9.178 s 535.103 ms (6.2%)
Total profiling 8.871 s 228.398 ms (2.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 987.097 ms -
Agent appsec 1.074 s 87.026 ms (8.8%)
Agent iast 1.093 s 105.752 ms (10.7%)
Agent profiling 1.162 s 174.812 ms (17.7%)
Total tracing 8.687 s -
Total appsec 8.731 s 44.71 ms (0.5%)
Total iast 9.155 s 468.163 ms (5.4%)
Total profiling 8.857 s 170.402 ms (2.0%)
gantt
    title insecure-bank - break down per module: candidate=1.20.0-SNAPSHOT~2e44c07cd9, baseline=1.20.0-SNAPSHOT~be378f24bc

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (613.225 ms) : 0, 613225
BytebuddyAgent [candidate] (611.889 ms) : 0, 611889
GlobalTracer [baseline] (284.289 ms) : 0, 284289
GlobalTracer [candidate] (283.974 ms) : 0, 283974
AppSec [baseline] (49.977 ms) : 0, 49977
AppSec [candidate] (50.441 ms) : 0, 50441
Remote Config [baseline] (662.356 µs) : 0, 662
Remote Config [candidate] (666.942 µs) : 0, 667
Telemetry [baseline] (5.971 ms) : 0, 5971
Telemetry [candidate] (5.967 ms) : 0, 5967
section appsec
BytebuddyAgent [baseline] (618.485 ms) : 0, 618485
BytebuddyAgent [candidate] (613.709 ms) : 0, 613709
GlobalTracer [baseline] (286.654 ms) : 0, 286654
GlobalTracer [candidate] (284.69 ms) : 0, 284690
AppSec [baseline] (135.187 ms) : 0, 135187
AppSec [candidate] (134.905 ms) : 0, 134905
Remote Config [baseline] (751.29 µs) : 0, 751
Remote Config [candidate] (736.064 µs) : 0, 736
Telemetry [baseline] (5.842 ms) : 0, 5842
Telemetry [candidate] (5.715 ms) : 0, 5715
section iast
BytebuddyAgent [baseline] (721.037 ms) : 0, 721037
BytebuddyAgent [candidate] (720.555 ms) : 0, 720555
GlobalTracer [baseline] (270.857 ms) : 0, 270857
GlobalTracer [candidate] (270.476 ms) : 0, 270476
AppSec [baseline] (46.724 ms) : 0, 46724
AppSec [candidate] (46.838 ms) : 0, 46838
Remote Config [baseline] (568.308 µs) : 0, 568
Remote Config [candidate] (585.106 µs) : 0, 585
Telemetry [baseline] (5.728 ms) : 0, 5728
Telemetry [candidate] (5.74 ms) : 0, 5740
IAST [baseline] (14.383 ms) : 0, 14383
IAST [candidate] (14.365 ms) : 0, 14365
section profiling
ProfilingAgent [baseline] (77.937 ms) : 0, 77937
ProfilingAgent [candidate] (78.074 ms) : 0, 78074
BytebuddyAgent [baseline] (625.483 ms) : 0, 625483
BytebuddyAgent [candidate] (626.777 ms) : 0, 626777
GlobalTracer [baseline] (348.027 ms) : 0, 348027
GlobalTracer [candidate] (348.347 ms) : 0, 348347
AppSec [baseline] (49.224 ms) : 0, 49224
AppSec [candidate] (49.213 ms) : 0, 49213
Remote Config [baseline] (645.475 µs) : 0, 645
Remote Config [candidate] (642.15 µs) : 0, 642
Telemetry [baseline] (5.986 ms) : 0, 5986
Telemetry [candidate] (5.992 ms) : 0, 5992
Profiling [baseline] (77.961 ms) : 0, 77961
Profiling [candidate] (78.098 ms) : 0, 78098
Loading

Load

Parameters

Baseline Candidate
commit 1.20.0-SNAPSHOT~be378f24bc 1.20.0-SNAPSHOT~2e44c07cd9
config baseline candidate
end_time 2023-08-29T16:19:12 2023-08-29T16:37:17
start_time 2023-08-29T16:18:54 2023-08-29T16:36:59
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 cases.

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.20.0-SNAPSHOT~2e44c07cd9, baseline=1.20.0-SNAPSHOT~be378f24bc
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.352 ms) : 1333, 1371
.   : milestone, 1352,
appsec (1.712 ms) : 1688, 1736
.   : milestone, 1712,
iast (1.455 ms) : 1430, 1479
.   : milestone, 1455,
profiling (1.488 ms) : 1462, 1513
.   : milestone, 1488,
tracing (1.467 ms) : 1443, 1491
.   : milestone, 1467,
section candidate
no_agent (1.33 ms) : 1310, 1349
.   : milestone, 1330,
appsec (1.696 ms) : 1672, 1720
.   : milestone, 1696,
iast (1.465 ms) : 1441, 1489
.   : milestone, 1465,
profiling (1.486 ms) : 1461, 1511
.   : milestone, 1486,
tracing (1.458 ms) : 1433, 1482
.   : milestone, 1458,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.352 ms [1.333 ms, 1.371 ms] -
appsec 1.712 ms [1.688 ms, 1.736 ms] 359.685 µs (26.6%)
iast 1.455 ms [1.43 ms, 1.479 ms] 102.333 µs (7.6%)
profiling 1.488 ms [1.462 ms, 1.513 ms] 135.408 µs (10.0%)
tracing 1.467 ms [1.443 ms, 1.491 ms] 114.904 µs (8.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.33 ms [1.31 ms, 1.349 ms] -
appsec 1.696 ms [1.672 ms, 1.72 ms] 366.132 µs (27.5%)
iast 1.465 ms [1.441 ms, 1.489 ms] 135.58 µs (10.2%)
profiling 1.486 ms [1.461 ms, 1.511 ms] 156.664 µs (11.8%)
tracing 1.458 ms [1.433 ms, 1.482 ms] 128.249 µs (9.6%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.20.0-SNAPSHOT~2e44c07cd9, baseline=1.20.0-SNAPSHOT~be378f24bc
    dateFormat X
    axisFormat %s
section baseline
no_agent (360.497 µs) : 340, 381
.   : milestone, 360,
appsec (663.681 µs) : 643, 685
.   : milestone, 664,
iast (460.291 µs) : 439, 482
.   : milestone, 460,
iast_FULL (518.757 µs) : 498, 539
.   : milestone, 519,
iast_INACTIVE (431.632 µs) : 411, 452
.   : milestone, 432,
profiling (446.31 µs) : 425, 468
.   : milestone, 446,
tracing (435.382 µs) : 415, 455
.   : milestone, 435,
section candidate
no_agent (362.832 µs) : 343, 383
.   : milestone, 363,
appsec (666.915 µs) : 646, 688
.   : milestone, 667,
iast (456.096 µs) : 435, 477
.   : milestone, 456,
iast_FULL (525.141 µs) : 504, 546
.   : milestone, 525,
iast_INACTIVE (434.947 µs) : 414, 456
.   : milestone, 435,
profiling (439.807 µs) : 419, 461
.   : milestone, 440,
tracing (429.543 µs) : 409, 450
.   : milestone, 430,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 360.497 µs [340.399 µs, 380.595 µs] -
appsec 663.681 µs [642.795 µs, 684.568 µs] 303.184 µs (84.1%)
iast 460.291 µs [438.844 µs, 481.737 µs] 99.794 µs (27.7%)
iast_FULL 518.757 µs [498.269 µs, 539.245 µs] 158.26 µs (43.9%)
iast_INACTIVE 431.632 µs [410.776 µs, 452.489 µs] 71.136 µs (19.7%)
profiling 446.31 µs [425.093 µs, 467.527 µs] 85.813 µs (23.8%)
tracing 435.382 µs [415.281 µs, 455.483 µs] 74.885 µs (20.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 362.832 µs [342.636 µs, 383.027 µs] -
appsec 666.915 µs [646.205 µs, 687.625 µs] 304.083 µs (83.8%)
iast 456.096 µs [435.06 µs, 477.132 µs] 93.264 µs (25.7%)
iast_FULL 525.141 µs [504.071 µs, 546.21 µs] 162.309 µs (44.7%)
iast_INACTIVE 434.947 µs [414.006 µs, 455.888 µs] 72.115 µs (19.9%)
profiling 439.807 µs [418.737 µs, 460.878 µs] 76.975 µs (21.2%)
tracing 429.543 µs [409.14 µs, 449.945 µs] 66.711 µs (18.4%)

@mcculls
mcculls merged commit 629d6d5 into master Aug 29, 2023
@mcculls
mcculls deleted the mcculls/resolver-configurable-url-caches branch August 29, 2023 16:42
@github-actions github-actions Bot added this to the 1.20.0 milestone Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: performance Performance related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants