by rapsey · 9mo ago · 0 comments
Sorry but this is wrong. This is no kind of backpressure as any experienced erlang developer will tell you: properly doing backpressure is a massive pain in erlang. By default your system is almost guaranteed to break in random places under pressure that you are surprised by.
(I was one of David’s students; and I’ve founded/run a processor design startup raised £4m in 2023 and went bust last year based on a different idea with a much stronger software story.)
You're right in correcting the article, but I'd like to add that for probably around a decade, Erlang had 'sender punishment', which is what 'IsTom' who replied to you is probably talking about.
Ulf Wiger referred to sender_punishment as "a form of backpressure" (Erlang-questions mailing list, January 2011). 'sender punishment' was removed around 2018, in ad72a944c/OTP14667. I haven't read the whole discussion carefully, but it seems to be roughly "it wasn't clear that sender punishment solved more problems than it caused, and now that most machines are multi-core, that balance is tipped even more in favour of not having 'sender punishment'".
Is that sufficient and/or desirable backpressure, and does it provide everything your app needs? Maybe close enough for some applications?
You can also do some brute force backpressure stuff now; you can set a max heap size of a process and if it uses an on-heap message queue, it should be killed if the queue gets too large. Not very graceful, but create some back pressure.
I'm a fan of letting back pressure accrue by having clients timeout, and having servers drop requests that arrive too late to be serviced within the timeout, but you've got to couple that with effective monitoring and operations. Sometimes you do have to switch to a quick response to tell the client to try again later or other approaches.