Sluggish performance, database corruption? #14726
Unanswered
llamafilm
asked this question in
Help Wanted!
Replies: 2 comments 4 replies
-
It looks like the majority of my problem may be inefficient code in this Prometheus plugin. I turned on |
Beta Was this translation helpful? Give feedback.
3 replies
-
Just as another data point — I bulk deleted 1000 devices using the webpage and the operation took 290 seconds (measured by analyzing Postgres log). I'm not sure if these kind of speeds are considered normal for Netbox? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that some API queries are feeling sluggish. For example this one takes 23 seconds. I have 1158 devices.
I have some experience debugging other systems as a sys admin, but I'm very new to Netbox. So here's my attempt at diagnosing the issue.
That example HTTP download takes less than 10ms; most of the time is spent talking to the database. Postgres is running in RDS Aurora and its metrics look fine, fairly low utilization. Netbox is running on EC2 m5.large with 2 CPU cores, so I tried upgrading to m5.2xlarge (8 cores) and that didn't help at all. The Prometheus plugin is the main problem, but other pages are fairly slow too. Here
/dcim/devices
takes 845ms shown in Chrome dev tools, and again most of the time is spent waiting on the server.I turned on debug logging for netbox and django, and the log file is massive, growing in 250MB in just a few minutes. Below is an example of one of the errors. It looks like something is corrupt in the database, and I don't know how to fix it. I tried removing all plugins. I'm not sure if this is a red herring... is is it normal for the debug log to be filled with exceptions like this? With debug turned off, I don't see any errors, but performance is still sluggish.
Specs
Netbox v3.7.0
PostgreSQL 15.3
Python 3.10.12
expand for debug log snippet
Beta Was this translation helpful? Give feedback.
All reactions