Terrible performance after switching from nginx-unit to granian #1624
Replies: 1 comment
-
|
Hi. I've been wrestling with the same problem as I have been testing 4.5.5 in staging as an upgrade from 4.4.7. There is an easy fix to get your app unjammed. We use the community Helm chart with Kubernetes. Your situation may be a little different. Netbox is launched by this script. Notice that if Here are all the Granian config options: https://github.com/emmett-framework/granian?tab=readme-ov-file#options
So we need to set GRANIAN_WORKERS to something > 4. Granian config options can be set as switches or ENV vars. Since netbox is launched by a script that can't change, we need to set an ENV var. IIRC the off the shelf guideline for gunicorn was something like "2 * CPUs + 1". I did a little bit of perf testing and found on our machines, I could get to around 100% CPU utilization on one CPU by driving 3 to 4 cores.. so there's a limit. But the workers need time to recover and we already know that "4" isn't enough. For starters, I tested with 10 workers but decided to roll out (6 * CPUs + 1). For one CPU, that's 7 workers; 2 CPUs = 13 workers. etc. If loads are constant and high, that may be too many. If loads are spotty but hit hard (like terraform plan) then it may be fine. This is a new development, so I will be watching the charts and working on pushing for max performance. Since we're using Kubernetes, this is the change to the values file to create 7 workers. See performance measures below. Performance
BeforeSome example timings from AfterEven with wild parallelism (we aren't configuring 200 APIs worth of Netbox stuff, but there are a few dozen API endpoints hit at once), no problem now vs. huge problem before |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
with NetBox 4.5.2, it's necessary to use NetBox Docker version 4.0.0 and switch to Granian as the application/web server.
After the switch, we've observed performance issues with NetBox 4.5.2 and 4.5.3 as soon as the system is under load (30+ clients). The time required for a GraphQL query can increase tenfold (from 2 to 20 seconds).
Using the Docker container without further configuration doesn't seem to be straightforward.
We're currently wondering if other users have encountered similar performance problems and if there are any solutions to restore the previous nginx performance, as it appears Granian requires significantly more configuration than nginx-unit.
Kind Regards,
Kay
Beta Was this translation helpful? Give feedback.
All reactions