Resources that are "too large" cause the nautobot process to crash
### Environment
* Nautobot version (Docker tag too if applicable): 2.3.4 (Docker tag 'latest')
* Python version: 3.10.15
* Database platform, version: PostgreSQL 15.1
* Middleware(s): None

### Steps to Reproduce
1. Create 200k devices
2. Create a location
3. Create a new Dynamic Group -> dcim | device -> filter-defined
4. Edit the new Dynamic Group -> Add Location -> Save
5. Watch nautobot spin for 10 minutes before returning 502.

### Expected Behavior
Dynamic group gets updated to have the new location, and it takes far less than 10 minutes.

### Observed Behavior
Nautobot crashes. This is from the nautobot-server logs:

```
Mon Sep 30 19:39:09 2024 - *** HARAKIRI ON WORKER 14 (pid: 101, try: 1, graceful: yes) ***
Mon Sep 30 19:39:09 2024 - HARAKIRI !!! worker 14 status !!!
Mon Sep 30 19:39:09 2024 - HARAKIRI [core 0] 172.19.0.1 - POST /extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/edit/ since 1727724549
Mon Sep 30 19:39:09 2024 - HARAKIRI !!! end of worker 14 status !!!
Mon Sep 30 19:39:09 2024 - HARAKIRI triggered by worker 14 core 0 !!!
2024/09/30 19:39:09 [error] 83#83: *1 upstream prematurely closed connection while reading response header from upstream, client: 172.19.0.1, server: , request: "POST /extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/edit/ HTTP/1.1", upstream: "uwsgi://unix:/var/run/app.uwsgi:", host: "localhost:8081", referrer: "http://localhost:8081/extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/edit/"
172.19.0.1 - - [30/Sep/2024:19:39:09 +0000] "POST /extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/edit/ HTTP/1.1" 502 559 "http://localhost:8081/extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/edit/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
DAMN ! worker 14 (pid: 101) died, killed by signal 9 :( trying respawn ...
Respawned uWSGI worker 14 (new pid: 248)
19:39:10.211 INFO    nautobot :
  Nautobot initialized!
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xaaab2500e750 pid: 248 (default app)
```


### Additional notes:
I am working on upgrading an existing system from 1.6 to 2.3.4. I am experiencing this issue as part of the upgrade. While this is not a brand new installation, the only plugin enabled is an access control plugin. I have not truly attempted with a brand new installation because that "Create 200k devices" step, but I have attached a screenshot of what my dynamic group looks like before I attempt a modification:
![Screenshot 2024-09-27 at 11 37 39 AM](https://github.com/user-attachments/assets/d6efae47-1eb5-4d2a-ac9a-f8bcd3766885)

I CAN successfully modify existing dynamic groups, as long as their filters keep their associated device count below the magic threshold. I have not identified said threshold yet, but it does not immediately appear to be resource dependent. I originally encountered this error in an environment using 20GB memory and 2 cores, but it still fails in the same amount of time (about 10 minutes) with 30 GB memory and 8 cores.

I have noticed similar behavior when I attempt to open up the "IP Addresses" tab in one of the namespaces that has 100k+ IPs assigned to it, so this does not appear to be limited exclusively to Dynamic Groups.

This also happens when I try to perform the update through pynautobot, with some slightly different information in case it helps:
```
>>> dg = nautobot.extras.dynamic_groups.get(id="61ba43ba-2eb7-4689-aeba-c37b978d2630")
>>> dg.update({"filter": {"location": ["DC1"]}})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/kfischer/Workspace/stuff/scripts/nautobot_v2_migration/venv/lib/python3.12/site-packages/pynautobot/core/response.py", line 454, in update
    return self.save()
           ^^^^^^^^^^^
  File "/Users/kfischer/Workspace/stuff/scripts/nautobot_v2_migration/venv/lib/python3.12/site-packages/pynautobot/core/response.py", line 424, in save
    if req.patch({i: serialized[i] for i in diff}):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kfischer/Workspace/stuff/scripts/nautobot_v2_migration/venv/lib/python3.12/site-packages/pynautobot/core/query.py", line 428, in patch
    return self._make_call(verb="patch", data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kfischer/Workspace/stuff/scripts/nautobot_v2_migration/venv/lib/python3.12/site-packages/pynautobot/core/query.py", line 290, in _make_call
    raise RequestError(req)
pynautobot.core.query.RequestError: The request failed with code 502 Bad Gateway but more specific details were not returned in json. Check the Nautobot Logs or investigate this exception's error attribute.
```

And the associated nautobot server logs:
```
172.19.0.1 - - [30/Sep/2024:19:09:51 +0000] "PATCH /api/extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/ HTTP/1.1" 400 38 "-" "python-requests/2.32.3"
19:09:57.465 INFO    nautobot.core.api.views.ModelViewSet :
  Updating dynamic group kfischer-test-dcim-device (PK: 61ba43ba-2eb7-4689-aeba-c37b978d2630)
Mon Sep 30 19:19:57 2024 - *** HARAKIRI ON WORKER 2 (pid: 89, try: 1, graceful: yes) ***
Mon Sep 30 19:19:57 2024 - HARAKIRI !!! worker 2 status !!!
Mon Sep 30 19:19:57 2024 - HARAKIRI [core 0] 172.19.0.1 - PATCH /api/extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/ since 1727723397
Mon Sep 30 19:19:57 2024 - HARAKIRI !!! end of worker 2 status !!!
Mon Sep 30 19:19:57 2024 - HARAKIRI triggered by worker 2 core 0 !!!
2024/09/30 19:19:58 [error] 83#83: *24 upstream prematurely closed connection while reading response header from upstream, client: 172.19.0.1, server: , request: "PATCH /api/extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/ HTTP/1.1", upstream: "uwsgi://unix:/var/run/app.uwsgi:", host: "localhost:8081"
172.19.0.1 - - [30/Sep/2024:19:19:58 +0000] "PATCH /api/extras/dynamic-groups/61ba43ba-2eb7-4689-aeba-c37b978d2630/ HTTP/1.1" 502 157 "-" "python-requests/2.32.3"
DAMN ! worker 2 (pid: 89) died, killed by signal 9 :( trying respawn ...
Respawned uWSGI worker 2 (new pid: 170)
19:19:59.171 INFO    nautobot :
  Nautobot initialized!
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xaaaae1b46750 pid: 170 (default app)
```