Skip to content

Conversation

@sanderegg
Copy link
Member

@sanderegg sanderegg commented Jan 6, 2026

What do these changes do?

Latest tests showed that the dynamic-sidecar startup time is relatively slow, i.e. between 7-10 seconds between the boot.sh last log entry and the first entry coming from the python fastapi application.

Tests show that this is mostly due to application import time. With some noticeably slow in the application.py file.
Noticeably slow are the import of the REST Api routers/RPC routers. Also the Tracing facilities import many many modules.

The problem is slightly reduced by importing inside the functions, so that the import is done when the functions are used instead of module import time. This is beneficial to follow timings in the logs, as otherwise we are blind.

Related issue/s

How to test

Dev-ops

@sanderegg sanderegg added this to the Delirium Noel milestone Jan 6, 2026
@sanderegg sanderegg self-assigned this Jan 6, 2026
@sanderegg sanderegg added the a:dynamic-sidecar dynamic-sidecar service label Jan 6, 2026
@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.07%. Comparing base (ca9ec89) to head (de0b3a9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8720      +/-   ##
==========================================
+ Coverage   87.49%   89.07%   +1.57%     
==========================================
  Files        2018     1355     -663     
  Lines       79384    57312   -22072     
  Branches     1389      154    -1235     
==========================================
- Hits        69457    51050   -18407     
+ Misses       9531     6213    -3318     
+ Partials      396       49     -347     
Flag Coverage Δ
integrationtests 63.88% <100.00%> (-0.10%) ⬇️
unittests 88.20% <100.00%> (+1.89%) ⬆️
Components Coverage Δ
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 75.49% <ø> (-9.03%) ⬇️
agent 93.44% <ø> (ø)
api_server 91.35% <ø> (ø)
autoscaling 95.56% <ø> (ø)
catalog 92.06% <ø> (ø)
clusters_keeper 99.14% <ø> (ø)
dask_sidecar ∅ <ø> (∅)
datcore_adapter 97.95% <ø> (ø)
director 75.53% <ø> (+0.08%) ⬆️
director_v2 91.23% <ø> (-0.06%) ⬇️
dynamic_scheduler 96.54% <ø> (ø)
dynamic_sidecar 90.82% <100.00%> (+0.07%) ⬆️
efs_guardian 89.83% <ø> (ø)
invitations 90.90% <ø> (ø)
payments 92.45% <ø> (ø)
resource_usage_tracker 91.15% <ø> (+0.37%) ⬆️
storage 86.62% <ø> (-0.08%) ⬇️
webclient ∅ <ø> (∅)
webserver 86.55% <ø> (-0.06%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca9ec89...de0b3a9. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@YuryHrytsuk YuryHrytsuk left a comment

Choose a reason for hiding this comment

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

Thanks @sanderegg!

It would be nice to know, how much startup time did you save with these changes? A bit of clarity :)

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

Amazing, but good

@mguidon
Copy link
Member

mguidon commented Jan 6, 2026

I think 3.15 will do this automatically for all imports.
I guess this is also relevant for the s4l backend (I even load numpy there...)

@sanderegg
Copy link
Member Author

Thanks @sanderegg!

It would be nice to know, how much startup time did you save with these changes? A bit of clarity :)

@YuryHrytsuk on my computer about 1-2 seconds. on the EC2 I cannot say yet.

@mergify
Copy link
Contributor

mergify bot commented Jan 6, 2026

🧪 CI Insights

Here's what we observed from your CI run for de0b3a9.

🟢 All jobs passed!

But CI Insights is watching 👀

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Copy link
Contributor

@wvangeit wvangeit left a comment

Choose a reason for hiding this comment

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

Thx

@sanderegg sanderegg merged commit e21384b into ITISFoundation:master Jan 6, 2026
93 of 94 checks passed
@sanderegg sanderegg deleted the dynamic-sidecar/slow-start branch January 6, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:dynamic-sidecar dynamic-sidecar service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants