Netbox slow #5200

Closed
opened 2025-12-29 19:25:23 +01:00 by adam · 9 comments
Owner

Originally created by @floriant29 on GitHub (Aug 19, 2021).

NetBox version

v2.11.11

Python version

3.8

Steps to Reproduce

  1. create device with 1000 IP addresses
  2. display the 1000 addresses

Expected Behavior

Display the page quickly

Observed Behavior

21 seconds to display the page

Originally created by @floriant29 on GitHub (Aug 19, 2021). ### NetBox version v2.11.11 ### Python version 3.8 ### Steps to Reproduce 1. create device with 1000 IP addresses 2. display the 1000 addresses ### Expected Behavior Display the page quickly ### Observed Behavior 21 seconds to display the page
adam added the type: bug label 2025-12-29 19:25:23 +01:00
adam closed this issue 2025-12-29 19:25:23 +01:00
Author
Owner

@floriant29 commented on GitHub (Aug 19, 2021):

Debug

image

Syslog

Aug 19 10:29:06 netbox gunicorn[994]: [2021-08-19 10:29:06 +0200] [994] [DEBUG] GET /ipam/ip-addresses/
Aug 19 10:29:26 netbox gunicorn[994]: [2021-08-19 10:29:26 +0200] [994] [DEBUG] Closing connection.

gunicorn.py

GNU nano 4.8 /opt/netbox/gunicorn.py
The IP address (typically localhost) and port that the Netbox WSGI process should listen on
bind = '127.0.0.1:8001'

Number of gunicorn workers to spawn. This should typically be 2n+1, where n is the number of CPU cores present.
workers = 5

Number of threads per worker process
threads = 3

Timeout (in seconds) for a request to complete
timeout = 120

The maximum number of requests a worker can handle before being respawned
max_requests = 5000

loglevel = 'debug'

