Re:The most important thing to understand about queues (2016)
by cjg on Tuesday March 08, 2022 @08:31AM
(#30599638)
I just finished implementing a simple backpressure algorithm. Once the queue is more than a certain percentage full, it rejects new items. These rejections get turned into HTTP 503s.
[ Parent
| on HN ]
Re:The most important thing to understand about queues (2016)
by usrbin on Tuesday March 08, 2022 @08:57AM
(#30599894)
What is the purpose of cutting off the queue at a n% full? Isn't that effectively saying that the queue size is actually n% of the stated size, or am I missing detail?
Re:The most important thing to understand about queues (2016)
by bombcar on Tuesday March 08, 2022 @09:55AM
(#30600551)
Perhaps "rejects new items" is the key - a web server that hits a certain percentage utilization only allow existing clients/connections/logged in users/whatever to connect; refuse new connections.
Re:The most important thing to understand about queues (2016)
by cjg on Tuesday March 08, 2022 @04:11PM
(#30607033)
It's probabilistic.
Re:The most important thing to understand about queues (2016)
by morelisp on Tuesday March 08, 2022 @10:57AM
(#30601313)
Wait until you hear about hash table capacities.
Re:The most important thing to understand about queues (2016)
by SketchySeaBeast on Tuesday March 08, 2022 @09:09AM
(#30600027)
Haven't you just moved the pressure back a step? Now you have a bunch of items retrying to get their stuff on the queue and a bunch of places to try and locate the problem, instead of an overly large queue. Is the idea that the messages aren't important enough to be placed on the queue in the first place if demand is high?
Re:The most important thing to understand about queues (2016)
by cjg on Tuesday March 08, 2022 @04:19PM
(#30607151)
The idea is that it's not a sudden hard failure. Instead only a few things fail which helps in two ways: reducing the load by discarding some work and alerting that the system is beginning to be overloaded.
Re:The most important thing to understand about queues (2016)
by gpderetta on Wednesday March 09, 2022 @07:56AM
(#30613912)
this is similar to Random Early Detection [1].
Re:The most important thing to understand about queues (2016)
by cjg on Friday March 11, 2022 @04:56AM
(#30638136)
Yes.
Re:The most important thing to understand about queues (2016)
by bmm6o on Tuesday March 08, 2022 @07:24PM
(#30609378)
I think 429 is the preferred status code for this. Of course you can use whatever you want, but 503 can presumably come up in other scenarios and it's nice to have something unambiguous.