.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Perlbal::FAQ 3pm" .TH Perlbal::FAQ 3pm "2012-02-20" "perl v5.14.2" "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::FAQ \- Frequently Asked Questions about Perlbal .SS "\s-1VERSION\s0" .IX Subsection "VERSION" Perlbal 1.78. .SS "\s-1DESCRIPTION\s0" .IX Subsection "DESCRIPTION" This document aims at listing several Frequently Asked Questions regarding Perlbal. .SS "Configuring Perlbal" .IX Subsection "Configuring Perlbal" \fIIs there a sample \f(CI\*(C`perlbal.*\*(C'\fI I can use for my \f(CI\*(C`init.d\*(C'\fI?\fR .IX Subsection "Is there a sample perlbal.* I can use for my init.d?" .PP Yes, you can find one under \f(CW\*(C`debian/perlbal.init\*(C'\fR. It implements \f(CW\*(C`start\*(C'\fR, \f(CW\*(C`stop\*(C'\fR and \f(CW\*(C`restart/force\-reload\*(C'\fR. Make sure you adjust it to your particular taste and/or needs. .PP \fIIs there a way to make perlbal re-read the config file without shuting it down?\fR .IX Subsection "Is there a way to make perlbal re-read the config file without shuting it down?" .PP No, there is not. But typically, if you're making changes, you can just make them on the management console, which doesn't require any restart whatsoever. .PP Still, restarting is probably easy. The trick to it is to simulate a graceful restart. .PP \fIHow can I implement a graceful restart?\fR .IX Subsection "How can I implement a graceful restart?" .PP Here's a sample script that will allow you to perform a graceful restart: .PP .Vb 3 \& $ cat restart\-perlbal.sh \& echo "shutdown graceful" | nc localhost 60000 \& /usr/local/bin/perlbal \-\-conf=/etc/perlbal.conf .Ve .PP The idea is that you tell the old Perlbal to do a graceful shutdown; that immediately closes all of the listening sockets, so new connections are not accepted. As soon as that's done (which is instant) you can start up a new Perlbal. .PP This gives you a minimum of downtime that can be measured on the order of milliseconds (the time it takes for the new Perlbal to start up). .PP Remember that you need to have a \f(CW\*(C`management\*(C'\fR service listening on port 60000 for this example to work. See Perlbal::Manual::Management. .SS "Load Balancing" .IX Subsection "Load Balancing" \fIWhat balancing algorithm does Perlbal use?\fR .IX Subsection "What balancing algorithm does Perlbal use?" .PP Currently, Perlbal supports only one balancing method: \f(CW\*(C`random\*(C'\fR. .PP .Vb 1 \& SET pool balance_method = \*(Aqrandom\*(Aq .Ve .PP With this mode, Perlbal selects one of the nodes within the pool randomly for each request received. It prefers reusing existing idle backend connections if backend_persist is enabled, which is faster than waiting for a new connection to open each time. .SS "Plugins" .IX Subsection "Plugins" \fICan I influence the order plugins are used?\fR .IX Subsection "Can I influence the order plugins are used?" .PP Yes. When you set the plugins for your service they get to register their hooks in order. .PP .Vb 1 \& SET plugins = AccessControl HighPri .Ve .PP These hooks are pushed into an array, which means that they preserve the order of the plugins. .SS "\s-1HTTP\s0, \s-1SSL\s0" .IX Subsection "HTTP, SSL" \fIDoes perlbal support \s-1HTTP\s0 1.1?\fR .IX Subsection "Does perlbal support HTTP 1.1?" .PP Perlbal for the most part only speaks \s-1HTTP/1\s0.0 both to clients and to backend webservers. It happily takes requests advertising \s-1HTTP/1\s0.1 and downgrading them to \s-1HTTP/1\s0.0 when speaking to backend serves. .PP It knows all about persistent connections (in both 1.0 and 1.1) and will reply with \s-1HTTP/1\s0.0 Connection: keep-alive the request was only implicitly keep-alive with \s-1HTTP/1\s0.1. etc. .PP Perlbal is now also starting to speak more of 1.1. For instance, Perlbal does support receiving transfer-encoding \*(L"chunked\*(R" requests from clients (a feature of \s-1HTTP/1\s0.1), will send a \f(CW\*(C`100 Continue\*(C'\fR in response to \f(CW\*(C`Expect: 100\-continue\*(C'\fR, and will parse the chunked requests, writing the request-of-unknown-length to disk (only if \f(CW\*(C`buffered_uploads\*(C'\fR is enabled), and then will send an \s-1HTTP/1\s0.0 request to the backends, with the actual \f(CW\*(C`Content\-Length\*(C'\fR (now known) filled in. .PP When more of 1.1 is supported, it will become an option, and later become the default. However, after several years of usage, there just hasn't been that much of a reason. The chunked requests (common from mobile phones uploading large images) has been the most annoying shortcoming but now that it's solved, it's questionable whether or not more of \s-1HTTP/1\s0.1 will be supported. .PP \fIDoes perlbal support \s-1SSL\s0?\fR .IX Subsection "Does perlbal support SSL?" .PP Yes. To use \s-1SSL\s0 mode you'll need IO::Socket::SSL \f(CW\*(C`v0.98+\*(C'\fR installed. .PP You can do \s-1SSL\s0 either on \f(CW\*(C`web_server\*(C'\fR, \f(CW\*(C`reverse_proxy\*(C'\fR or \f(CW\*(C`selector\*(C'\fR modes, but not on a vhost-based \f(CW\*(C`selector\*(C'\fR service, because \s-1SSL\s0 and vhosts aren't compatible. .PP See the configuration file \fIssl.conf\fR under \fIconf/\fR for an example. .SS "\s-1SEE\s0 \s-1ALSO\s0" .IX Subsection "SEE ALSO" Perlbal::Manual.