.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Perlbal::Manual::HighPriority 3pm" .TH Perlbal::Manual::HighPriority 3pm "2022-06-28" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Perlbal::Manual::HighPriority \- Perlbal's high/low priority queueing system. .SS "\s-1VERSION\s0" .IX Subsection "VERSION" Perlbal 1.78. .SS "\s-1DESCRIPTION\s0" .IX Subsection "DESCRIPTION" This document describes Perlbal's high/low priority queueing system. .PP \fIQueuing system\fR .IX Subsection "Queuing system" .PP Perlbal has three queues: normal, high priority and low priority. .PP As their names suggest, this means that usually requests get to the normal queue and are dispatched in \s-1FIFO\s0 order, with high priority requests going to a different queue that gets ahead of the normal one and a low priority queue that only gets done when the high and normal queues are empty. .PP In a nutshell, whenever Perlbal needs to select which request to take care of next, it first looks for requests in the high priority queue; if that one is empty, it then looks into the normal queue; and, if the normal queue is empty too, it finally looks in the low priority queue. .PP \fIHigh priority with cookies\fR .IX Subsection "High priority with cookies" .PP Perlbal can use cookies to determine if a request should go to the high priority queue (configurable). .PP The parameters to configure this are \f(CW\*(C`high_priority_cookie\*(C'\fR and \f(CW\*(C`high_priority_cookie_contents\*(C'\fR; the first defines the name of the field to check for on the cookie and the second one defines the content in that field that will trigger the request going to the fast queue: .PP .Vb 2 \& SET myservice.high_priority_cookie = name_of_the_field \& SET myservice.high_priority_cookie_contents = required_content_on_that_field .Ve .PP Here's a clearer example: .PP .Vb 2 \& SET myservice.high_priority_cookie = highpriority \& SET myservice.high_priority_cookie_contents = yes .Ve .PP \fIHigh priority with plugins\fR .IX Subsection "High priority with plugins" .PP The plugin Perlbal::Plugin::Highpri supports making requests high priority by \s-1URI\s0 or Host. Also check \f(CW\*(C`make_high_priority\*(C'\fR under Perlbal::Manual::Hooks. .PP \fIQueue relief\fR .IX Subsection "Queue relief" .PP Sometimes if the high priority queue is really busy, the standard queue will suffer from resource starvation. The queue relief system helps prevent this. When there are \f(CW\*(C`queue_relief_size\*(C'\fR or more connections in the standard queue, newly available backends have a \f(CW\*(C`queue_relief_chance\*(C'\fR percent chance of taking a request from the standard priority queue instead of the high priority queue. .PP .Vb 2 \& SET web_proxy.queue_relief_size = 2000 \& SET web_proxy.queue_relief_chance = 30 # 0\-100, in percent .Ve .PP \fI\s-1SEE ALSO\s0\fR .IX Subsection "SEE ALSO" .PP \&\f(CW\*(C`make_high_priority\*(C'\fR and \f(CW\*(C`make_low_priority\*(C'\fR in Perlbal::Manual::Hooks, Perlbal::Plugin::HighPriority.