docker-mapproxy icon indicating copy to clipboard operation
docker-mapproxy copied to clipboard

Provide more flexibility for uwsgi startup options

Open justb4 opened this issue 4 years ago • 0 comments

Problem

Currently only a few uwsgi startup-options can be specified by the Docker Container user: mainly MAPPROXY_PROCESSES and MAPPROXY_THREADS via env vars. Also not in all contexts is stats(--stats) publishing required.

I came to this issue when trying to optimize uwsgi for optimal MapProxy performance. For example this article suggests to disable logging (via --disable-logging) and as MapProxy is stateless set Max Worker Lifetime (e.g. --max-worker-lifetime 30). This could all-in-all amount for over 30% performance improvement.

Proposed Solution

So when using env-vars ( uwsgi.ini is another option, see below) my suggestion is to:

  • leave out --stats option
  • add an UWSGI_EXTRA_OPTIONS optional env-var, that is appended to the existing startup options

A user could specify e.g. in a docker-compose file: UWSGI_EXTRA_OPTIONS="--disable-logging --max-worker-lifetime 30". This would be forward compatible (except for the stats option).

Another option would be to allow a UWSGI_OPTIONS where a user specifies a complete startup-options string.

Alternative Solution

The most flexible would be to start uwsgi with an uwsgi.ini file with a default that can be overridden e.g. by Docker-Volume mounting or extending the Docker Image. But at the same time this may create inflexibilities in environments where Docker Volume mounting is less preferred over env-vars like Kubernetes.

justb4 avatar Oct 19 '20 09:10 justb4