Optimize VM interface replication in v2.9 schema migration #3918

Closed
opened 2025-12-29 18:32:04 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Jul 29, 2020).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

We need to spend more time looking for ways to optimize the 0016_replicate_interfaces schema migration for the virtualization app. There have been reports citing excessive delays when upgrading an installation with large numbers of virtual machine interfaces (150K+).

If we're not able to reduce this time, we should at least provide users with some estimate of the time that running the migration will take (relative to the number of objects being replicated).

Justification

Database schema migrations typically take very little time, because they typically only modify schema. In this case, we're actually copying objects from one table to another, updating related objects, and deleting the originals. The additional delay imposed in doing so is likely to surprise and frustrate users with a very large number of virtual machine interfaces defined.

Originally created by @jeremystretch on GitHub (Jul 29, 2020). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes We need to spend more time looking for ways to optimize the `0016_replicate_interfaces` schema migration for the `virtualization` app. There have been reports citing excessive delays when upgrading an installation with large numbers of virtual machine interfaces (150K+). If we're not able to reduce this time, we should at least provide users with some estimate of the time that running the migration will take (relative to the number of objects being replicated). ### Justification Database schema migrations typically take very little time, because they typically only modify schema. In this case, we're actually copying objects from one table to another, updating related objects, and deleting the originals. The additional delay imposed in doing so is likely to surprise and frustrate users with a very large number of virtual machine interfaces defined.
adam added the status: acceptedtype: housekeepingbeta labels 2025-12-29 18:32:04 +01:00
adam closed this issue 2025-12-29 18:32:04 +01:00
Author
Owner

@tyler-8 commented on GitHub (Jul 30, 2020):

Average rate was roughly 1890 interfaces/minute. This was done a dev machine with the database and Django app on one server - there didn't appear to be any resource utilization (CPU/memory) concerns during the migration.

@tyler-8 commented on GitHub (Jul 30, 2020): Average rate was roughly 1890 interfaces/minute. This was done a dev machine with the database and Django app on one server - there didn't appear to be any resource utilization (CPU/memory) concerns during the migration.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3918