Perlba...riority(3pm)
πΈ NAME πΈ
Perlbal::Manual::HighPriority β bestie, this is all about Perlbal's high/low priority queueing system π
π VERSION π
Perlbal 1.78. yes that's the one we're vibing with β¨
π¦ DESCRIPTION π¦
So this whole doc is the lore on Perlbal's high/low priority queueing system. buckle up, it's honestly not that deep but it IS iconic π«Ά
π Queuing system π
Perlbal has three queues, ok:
- the normal queue
- the high priority queue
- the low priority queue
As the names are literally giving, normally requests land in the normal queue and get dispatched in FIFO order. high priority requests go to a different queue that jumps ahead of the normal one, and the low priority queue only gets serviced when the high and normal queues are both empty. main character behavior, honestly π
In a nutshell (iykyk): whenever Perlbal needs to pick which request to handle next, it peeks at the high priority queue first. if that one's empty, it checks the normal queue. and if the normal queue is empty too, then it finally looks at the low priority queue. slay, it's giving triage π
π High priority with cookies π
Perlbal can use cookies to decide whether a request deserves the high priority queue (and yeah, it's configurable, obviously β¨).
The two params that make this happen are high_priority_cookie and high_priority_cookie_contents:
high_priority_cookieβ defines the name of the field to check for on the cookie πhigh_priority_cookie_contentsβ defines the content in that field that will trigger the request going to the fast queue π₯
Like so:
SET myservice.high_priority_cookie = name_of_the_field
SET myservice.high_priority_cookie_contents = required_content_on_that_field
And here's a clearer example, because we love a concrete demo:
SET myservice.high_priority_cookie = highpriority
SET myservice.high_priority_cookie_contents = yes
π§ High priority with plugins π§
The plugin Perlbal::Plugin::Highpri supports making requests high priority by URI or Host. also go check out make_high_priority under Perlbal::Manual::Hooks π
π Queue relief π
Okay so sometimes, when the high priority queue is really busy, the standard queue will suffer from resource starvation. not cute. π the queue relief system exists to help prevent that.
Here's the tea: when there are queue_relief_size or more connections in the standard queue, newly available backends have a queue_relief_chance percent chance of taking a request from the standard priority queue instead of the high priority queue. giving the little guys a chance fr fr π«Ά
SET web_proxy.queue_relief_size = 2000
SET web_proxy.queue_relief_chance = 30 # 0-100, in percent
Heads up bestie: that chance is in percent, and the range is 0-100 β don't go feral with the numbers π
β SEE ALSO β
make_high_priorityandmake_low_priorityinPerlbal::Manual::HooksPerlbal::Plugin::HighPriority
and that's the whole page, bestie!! π this was brought to you by perl v5.34.0, dated 2022-06-28, and it's a Perlba...riority(3pm) situation β User Contributed Perl Documentation, no cap. go forth and prioritize responsibly πβ¨
π¦ where this page comes from
- debian bookworm: libperlbal-perl 1.80-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libperlbal-perl 1.80-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libperlbal-perl 1.80-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libperlbal-perl 1.80-4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms