Replies: 1 comment 1 reply
-
This is not a transaction issue. Your db doesn't have enough connections to run the queries. You should look into scaling the db if for the amount of workers you are running. |
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.
-
I created a netbox custom script which iterates through the netbox devices given a certain pattern (approximately 4k devices), and then interrogates another service (Cisco NSO), to query certain operational data for reporting and compliance purposes.
The devices reporting is running with multi-threading, and it takes about 4 mins per device.
The issue I'm hitting currently is a scaling one, I've tried running around 100 worker threads, and unfortunately I'm hitting transaction issue, it seems that there's a limit on simultaneous transactions per script (not sure about the exact value).
Traceback of the error:
This traceback was triggers by the current device interfaces query:
list(Interface.objects.filter(device=device))
, this was run with 100 workers (1 woker per device).Is there a way to circumvent this limitation? I know that when the job is run, there's a single transaction created for the whole job, but is there a way to create and close transactions on the fly on the same job?
Beta Was this translation helpful? Give feedback.
All reactions