@floriant29 commented on GitHub (Aug 19, 2021): **Debug** ![image](https://user-images.githubusercontent.com/63879034/130038008-f1141940-8714-456b-8c67-cc8efa993fb6.png) **Syslog** Aug 19 10:29:06 netbox gunicorn[994]: [2021-08-19 10:29:06 +0200] [994] [DEBUG] GET /ipam/ip-addresses/ Aug 19 10:29:26 netbox gunicorn[994]: [2021-08-19 10:29:26 +0200] [994] [DEBUG] Closing connection. **gunicorn.py** GNU nano 4.8 /opt/netbox/gunicorn.py The IP address (typically localhost) and port that the Netbox WSGI process should listen on bind = '127.0.0.1:8001' Number of gunicorn workers to spawn. This should typically be 2n+1, where n is the number of CPU cores present. workers = 5 Number of threads per worker process threads = 3 Timeout (in seconds) for a request to complete timeout = 120 The maximum number of requests a worker can handle before being respawned max_requests = 5000 loglevel = 'debug'
Author
Owner

@sdktr commented on GitHub (Aug 19, 2021):

Can you link the exact csv imports anyone can use to reproduce this? And also the exact url you're using for the view.

Repro on demo.netbox.dev would be needed.

@sdktr commented on GitHub (Aug 19, 2021): Can you link the exact csv imports anyone can use to reproduce this? And also the exact url you're using for the view. Repro on demo.netbox.dev would be needed.
Author
Owner

@floriant29 commented on GitHub (Aug 19, 2021):

Sorry it's my production environment, i can't export this
I try with Edge Chromium and I display the page in 8 seconds.

@floriant29 commented on GitHub (Aug 19, 2021): Sorry it's my production environment, i can't export this I try with Edge Chromium and I display the page in 8 seconds.
Author
Owner

@jeremystretch commented on GitHub (Aug 19, 2021):

create device with 1000 IP addresses

What's the ratio of IPs to interfaces per device? Are there a thousand interfaces with one IP each?

@jeremystretch commented on GitHub (Aug 19, 2021): > create device with 1000 IP addresses What's the ratio of IPs to interfaces per device? Are there a thousand interfaces with one IP each?
Author
Owner

@floriant29 commented on GitHub (Aug 19, 2021):

There is 2274 interfaces and 154 ip attached to these interfaces

@floriant29 commented on GitHub (Aug 19, 2021): There is 2274 interfaces and 154 ip attached to these interfaces
Author
Owner

@sdktr commented on GitHub (Aug 20, 2021):

There is 2274 interfaces and 154 ip attached to these interfaces

OK, how are the IPs spread over these interfaces? And which page is slow? Opening the interface tab under the single device? Or some of the other views for IPs? Did this scenario work fast(er) in an older netbox version?

@sdktr commented on GitHub (Aug 20, 2021): > There is 2274 interfaces and 154 ip attached to these interfaces > > > > OK, how are the IPs spread over these interfaces? And which page is slow? Opening the interface tab under the single device? Or some of the other views for IPs? Did this scenario work fast(er) in an older netbox version?
Author
Owner

@floriant29 commented on GitHub (Aug 20, 2021):

at 90%, one interface = one ip
https://netbox.****.fr/ipam/ip-addresses/
the delays are random, I don't understand. Now on firefox, I open the page in 7 seconds vs 21 seconds yesterday :

Aug 20 08:29:47 netbox gunicorn[18001]: [2021-08-20 08:29:47 +0200] [18001] [DEBUG] GET /dcim/interfaces/
Aug 20 08:29:52 netbox gunicorn[18001]: [2021-08-20 08:29:52 +0200] [18001] [DEBUG] Closing connection.

@floriant29 commented on GitHub (Aug 20, 2021): at 90%, one interface = one ip https://netbox.****.fr/ipam/ip-addresses/ the delays are random, I don't understand. Now on firefox, I open the page in 7 seconds vs 21 seconds yesterday : Aug 20 08:29:47 netbox gunicorn[18001]: [2021-08-20 08:29:47 +0200] [18001] [DEBUG] GET /dcim/interfaces/ Aug 20 08:29:52 netbox gunicorn[18001]: [2021-08-20 08:29:52 +0200] [18001] [DEBUG] Closing connection.
Author
Owner

@sdktr commented on GitHub (Aug 20, 2021):

You can neglect the fqdn from your URL, we're just interested in the complete part behind the first slash (edit your post to hide it).

The page you mentions shows ALL IPs, without filters. I assume you have some sort of filter applied to only show whats of interest. These filters are interesting to know, once you have a reproducible slow scenario.

Also: is the Interfaces tab under the device slow as well?

You can set the pagination to something (way) lower then 1000 as well. You wont be scrolling through 1000 rows most of the time?

@sdktr commented on GitHub (Aug 20, 2021): You can neglect the fqdn from your URL, we're just interested in the complete part behind the first slash (edit your post to hide it). The page you mentions shows ALL IPs, without filters. I assume you have some sort of filter applied to only show whats of interest. These filters are interesting to know, once you have a reproducible slow scenario. Also: is the Interfaces tab under the device slow as well? You can set the pagination to something (way) lower then 1000 as well. You wont be scrolling through 1000 rows most of the time?
Author
Owner

@jeremystretch commented on GitHub (Aug 20, 2021):

the delays are random, I don't understand. Now on firefox, I open the page in 7 seconds vs 21 seconds yesterday

I'm moving this to a discussion since we're having a hard time getting clear answers, and there are clearly other factors at play. If it is determined that we can improve NetBox in some way, you're certainly welcome to open a new bug report or feature request citing the specific changes being proposed.

@jeremystretch commented on GitHub (Aug 20, 2021): > the delays are random, I don't understand. Now on firefox, I open the page in 7 seconds vs 21 seconds yesterday I'm moving this to a discussion since we're having a hard time getting clear answers, and there are clearly other factors at play. If it is determined that we can improve NetBox in some way, you're certainly welcome to open a new bug report or feature request citing the specific changes being proposed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5200