diff --git a/docker/launch-netbox.sh b/docker/launch-netbox.sh index 7054f43..20d96e9 100755 --- a/docker/launch-netbox.sh +++ b/docker/launch-netbox.sh @@ -5,8 +5,9 @@ exec granian \ --port "8080" \ --interface "wsgi" \ --no-ws \ - --workers "4" \ - --backpressure "4" \ + --workers "${GRANIAN_WORKERS}" \ + --respawn-failed-workers \ + --backpressure "${GRANIAN_BACKPRESSURE}" \ --loop "uvloop" \ --log \ --log-level "info" \ @@ -15,4 +16,5 @@ exec granian \ --static-path-route "/static" \ --static-path-mount "/opt/netbox/netbox/static/" \ --pid-file "/tmp/granian.pid" \ + "${GRANIAN_EXTRA_ARGS[@]}" \ "netbox.granian:application" diff --git a/env/netbox.env b/env/netbox.env index 52fca3b..88c8705 100644 --- a/env/netbox.env +++ b/env/netbox.env @@ -15,6 +15,8 @@ EMAIL_USERNAME=netbox # EMAIL_USE_SSL and EMAIL_USE_TLS are mutually exclusive, i.e. they can't both be `true`! EMAIL_USE_SSL=false EMAIL_USE_TLS=false +GRANIAN_BACKPRESSURE=4 +GRANIAN_WORKERS=4 GRAPHQL_ENABLED=true MEDIA_ROOT=/opt/netbox/netbox/media METRICS_ENABLED=false