Skip to content

perf(hooks): reduce service reconciliation overhead#205

Open
gboutry wants to merge 2 commits into
canonical:mainfrom
gboutry:fix/hook-fastness
Open

perf(hooks): reduce service reconciliation overhead#205
gboutry wants to merge 2 commits into
canonical:mainfrom
gboutry:fix/hook-fastness

Conversation

@gboutry

@gboutry gboutry commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Reduce openstack-hypervisor configure-hook runtime by avoiding service
operations that are already converged and batching the remaining operations.

Assisted-By: Codex (gpt-5-6)

QA steps

The result of this branch is available under 2026.1/edge/fast to test it. This snap should be able to be used in place of the regular 2026.1/edge for any type of operation.


Methodology

I've personally run deployments, and could see a significant improvement.

The baseline was commit 759615f and the measured candidate snap was built
from 2484ab83. The candidate snap payload is identical to the current branch
head for the runtime code under test; the subsequent history rewrite only
reworded the commits.

Both modes were measured using separate, freshly provisioned Ubuntu LXD
virtual machines. The local snap was installed strictly after a devmode
bootstrap used to connect the required interfaces, and a post-install snapshot
was restored before each first-configuration sample.

OVS mode Scenario Baseline median ms Candidate median ms Improvement Median delta 95% CI ms Baseline p95 ms Candidate p95 ms
Hypervisor first-config 19603.791 12494.491 36.265% 6735.298 to 7417.717 20449.888 13309.975
Hypervisor no-op 14199.920 3439.400 75.779% 10325.646 to 11133.877 15927.868 3559.872
Hypervisor debug-toggle 20693.482 4520.399 78.155% 15082.632 to 16694.975 22781.561 4674.826
Hypervisor monitoring-toggle 22689.086 4499.841 80.167% 17506.268 to 19055.595 24121.088 4931.818
MicroOVN first-config 17787.353 8257.333 53.578% 9280.127 to 9790.722 18810.349 8757.864
MicroOVN no-op 14604.036 3102.196 78.758% 10963.822 to 12270.524 16354.105 3226.691
MicroOVN debug-toggle 21839.360 4233.893 80.613% 16711.901 to 18631.512 24875.480 4829.889
MicroOVN monitoring-toggle 21887.350 3746.655 82.882% 17594.037 to 19030.211 23773.582 3819.796

gboutry added 2 commits July 22, 2026 17:10
Avoid snapctl service tasks when the requested enabled and active
state is already satisfied. Keep corrective operations for every
partially converged state.

Treat file-transfer as unavailable until its TLS inputs exist so
faster reconciliation does not expose a start-limit timing dependency.

Assisted-By: Codex (gpt-5-6)
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
Combine service operations within each existing configure-hook phase
to reduce snapctl round trips. Preserve pre-command state filtering;
snapd applies the queued service operations after the hook exits.

Assisted-By: Codex (gpt-5-6)
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
@gboutry
gboutry force-pushed the fix/hook-fastness branch from ccec17f to eb762ec Compare July 22, 2026 15:10
@gboutry
gboutry requested review from ahmad-can and freyes and removed request for ahmad-can July 23, 2026 08:16
@gboutry
gboutry marked this pull request as ready for review July 23, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant