Jenkin start-up time is too long

We are in the process of upgrading Jenkins from 2.289.2 to 2.375.4 (for some reason we need to move to this version and consider a latest LTS version for next upgrade cycle).

In this, Jenkins start-up is taking too long to come up in 2.375.4. Mostly it is on CASC init.

Log:

2024-02-05 10:29:35.174+0000 [id=56]	INFO	o.s.s.l.DefaultSpringSecurityContextSource#<init>: Configure with URL ldap://**********************/o=*** and root DN o=***
2024-02-05 10:29:35.176+0000 [id=56]	INFO	o.s.l.c.s.AbstractContextSource#afterPropertiesSet: Property 'password' not set - blank password will be used
2024-02-05 10:29:35.186+0000 [id=56]	INFO	o.s.s.l.s.FilterBasedLdapUserSearch#<init>: Searches will be performed from the root o=*** since SearchBase not set
2024-02-05 10:29:35.225+0000 [id=56]	INFO	o.s.s.l.u.DefaultLdapAuthoritiesPopulator#<init>: Will perform group search from the context source base since groupSearchBase is empty.
2024-02-05 11:05:04.856+0000 [id=56]	WARNING	i.j.p.casc.BaseConfigurator#createAttribute: Can't handle class javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration#metaClass: type is abstract but not Describable.
2024-02-05 11:05:04.948+0000 [id=56]	WARNING	i.j.p.casc.BaseConfigurator#createAttribute: Can't handle class javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration#metaClass: type is abstract but not Describable.
Processing provided DSL script
2024-02-05 11:05:07.764+0000 [id=56]	WARNING	java_util_logging_Logger$warning$0#call: Trouble schedule some jobs
2024-02-05 11:05:07.770+0000 [id=56]	INFO	jenkins.model.Jenkins$5#runTask: Took 2140551ms for ConfigurationAsCode.init by pool-6-thread-15

Jenkins setup:
Running in Kubernetes: 1.24
Jenkins has ~6.5k jobs (~6k freestyle and remaining workflow jobs)

Jenkins: 2.375.4
OS: Linux - 5.15.106-talos
Java: 11.0.18 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

Parameterized-Remote-Trigger:3.2.0
PrioritySorter:4.1.0
ace-editor:1.1
analysis-model-api:10.23.1
ansicolor:1.0.2
ant:487.vd79d090d4ea_e
antisamy-markup-formatter:159.v25b_c67cd35fb_
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
authentication-tokens:1.4
badge:1.9.1
blueocean:1.27.5
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.5
blueocean-commons:1.27.5
blueocean-config:1.27.5
blueocean-core-js:1.27.5
blueocean-dashboard:1.27.5
blueocean-display-url:2.4.2
blueocean-events:1.27.5
blueocean-git-pipeline:1.27.5
blueocean-github-pipeline:1.27.5
blueocean-i18n:1.27.5
blueocean-jira:1.27.5
blueocean-jwt:1.27.5
blueocean-personalization:1.27.5
blueocean-pipeline-api-impl:1.27.5
blueocean-pipeline-editor:1.27.5
blueocean-pipeline-scm-api:1.27.5
blueocean-rest:1.27.5
blueocean-rest-impl:1.27.5
blueocean-web:1.27.5
bootstrap4-api:4.6.0-6
bootstrap5-api:5.2.1-3
bouncycastle-api:2.29
branch-api:2.1105.v472604208c55
build-blocker-plugin:1.7.9
build-monitor-plugin:1.14-744.v35fd6fa_a_26b_2
build-timeout:1.26
build-user-vars-plugin:1.9
buildtriggerbadge:251.vdf6ef853f3f5
caffeine-api:3.1.6-115.vb_8b_b_328e59d8
checks-api:1.8.1
clone-workspace-scm:84.v147686859e1c
cloud-stats:302.v45b_647b_90608
cloudbees-bitbucket-branch-source:805.v7f97d29dc0f5
cloudbees-disk-usage-simple:182.v62ca_0c992a_f3
cloudbees-folder:6.800.v71307ca_b_986b
command-launcher:106.vb_a_b_8f751309c
commons-lang3-api:3.13.0-62.v7d18e55f51e2
commons-text-api:1.10.0-68.v0d0b_c439292b_
conditional-buildstep:1.4.3
config-file-provider:952.va_544a_6234b_46
configuration-as-code:1625.v27444588cc3d
copyartifact:714.v28a_34f8c563f
credentials:1224.vc23ca_a_9a_2cb_0
credentials-binding:626.v8d9034b_8ea_cc
data-tables-api:1.12.1-4
description-setter:1.10
display-url-api:2.200.vb_9327d658781
docker-commons:419.v8e3cd84ef49c
docker-workflow:563.vd5d2e5c4007f
durable-task:513.vc48a_a_075a_d93
echarts-api:5.4.0-1
envinject:2.908.v66a_774b_31d93
envinject-api:1.199.v3ce31253ed13
extended-read-permission:3.2
external-monitor-job:207.v98a_a_37a_85525
favorite:2.4.3
font-awesome-api:6.2.1-1
forensics-api:1.17.0
gerrit-trigger:2.39.1
git:5.0.2
git-client:4.3.0
git-server:99.va_0826a_b_cdfa_d
github:1.37.2
github-api:1.314-431.v78d72a_3fe4c3
github-branch-source:1728.v859147241f49
groovy:453.vcdb_a_c5c99890
groovy-postbuild:228.vcdb_cf7265066
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.31
instance-identity:173.va_37c494ec4e5
ionicons-api:56.v1b_1c8c49374e
jackson2-api:2.15.2-350.v0c2f3f8fc595
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:243.vb_b_503b_b_45537
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.8-1
jdk-tool:73.vddf737284550
jenkins-design-language:1.27.5
jersey2-api:2.40-1
jira:3.9
jjwt-api:0.11.5-77.v646c772fddb_0
job-dsl:1.82
jobConfigHistory:1212.vd4470d08ff12
jquery-detached:1.2.1
jquery3-api:3.6.1-2
jsch:0.2.8-65.v052c39de79b_2
junit:1202.v79a_986785076
kubernetes:3937.vd7b_82db_e347b_
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9
kubernetes-credentials:0.10.0
kubernetes-credentials-provider:1.225.v14f9e6b_28f53
ldap:694.vc02a_69c9787f
lockable-resources:1131.vb_7c3d377e723
mailer:457.v3f72cb_e015e5
mapdb-api:1.0.9-28.vf251ce40855d
matrix-auth:3.1.9
matrix-project:802.v8013b_40c7edc
maven-plugin:3.22
mercurial:1260.vdfb_723cdcc81
metrics:4.2.18-439.v86a_20b_a_8318b_
mina-sshd-api-common:2.10.0-69.v28e3e36d18eb_
mina-sshd-api-core:2.10.0-69.v28e3e36d18eb_
momentjs:1.1.1
monitoring:1.95.0
multiple-scms:0.8
naginator:1.19.2
nested-view:1.32
okhttp-api:4.11.0-145.vcb_8de402ef81
openstack-cloud:2.63
pam-auth:1.10
parameterized-trigger:2.45
permissive-script-security:0.7
pipeline-build-step:491.v1fec530da_858
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-graph-view:202.v6da_a_9e590325
pipeline-groovy-lib:671.v07c339c842e8
pipeline-input-step:477.v339683a_8d55e
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2133.ve46a_6113dfc3
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:2.2133.ve46a_6113dfc3
pipeline-model-extensions:2.2133.ve46a_6113dfc3
pipeline-rest-api:2.33
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2133.ve46a_6113dfc3
pipeline-stage-view:2.33
pipeline-utility-steps:2.16.0
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:2.20.0
popper-api:1.16.1-3
popper2-api:2.11.6-2
postbuild-task:1.9
prism-api:1.29.0-2
prometheus:2.2.3
pubsub-light:1.17
rebuild:320.v5a_0933a_e7d61
resource-disposer:0.23
run-condition:1.5
saml:4.418.vdfa_7489a_b_a_2d
scm-api:676.v886669a_199a_a_
script-security:1264.vecf66020eb_7d
sectioned-view:1.25
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
sse-gateway:1.26
ssh-agent:333.v878b_53c89511
ssh-credentials:305.v8f4381501156
ssh-slaves:2.877.v365f5eb_a_b_eec
sshd:3.312.v1c601b_c83b_0e
startup-trigger-plugin:2.9.3
structs:324.va_f5d6774f3a_d
subversion:2.17.3
swarm:3.41
text-finder:1.26
timestamper:1.25
token-macro:359.vb_cde11682e0c
trilead-api:2.84.v72119de229b_7
update-sites-manager:2.0.0
variant:59.vf075fe829ccb
view-job-filters:2.3
warnings-ng:9.23.1
windows-slaves:1.8.1
workflow-aggregator:596.v8c21c963d92d
workflow-api:1251.vd4889a_b_0a_065
workflow-basic-steps:1042.ve7b_140c4a_e0c
workflow-cps:3673.v5b_dd74276262
workflow-cps-global-lib:609.vd95673f149b_b
workflow-durable-task-step:1278.v94b_dc2b_50c6f
workflow-job:1316.vd2290d3341a_f
workflow-multibranch:746.v05814d19c001
workflow-scm-step:408.v7d5b_135a_b_d49
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c
ws-cleanup:0.45

-Thanks

See JENKINS-60125