![](https://secure.gravatar.com/avatar/9b513ee7cc400c9b7374f4697a1e69ad.jpg?s=120&d=mm&r=g)
On Sun, Aug 6, 2017 at 3:57 PM, Pau Freixes <pfreixes@gmail.com> wrote:
Hi guys,
I would appreciate any feedback about the idea of implementing a new load function to ask about how saturated is your reactor.
Hi, Would it be possible for you to rephrase what you've done in terms of asyncio terminology? From what I can tell, "reactor" isn't a term used in the asyncio docs or code base. It might also improve the readability of your asyncio patch to use asyncio terminology in the code comments, doc strings, etc. --Chris
I have a proof of concept [1] of how the load function might be implemented in the Asyncio python loop.
The idea is to provide a method that can be used to ask about the load of the reactor in a specific time, this implementation returns the load taking into account the last 60 seconds but it can easily return the 5m and 15minutes ones u others.
This method can help services built on to of Asyncio to implement back pressure mechanisms that take into account a metric coming from the loop, instead of inferring the load using other metrics provided by external agents such as the CPU, load average u others.
Nowadays exists some alternatives for other languages that address this situation using the lag of a scheduler callback, produced by saturated reactors. The most known implementation is toobusy [2] a nodejs implementation.
IMHO the solution provided by tobusy has a strong dependency with the hardware needing to tune the maximum lag allowed in terms of milliseconds [3]. in the POF presented the user can use an exact value meaning the percentage of the load, perhaps 0.9
Any comment would be appreciated.
[1] https://github.com/pfreixes/cpython/commit/5fef3cae043abd62165ce40b181286e18... [2] https://www.npmjs.com/package/toobusy [3] https://www.npmjs.com/package/toobusy#tunable-parameters -- --pau _______________________________________________ Async-sig mailing list Async-sig@python.org https://mail.python.org/mailman/listinfo/async-sig Code of Conduct: https://www.python.org/psf/codeofconduct/