Search code examples
uwsgi

Do i have to install uWSGI Cheaper algorithms?


Versions i use:

uWSGI: 2.0.19.1 (64bit)

os: Linux-3.10.0-1062.4.1.el7.x86_64


I am currently want to set up my vassal app with the uWSGI cheaper subsystem to handle the workers etc.

I decided to use the "spare2" algorithm, like in the uWSGI Doc´s explained.

https://uwsgi-docs.readthedocs.io/en/latest/Cheaper.html?highlight=spare2#spare2-cheaper-algorithm

However i get this message in my app log

unable to find requested cheaper algorithm, falling back to spare

So i looked into my uWSGI app with

uwsgi --cheaper-algos-list

*** uWSGI loaded cheaper algorithms ***
busyness
spare
backlog
manual
--- end of cheaper algorithms list ---

And it seems there is no "spare2" algorithm. In the Docs, Changelog of uWSGI i could not find any hint if "spare2" is maybe replaced or needed some special installment.


Question:

What happened with the "spare2" algorithm? Did i miss something in my uwsgi prerequisites? Do i have to download this as a plugin? Do i have to install uWSGI Cheaper algorithms?


Solution

  • Yeah I ran into the same problem, debugging for hours why spare2 was behaving exactly like spare would, without noticing the log line saying that spare2 was unavailable.

    Anyway, yes, the PyPI version of uwsgi is 2.0.x while the documentation and github code in master are 2.1.x. From what I'm reading, this difference has been around for quite some time.

    The author of spare2 kindly backported the plugin to 2.0.x: https://github.com/KLab/uwsgi-cheaper-spare2.

    I'm inclined to use the built-in busyness, but then, in 2.1.x the situation will reverse: spare2 is built-in and busyness is plug-in.