NetBox Version
v4.5.7
Python Version
3.14
Area(s) of Concern
Details
The current implementation of prefix views exhibits high latency (over 5 minutes) and significant memory usage growth (approximately +500 MB) in environments with large-scale IPAM data.
Target Path
- /ipam/prefixes/
- /ipam/prefixes/<id of 10.0.0.0/8 prefix>/
Expected Behavior
- Pages should load within a reasonable time (e.g., a few seconds) even with large datasets.
Actual Behavior
- Page load time exceeds 5 minutes.
- Memory usage increases by approximately 500 MB during request.
Observations notes
- In List View (/ipam/prefixes/), the loading time drops from over 5 minutes to under 1 second when the "Utilization" column is removed. This suggests that the utilization calculation is the primary bottleneck.
Environment
Registered Data
- Prefixes: 10.0.0.0/8 subdivided into /23 prefixes. (32,769 total)
- IP Addresses: 1,000,000 entries within 10.0.0.0/8.
Versions
$ python --version
Python 3.14.3
// I reproduced this issue on the latest main branch (commit: [dbb871b75a3517860d5274db1427a31ec3b7d10a]).
$ git rev-parse HEAD
dbb871b75a3517860d5274db1427a31ec3b7d10a
$ grep '^version:' release.yaml
version: "4.5.7"
$ ./manage.py version
5.2.12
$ psql -V
psql (PostgreSQL) 16.13
$ redis-server --version
Redis server v=6.2.20 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=cc01d7ff18b462c0
Server Spec
Reproduction Steps
-
Deploy NetBox on a VM by following the official documentation:
https://netbox.readthedocs.io/en/stable/development/getting-started/
- Note that DEBUG and DEVELOPER in "6. Configure NetBox" are set to "False" to measure performance in a production-like environment.
-
Open the NetBox shell:
-
Run the following script to register the seed data:
from netaddr import IPNetwork
from ipam.models import Prefix
from ipam.choices import PrefixStatusChoices
from itertools import islice
from ipam.models import IPAddress
# Create root prefix
parent, _ = Prefix.objects.get_or_create(
prefix="10.0.0.0/8",
defaults={"status": PrefixStatusChoices.STATUS_ACTIVE, "description": "seed root"},
)
# Create /23 child prefixes
children = [
Prefix(
prefix=str(p),
status=PrefixStatusChoices.STATUS_ACTIVE,
description="seed /23",
)
for p in IPNetwork("10.0.0.0/8").subnet(23)
]
Prefix.objects.bulk_create(children, batch_size=1000)
# Create 1,000,000 IP addresses
remaining_ip_count = 1_000_000
ip_addresses_to_create = []
for prefix in children[: (remaining_ip_count + 254) // 255]:
ip_count_for_prefix = min(255, remaining_ip_count)
for ip in islice(IPNetwork(str(prefix.prefix)).iter_hosts(), ip_count_for_prefix):
ip_addresses_to_create.append(
IPAddress(
address=f"{ip}/23",
status="active",
description="seed 1m ip",
)
)
remaining_ip_count -= ip_count_for_prefix
IPAddress.objects.bulk_create(ip_addresses_to_create, batch_size=5000)
- Start the server.
./manage.py runserver --insecure 0.0.0.0:8000
- Access the following URL:
- /ipam/prefixes/
- /ipam/prefixes/<id of 10.0.0.0/8>/
Result
- /ipam/prefixes/
- It takes 5.6 minutes to load the page.
- /ipam/prefixes/<id of 10.0.0.0/8>/
- It takes 5.4 minutes to load the page.

NetBox Version
v4.5.7
Python Version
3.14
Area(s) of Concern
Details
The current implementation of prefix views exhibits high latency (over 5 minutes) and significant memory usage growth (approximately +500 MB) in environments with large-scale IPAM data.
Target Path
Expected Behavior
Actual Behavior
Observations notes
Environment
Registered Data
Versions
Server Spec
Reproduction Steps
Deploy NetBox on a VM by following the official documentation:
https://netbox.readthedocs.io/en/stable/development/getting-started/
Open the NetBox shell:
Run the following script to register the seed data:
Result