Hi guys,

I would appreciate any feedback about the idea of implementing a new
load function to ask about how saturated is your reactor.

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/5fef3cae043abd62165ce40b181286e18f5fb19c
[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/

Reply via email to