jxm

jxm

The topic’s name is a quote from a slide in WhatsApp’s Anton Lavrik’s talk at Code BEAM 2018.

He basically describes WhatsApp approach to handling distribution in their Erlang cluster and casually mentions that the BEAM is not really made to handle overload, which is a problem. He goes on to list a few things to consider to manage that, including prominently :

Generally strive to remove all backpressure

Well, that got me scratching my head a bit. Voluntary backpressure is a powerful mechanism to manage message queues length and regulate throughtput. Projects like gen_stage and flow leverage that.

Sure, it has a cost associated to it. In Designing for scalability with Erlang/OTP, @FrancescoC and @rvirding (well, at least one of you two :slight_smile: ) state

Start controlling load only if you have to.

So, unless Anton Lavrik meant a different kind of involuntary backpressure (silent message drops on process failure/restart, something like that?), and not backpressure as a load control tool, it means (I’m assuming the WhatsApp engineers do know full well what they’re doing) that the regulation costs more than it helps. The major cost that seems to be presented in the rest of the talk is that backpressure due to a hotspot or failure in the cluster in effect propagates failure to the rest of the cluster.

It feels counter-intuitive, as my mental model shows increased benefits with scale, unless you’re in the kind of system where to apply backpressure you need to serialize requests into dispatcher processes acting as a bottleneck in front of your workers. But given the efforts the WhatsApp team made to partition their data to reduce locking and optimize replication/recovery granularity, I doubt this is the case.

Then it got me thinking in terms not of two cost/benefit ratio curves that might intersect several times but a bit more like the modern approach to buffering in network communications. The industry used to solve real-time stream ordering issues and several other network warts by using increasingly large buffers in L2 and L3 network equipment until the buffer bloat problem became a thing. Both buffered and wire-speed approaches work well, but in different domains. The fix that buffering gives you is very comfortable in terms of capacity management and micro-bursts handling (typical of stuff like iSCSI storage) but is untenable when you do a lot of VoIP for example, because of an accordion effect in time distribution of delivery caused by injected jitter and much higher 10th percentile latencies.

Is it the same kind of tradeoff at play here? Is the important consideration inbound traffic characteristics like bursty-ness and jitter?

For the particular case of Erlang process message queues, how would one start from Little’s Law and cook a model to estimate the impact of both approaches?

What do you guys think?

Showing Posts 1 to 1

blatyo

blatyo

Conduit Core Team

Any place where you have back pressure, you have created a bottleneck. Not every kind of system needs to care about bottle necks in the same way. If you’re building a real time messaging platform, you don’t want anything to build up behind a bottleneck. If you’re building a streaming ETL system, which GenStage is good at, you may just care that you don’t drop events and it doesn’t matter a ton that everything is calculated immediately.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
AstonJ
Since we have deprecated our Erlang sections (as we have dedicated Erlang Forums now) let’s add this thread for those who’d like to post ...
New
maennchen
:warning: Security advisory: Decimal DoS vulnerability A vulnerability has been published for decimal where very large exponents can cau...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews