Skip to content

Displaying the page of a prefix with many child prefixes (each having a child range) runs into gateway timeout #14500

@reduzent

Description

@reduzent

Deployment Type

Self-hosted

NetBox Version

v3.6.6

Python Version

3.11

Steps to Reproduce

The page /ipam/prefixes/1/ on our Netbox instance takes more than 20mins to display and runs into a timeout when not increasing timeout values.

My test system is a Debian 12 VM (VMware VM) with netbox 3.6.6. The system has two CPU cores and 4 GB Memory. Initial state is an empty database.

I can trigger the 504 Gateway Time-out (nginx error) when I create a prefix with 1000 child prefixes where each child prefix has one child range.

This is how I create the objects in nbshell:

mainpref = Prefix(prefix='10.128.0.0/11', status='active')
mainpref.full_clean()
mainpref.save()

mainpref = Prefix.objects.filter(prefix='10.128.0.0/11')[0]

prefsize = 256
prefcount = 1000

for i in range(0, prefcount*prefsize, prefsize):
    newpref = Prefix(prefix=mainpref.prefix[i].format() + '/24', status='active')
    newpref.full_clean()
    newpref.save()

for cpref in mainpref.get_child_prefixes():
    newrange = IPRange(start_address=cpref.prefix[100].format() + '/24' , end_address=cpref.prefix[250].format() + '/24' , status='active')
    newrange.full_clean()
    newrange.save()

If you apply this to a new installation, this URL triggers the timeout:

/ipam/prefixes/1/

Or click the result of this search:

/ipam/prefixes/?q=10.128.0.0%2F11

There is a related #13471 where it appears that we can't do much about it but hope that this going to be addressed in Netbox itself.

Expected Behavior

The page should be rendered within reasonable time.

Observed Behavior

We get a 504 when trying to visit the particular page.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions