Live data from Hacker News

Queues don't fix overload (2014)

ferd.ca

11–20 of 156 posts

Re: Queues don't fix overload (2014)

#11
Basically Little's law. It is queues all the way down.

https://en.wikipedia.org/wiki/Little's_law

Additionally, here is a great talk on queuing theory and load shedding. One argument this talk makes is that autoscaling is not the silver bullet you think it is (similar to queues).

https://www.youtube.com/watch?v=-oQl1xv0hDk

Re: Queues don't fix overload (2014)

#12
post #7

The other thing to bear in mind about queues is that once they start showing of symptoms of something being wrong, collapse might be just around the corner or it might not be depending on the nature of the load. When congestion spikes start showing it is helpful to know some queuing theory to estimate how close the situation is to eating someone's weekend. Congestion collapses are an interesting time because most peo…

Hey, can you recommend something one might read to get up to speed on queuing theory? I certainly am not aware of it, but work with queues.

Re: Queues don't fix overload (2014)

#13
post #5

Depends. An overflowing queue that drops jobs from the front while backend chugs along as fast as it can, is for many cases a better outcome than the backend overloading and everything grinding to a halt. Compare it to a physical service desk. The one that has a queue, serves one person at a time, and people arriving will try again another day if the queue is too long. The one without queue has people fistfighting ov…

So it allows the dev team to blame the queue. Instead of “we decided to drop requests,” it’s “oh look, the queue is dropping requests.”

Re: Queues don't fix overload (2014)

#14

This is a weird article because it points out that queues don’t solve overload but neither do load shedding or back pressure. All 3 techniques are just different trade offs on what to do in the face of overload. All 3 have negative ramifications for the users of the system. Load shedding reduces availability, back pressure increases complexity and queues increase latency. In “critical” systems you need all 3. And all…

> Frankly, your load shedding or back pressure system is probably implemented on a queue one layer down the abstraction.

If you're building an API, you don't care how your clients cope with your backpressure. You just want to avoid overloading your services, and queues will indeed not help you with that past a certain point, whereas backpressure probably will. Or at least you can scale backpressure much more cheaply than you can scale queues.

Re: Queues don't fix overload (2014)

#15

This is a weird article because it points out that queues don’t solve overload but neither do load shedding or back pressure. All 3 techniques are just different trade offs on what to do in the face of overload. All 3 have negative ramifications for the users of the system. Load shedding reduces availability, back pressure increases complexity and queues increase latency. In “critical” systems you need all 3. And all…

I think it's the threshold of all people to truly understand that there's no solution to certain problems, only tradeoffs.

Queues are great, but can lead to catastrophic failure if you don't have a good way of handling the queue, so making an active choice about how you handle overload is part of designing a robust and resilient system.

Trading off new requests for current requests is, in my experience, a valid strategy for eCommerce for example. We called it "quenching".

Re: Queues don't fix overload (2014)

#17

> Queues Don't Fix Overload If the queue can withstand more simultaneous load than the processing service, they basically do.

Queues mitigate short-term overload. They don't fix overload. Even in the short term there are likely detrimental effects (as latency rises) and if your long term average input is higher than your average output then you are still overloaded.

Re: Queues don't fix overload (2014)

#18
What queues do is smooth out the mismatch between supply and demand. If the mismatch lasts long enough, the queue will overflow, and then you need to load shed (and you need to plan for what the least bad way of load shedding is). But queues do increase overall throughput, up to a point. If the demand was bursty on short timescales and you only allow a small queue to build before load-shedding, you may be wasting capacity. Increasing the allowed queue size lets you smooth out the demand, and so reduce the amount you need to load shed. But the crucial thing here is you're trading off latency against capacity. If that latency increase itself has no significant downside, then you should probably provision the queues so that they can grow until the latency does start to have a downside, because below that point the increase in capacity is worth it. Above that point, the latency itself is a problem, and you should be load-shedding rather than queuing. The trick with any queuing system is to understand when this transition should take place.

Edit: I should add that standing queues serve no purpose. If the demand is such that you're persistently queuing for a long time without the queue ever going idle, your transition between queuing and load-shedding is in the wrong place, and you should increase load-shedding, because you're adding latency for no reason.

Re: Queues don't fix overload (2014)

#19
Queues aren't really the problem here.

It's that the people making changes don't have a decent understanding of the system they are trying to fix. If you don't actually know what the problem is, your fix is not likely to work.

I have seen groups put huge amounts of work into a "fix" for a system when they are only really guessing at what the problem is. (Besides queues, people also seem to like adding "caches" -- often stateful and with no validation strategy so not really caches -- or really any kind of wrapper or shim.)

I think it is really useful to raise awareness of this kind of thing, but I think the article could put it a little better. For one thing, queues can "fix overload" depending on what you mean by that. They don't increase system capacity but can let a system handle bursty usage better.

Re: Queues don't fix overload (2014)

#20
(2014)

Fred is a big Erlang advocate from 10+ years ago.

He's written multiple books on Erlang, from his real-world experience, of using it to build Heroku (Erlang underpins much of the original Heroku platform and large pieces still today).

Much if his writing is influenced by said experience and Erlang native queues.

https://www.erlang-in-anger.com

https://learnyousomeerlang.com

Post reply on HN