Fix 502/504 errors that KoBoCAT starts to return after running few hours/days even if the load is very low.
Additional info
502/504 can still happens under high load, obviously. This PR addresses a particular case:
uWSGI locks and it is not able to respawn new workers (thus not able to serve any requests anymore).
It happens because of deadlocks in Python.
See https://github.com/unbit/uwsgi/issues/1599#issuecomment-336584282 for more details.
Moreover, to avoid respawning many workers very often, the cheaper algorithm has been replace with busyness (instead spare). It does respond better under high load.
Related issues
Fixes kobotoolbox/kpi#3566
Related to kobotoolbox/kpi#3883
Description
Fix 502/504 errors that KoBoCAT starts to return after running few hours/days even if the load is very low.
Additional info
502/504 can still happens under high load, obviously. This PR addresses a particular case: uWSGI locks and it is not able to respawn new workers (thus not able to serve any requests anymore). It happens because of deadlocks in Python. See https://github.com/unbit/uwsgi/issues/1599#issuecomment-336584282 for more details.
Moreover, to avoid respawning many workers very often, the
cheaper
algorithm has been replace withbusyness
(insteadspare
). It does respond better under high load.Related issues
Fixes kobotoolbox/kpi#3566 Related to kobotoolbox/kpi#3883