Speed up API Bulk Updates #4684

Closed
opened 2025-12-29 19:19:30 +01:00 by adam · 2 comments
Owner

Originally created by @fabi125 on GitHub (Mar 19, 2021).

NetBox version

v2.10.6

Feature type

Change to existing functionality

Proposed functionality

Bring the performance of bulk updates via the API in line with the UI.

Use case

Updating ~400 devices via the PATCH bulk update endpoint takes on my machine around 40s. Doing the exact same update via the UI takes around 15s.

It would be great if the API could provide the same performance as the UI.

In some very basic tests I tried removing https://github.com/netbox-community/netbox/blob/v2.10.6/netbox/netbox/api/views.py#L82 which resulted in an around 25% speedup, lowering the API time to 30s. So maybe adding a parameter that prevents from all data being returned via the API is a good step?

The API bulk update code looked sufficiently different from the UI bulk update code that I wasn't able to try out more (I'm not as familiar with the NetBox code as I'd like to be).

Database changes

n/a

External dependencies

n/a

Originally created by @fabi125 on GitHub (Mar 19, 2021). ### NetBox version v2.10.6 ### Feature type Change to existing functionality ### Proposed functionality Bring the performance of bulk updates via the API in line with the UI. ### Use case Updating ~400 devices via the PATCH bulk update endpoint takes on my machine around 40s. Doing the exact same update via the UI takes around 15s. It would be great if the API could provide the same performance as the UI. In some very basic tests I tried removing https://github.com/netbox-community/netbox/blob/v2.10.6/netbox/netbox/api/views.py#L82 which resulted in an around 25% speedup, lowering the API time to 30s. So maybe adding a parameter that prevents from all data being returned via the API is a good step? The API bulk update code looked sufficiently different from the UI bulk update code that I wasn't able to try out more (I'm not as familiar with the NetBox code as I'd like to be). ### Database changes n/a ### External dependencies n/a
adam added the type: featurepending closure labels 2025-12-29 19:19:30 +01:00
adam closed this issue 2025-12-29 19:19:30 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 13, 2021):

So maybe adding a parameter that prevents from all data being returned via the API is a good step?

The behavior of the REST API must be consistent, and it must return all affected objects. I'm open to suggestions for optimization, however without a specific proposal that doesn't compromise the preceding two points this isn't actionable.

@jeremystretch commented on GitHub (Apr 13, 2021): > So maybe adding a parameter that prevents from all data being returned via the API is a good step? The behavior of the REST API must be consistent, and it must return all affected objects. I'm open to suggestions for optimization, however without a specific proposal that doesn't compromise the preceding two points this isn't actionable.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 29, 2021):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Apr 29, 2021): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4684