-
Notifications
You must be signed in to change notification settings - Fork 323
Free AppSecRequestContext resources when the request ends #7535
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
Conversation
|
|
||
| /* Should be accessible from the modules */ | ||
|
|
||
| public void close(boolean requiresPostProcessing) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the record, since I was initially confused by this. This post processing currently does not happen in any case, but eventually will: #6923
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 14 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1057900
Total [baseline] (10.415 s) : 0, 10415255
Agent [candidate] (1.052 s) : 0, 1052203
Total [candidate] (10.404 s) : 0, 10404385
section appsec
Agent [baseline] (1.183 s) : 0, 1182546
Total [baseline] (10.554 s) : 0, 10553581
Agent [candidate] (1.181 s) : 0, 1181433
Total [candidate] (10.549 s) : 0, 10549442
section iast
Agent [baseline] (1.193 s) : 0, 1192666
Total [baseline] (10.877 s) : 0, 10877049
Agent [candidate] (1.192 s) : 0, 1192178
Total [candidate] (10.817 s) : 0, 10816704
section profiling
Agent [baseline] (1.252 s) : 0, 1251884
Total [baseline] (10.637 s) : 0, 10637099
Agent [candidate] (1.267 s) : 0, 1267213
Total [candidate] (10.647 s) : 0, 10647430
gantt
title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (674.07 ms) : 0, 674070
BytebuddyAgent [candidate] (670.518 ms) : 0, 670518
GlobalTracer [baseline] (309.093 ms) : 0, 309093
GlobalTracer [candidate] (307.562 ms) : 0, 307562
AppSec [baseline] (52.868 ms) : 0, 52868
AppSec [candidate] (52.393 ms) : 0, 52393
Remote Config [baseline] (680.493 µs) : 0, 680
Remote Config [candidate] (668.379 µs) : 0, 668
Telemetry [baseline] (7.514 ms) : 0, 7514
Telemetry [candidate] (7.473 ms) : 0, 7473
section appsec
BytebuddyAgent [baseline] (687.993 ms) : 0, 687993
BytebuddyAgent [candidate] (688.586 ms) : 0, 688586
GlobalTracer [baseline] (300.47 ms) : 0, 300470
GlobalTracer [candidate] (300.137 ms) : 0, 300137
AppSec [baseline] (161.309 ms) : 0, 161309
AppSec [candidate] (159.679 ms) : 0, 159679
Remote Config [baseline] (610.599 µs) : 0, 611
Remote Config [candidate] (609.589 µs) : 0, 610
Telemetry [baseline] (8.131 ms) : 0, 8131
Telemetry [candidate] (7.563 ms) : 0, 7563
IAST [baseline] (20.998 ms) : 0, 20998
IAST [candidate] (22.543 ms) : 0, 22543
section iast
BytebuddyAgent [baseline] (792.706 ms) : 0, 792706
BytebuddyAgent [candidate] (793.304 ms) : 0, 793304
GlobalTracer [baseline] (300.633 ms) : 0, 300633
GlobalTracer [candidate] (299.802 ms) : 0, 299802
AppSec [baseline] (53.116 ms) : 0, 53116
AppSec [candidate] (52.956 ms) : 0, 52956
Remote Config [baseline] (597.817 µs) : 0, 598
Remote Config [candidate] (588.979 µs) : 0, 589
Telemetry [baseline] (7.419 ms) : 0, 7419
Telemetry [candidate] (7.35 ms) : 0, 7350
IAST [baseline] (24.382 ms) : 0, 24382
IAST [candidate] (24.391 ms) : 0, 24391
section profiling
BytebuddyAgent [baseline] (665.775 ms) : 0, 665775
BytebuddyAgent [candidate] (674.026 ms) : 0, 674026
GlobalTracer [baseline] (390.517 ms) : 0, 390517
GlobalTracer [candidate] (394.163 ms) : 0, 394163
AppSec [baseline] (53.023 ms) : 0, 53023
AppSec [candidate] (53.611 ms) : 0, 53611
Remote Config [baseline] (677.823 µs) : 0, 678
Remote Config [candidate] (694.928 µs) : 0, 695
Telemetry [baseline] (7.367 ms) : 0, 7367
Telemetry [candidate] (7.482 ms) : 0, 7482
ProfilingAgent [baseline] (96.649 ms) : 0, 96649
ProfilingAgent [candidate] (98.837 ms) : 0, 98837
Profiling [baseline] (96.672 ms) : 0, 96672
Profiling [candidate] (98.86 ms) : 0, 98860
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.052 s) : 0, 1052381
Total [baseline] (8.517 s) : 0, 8516699
Agent [candidate] (1.054 s) : 0, 1053561
Total [candidate] (8.496 s) : 0, 8496036
section iast
Agent [baseline] (1.175 s) : 0, 1174639
Total [baseline] (8.982 s) : 0, 8982027
Agent [candidate] (1.183 s) : 0, 1182530
Total [candidate] (8.968 s) : 0, 8968333
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.179 s) : 0, 1178641
Total [baseline] (8.998 s) : 0, 8998236
Agent [candidate] (1.176 s) : 0, 1176470
Total [candidate] (8.949 s) : 0, 8948685
section iast_TELEMETRY_OFF
Agent [baseline] (1.179 s) : 0, 1179464
Total [baseline] (9.012 s) : 0, 9011798
Agent [candidate] (1.179 s) : 0, 1179272
Total [candidate] (8.987 s) : 0, 8987400
gantt
title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (670.578 ms) : 0, 670578
BytebuddyAgent [candidate] (671.706 ms) : 0, 671706
GlobalTracer [baseline] (307.84 ms) : 0, 307840
GlobalTracer [candidate] (307.706 ms) : 0, 307706
AppSec [baseline] (52.255 ms) : 0, 52255
AppSec [candidate] (52.357 ms) : 0, 52357
Remote Config [baseline] (684.893 µs) : 0, 685
Remote Config [candidate] (667.834 µs) : 0, 668
Telemetry [baseline] (7.418 ms) : 0, 7418
Telemetry [candidate] (7.504 ms) : 0, 7504
section iast
BytebuddyAgent [baseline] (780.456 ms) : 0, 780456
BytebuddyAgent [candidate] (785.608 ms) : 0, 785608
GlobalTracer [baseline] (296.214 ms) : 0, 296214
GlobalTracer [candidate] (298.389 ms) : 0, 298389
AppSec [baseline] (52.733 ms) : 0, 52733
AppSec [candidate] (54.187 ms) : 0, 54187
IAST [baseline] (22.885 ms) : 0, 22885
IAST [candidate] (22.728 ms) : 0, 22728
Remote Config [baseline] (596.344 µs) : 0, 596
Remote Config [candidate] (590.189 µs) : 0, 590
Telemetry [baseline] (8.128 ms) : 0, 8128
Telemetry [candidate] (7.28 ms) : 0, 7280
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (781.877 ms) : 0, 781877
BytebuddyAgent [candidate] (781.411 ms) : 0, 781411
GlobalTracer [baseline] (298.286 ms) : 0, 298286
GlobalTracer [candidate] (296.749 ms) : 0, 296749
AppSec [baseline] (51.267 ms) : 0, 51267
AppSec [candidate] (52.424 ms) : 0, 52424
IAST [baseline] (23.981 ms) : 0, 23981
IAST [candidate] (23.513 ms) : 0, 23513
Remote Config [baseline] (614.242 µs) : 0, 614
Remote Config [candidate] (586.733 µs) : 0, 587
Telemetry [baseline] (8.971 ms) : 0, 8971
Telemetry [candidate] (8.111 ms) : 0, 8111
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (783.114 ms) : 0, 783114
BytebuddyAgent [candidate] (782.702 ms) : 0, 782702
GlobalTracer [baseline] (298.368 ms) : 0, 298368
GlobalTracer [candidate] (298.267 ms) : 0, 298267
AppSec [baseline] (54.052 ms) : 0, 54052
AppSec [candidate] (53.4 ms) : 0, 53400
IAST [baseline] (22.291 ms) : 0, 22291
IAST [candidate] (21.845 ms) : 0, 21845
Remote Config [baseline] (583.713 µs) : 0, 584
Remote Config [candidate] (599.214 µs) : 0, 599
Telemetry [baseline] (7.286 ms) : 0, 7286
Telemetry [candidate] (8.709 ms) : 0, 8709
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 18 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section baseline
no_agent (365.459 µs) : 346, 385
. : milestone, 365,
iast (478.972 µs) : 458, 500
. : milestone, 479,
iast_FULL (546.86 µs) : 525, 569
. : milestone, 547,
iast_GLOBAL (499.127 µs) : 478, 521
. : milestone, 499,
iast_HARDCODED_SECRET_DISABLED (471.864 µs) : 450, 494
. : milestone, 472,
iast_INACTIVE (441.649 µs) : 421, 462
. : milestone, 442,
iast_TELEMETRY_OFF (464.579 µs) : 442, 487
. : milestone, 465,
tracing (434.813 µs) : 414, 455
. : milestone, 435,
section candidate
no_agent (376.155 µs) : 354, 398
. : milestone, 376,
iast (475.714 µs) : 454, 497
. : milestone, 476,
iast_FULL (548.514 µs) : 527, 570
. : milestone, 549,
iast_GLOBAL (489.758 µs) : 469, 511
. : milestone, 490,
iast_HARDCODED_SECRET_DISABLED (477.796 µs) : 456, 499
. : milestone, 478,
iast_INACTIVE (441.277 µs) : 420, 462
. : milestone, 441,
iast_TELEMETRY_OFF (468.907 µs) : 447, 491
. : milestone, 469,
tracing (438.91 µs) : 418, 460
. : milestone, 439,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section baseline
no_agent (1.336 ms) : 1317, 1355
. : milestone, 1336,
appsec (1.705 ms) : 1682, 1729
. : milestone, 1705,
appsec_no_iast (1.714 ms) : 1690, 1737
. : milestone, 1714,
iast (1.454 ms) : 1432, 1476
. : milestone, 1454,
profiling (1.462 ms) : 1439, 1485
. : milestone, 1462,
tracing (1.465 ms) : 1440, 1489
. : milestone, 1465,
section candidate
no_agent (1.343 ms) : 1324, 1362
. : milestone, 1343,
appsec (1.706 ms) : 1682, 1731
. : milestone, 1706,
appsec_no_iast (1.7 ms) : 1675, 1726
. : milestone, 1700,
iast (1.468 ms) : 1446, 1490
. : milestone, 1468,
profiling (1.47 ms) : 1447, 1492
. : milestone, 1470,
tracing (1.462 ms) : 1438, 1486
. : milestone, 1462,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section baseline
no_agent (15.043 s) : 15043000, 15043000
. : milestone, 15043000,
appsec (15.033 s) : 15033000, 15033000
. : milestone, 15033000,
iast (18.837 s) : 18837000, 18837000
. : milestone, 18837000,
iast_GLOBAL (17.893 s) : 17893000, 17893000
. : milestone, 17893000,
profiling (15.035 s) : 15035000, 15035000
. : milestone, 15035000,
tracing (14.848 s) : 14848000, 14848000
. : milestone, 14848000,
section candidate
no_agent (15.261 s) : 15261000, 15261000
. : milestone, 15261000,
appsec (15.105 s) : 15105000, 15105000
. : milestone, 15105000,
iast (18.702 s) : 18702000, 18702000
. : milestone, 18702000,
iast_GLOBAL (17.657 s) : 17657000, 17657000
. : milestone, 17657000,
profiling (15.406 s) : 15406000, 15406000
. : milestone, 15406000,
tracing (14.974 s) : 14974000, 14974000
. : milestone, 14974000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~d1aac21e0a, baseline=1.39.0-SNAPSHOT~e024c381c7
dateFormat X
axisFormat %s
section baseline
no_agent (1.475 ms) : 1462, 1487
. : milestone, 1475,
appsec (2.249 ms) : 2213, 2284
. : milestone, 2249,
iast (1.992 ms) : 1948, 2035
. : milestone, 1992,
iast_GLOBAL (2.015 ms) : 1971, 2058
. : milestone, 2015,
profiling (1.884 ms) : 1849, 1919
. : milestone, 1884,
tracing (1.858 ms) : 1824, 1892
. : milestone, 1858,
section candidate
no_agent (1.47 ms) : 1458, 1481
. : milestone, 1470,
appsec (2.241 ms) : 2206, 2276
. : milestone, 2241,
iast (1.971 ms) : 1928, 2013
. : milestone, 1971,
iast_GLOBAL (2.021 ms) : 1978, 2065
. : milestone, 2021,
profiling (1.879 ms) : 1844, 1913
. : milestone, 1879,
tracing (1.858 ms) : 1824, 1891
. : milestone, 1858,
|
64c8f77 to
d1aac21
Compare
What Does This Do
Free all retained data structures by the
AppSecRequestContextwhen the request ends.Motivation
When the span holding the reference to the
AppSecRequestContextis in pending state, there is a lot of data retained by AppSec (headers, cookies, addresses...) that are no longer required as they have already being flushed to the span. The only catch is for the cases were additional post processing is required (e.g. API security).Additional Notes
Screenshots with the retained sizes of


AppSecRequestContext:Before
After
Contributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issue[ ] Update the public documentation in case of new configuration flag or behavior