Gunicorn max requests configuration

I have WebODM reverse proxied by the Caddy webserver to make it publicly available on the internet. However, I’ve noticed that the Caddy reverse proxied version has a lot of 502 errors while loading map tiles so the map doesn’t fully load always. Whereas, if I go directly to WebODM on the default port 8000, it works fine.

I determined that this is because Caddy, by default, has HTTP/2 enabled. HTTP/2 opens a single continuous connection to Caddy which in turn makes many more requests concurrently to the backend (i.e. WebODM) than would be normal (since the browser limits the number of concurrent connections and HTTP/1 is one connection per request).

If I turn HTTP/2 off in Caddy, it works fine because it is back to the browser’s concurrent connection limit. But it is slow. Gunicorn doesn’t support HTTP/2 yet but you can increase the max-requests option which I think would help with the issue. Right now, that is set to 250 in the start.sh file.

Is there any easy way to change this setting in the docker version without rebuilding docker images?

1 Like

Copy your start.sh locally to edit. Using this copy ensures you don’t introduce edits you didn’t mean to:
docker cp webapp:/webodm/start.sh .

Edit in your favorite editor. Then copy back to the docker machine:
docker cp start.sh webapp:/webodm/start.sh

Test. I think this isn’t persistent, so you’ll need to commit it:
docker commit webapp

This will write it out as a new container. I assume that the next time you update WebODM, you will lose these changes, but I think it should work until then.

2 Likes

Thanks, @smathermather-cm! That did work, although, unfortunately, setting the max-request option did not solve the issue as I hoped.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.