.\" 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::Manual::Debugging 3pm" .TH Perlbal::Manual::Debugging 3pm "2011-01-23" "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::Manual::Debugging \- Debugging Perlbal .SS "\s-1VERSION\s0" .IX Subsection "VERSION" Perlbal 1.78. .SS "\s-1DESCRIPTION\s0" .IX Subsection "DESCRIPTION" Perlbal has two ways of debugging. .PP One of them is through a management console; the other is through debugging messages. .SS "Debugging in a console" .IX Subsection "Debugging in a console" You'll need to set up a management service and use it to dump all the information you require. .PP The comprehensive documentation on this process can be found at Perlbal::Manual::Management. .SS "Debugging messages" .IX Subsection "Debugging messages" You can control the ammount of debugging messages Perlbal dumps by setting the environment variable \f(CW\*(C`PERLBAL_DEBUG\*(C'\fR to a value between 0 and 4: .PP .Vb 1 \& PERLBAL_DEBUG = 0 # no debug \& \& PERLBAL_DEBUG = 4 # debug everything .Ve .PP \fIDebug level 1\fR .IX Subsection "Debug level 1" .PP You can activate basic debug by setting \f(CW\*(C`PERLBAL_DEBUG\*(C'\fR to 1: .PP .Vb 1 \& PERLBAL_DEBUG = 1 .Ve .PP The following debugging messages are turned on: .IP "\(bu" 4 When a connection to a backend is closed, Perlbal::BackendHTTP prints \f(CW\*(C`Backend $self is done; closing...\*(C'\fR .IP "\(bu" 4 When a connection to a backend is killed, Perlbal::ClientProxy prints \f(CW\*(C`Client ($self) closing backend ($backend)\*(C'\fR .IP "\(bu" 4 When an \s-1HTTP\s0 request fails to be parsed, Perlbal::HTTPHeaders prints \f(CW\*(C`HTTP parse failure: $reason\*(C'\fR .IP "\(bu" 4 When the connection is promoted to \s-1SSL\s0, Perlbal::TCPListener prints \f(CW\*(C` .. socket upgraded to SSL!\*(C'\fR .PP \fIDebug level 2\fR .IX Subsection "Debug level 2" .PP By setting the debug level to 2 you'll get all the messages from level 1. .PP .Vb 1 \& PERLBAL_DEBUG = 2 .Ve .PP You will also get a few others: .IP "\(bu" 4 When a connection to a backend is opened and ready to be written to, Perlbal::BackendHTTP prints \f(CW\*(C`Backend $self is writeable!\*(C'\fR .IP "\(bu" 4 When a response is about to be handled, Perlbal::BackendHTTP prints \f(CW\*(C`BackendHTTP: handle_response\*(C'\fR .IP "\(bu" 4 When a backend is ready to be read from, Perlbal::BackendHTTP prints \f(CW\*(C`Backend $self is readable!\*(C'\fR .IP "\(bu" 4 When there's an error with the connection to the backend, Perlbal::BackendHTTP prints \f(CW\*(C`BACKEND event_err\*(C'\fR .IP "\(bu" 4 Whenever we're determining if we should be sending keep-alive header information back to the client, Perlbal::ClientHTTPBase prints \f(CW\*(C`ClientHTTPBase::setup_keepalive($self)\*(C'\fR .IP "\(bu" 4 Whenever the client is ready for more of its file, Perlbal::ClientHTTPBase prints \f(CW\*(C`REPROXY SSL done\*(C'\fR .IP "\(bu" 4 Right after we've read a chunk of a file and when a reproxy request is about to be sent, Perlbal::ClientHTTPBase prints \f(CW\*(C`REPROXY Sent: $sent\*(C'\fR .IP "\(bu" 4 When we've written all data in the queue (and are about to stop waiting for write notifications), Perlbal::ClientHTTPBase prints \f(CW\*(C`All writing done to $self\*(C'\fR .IP "\(bu" 4 Whenever a client proxy is about to be closed, Perlbal::ClientProxy prints \f(CW\*(C`Perlbal::ClientProxy closed\*(C'\fR, followed by a possible \f(CW\*(C`again\*(C'\fR and a possible \f(CW\*(C`saying $reason\*(C'\fR .IP "\(bu" 4 When a client has disconnected, Perlbal::ClientProxy prints \f(CW\*(C`ClientProxy::client_disconnected\*(C'\fR .IP "\(bu" 4 When a backend requests a client of a high priority request and the client is available, \*(L"Service\*(R" in Perlbal prints \f(CW\*(C`Got from fast queue, in front of $backlog others\*(C'\fR .IP "\(bu" 4 When a backend requests a client of a normal priority request and the client is available, \*(L"Service\*(R" in Perlbal prints \f(CW\*(C`Backend requesting client, got PRIORITY = $cp\-\*(C'\fR{fd}.> .IP "\(bu" 4 When a backend requests a client of a low priority request and the client is available, \*(L"Service\*(R" in Perlbal prints \f(CW\*(C`Backend requesting client, got low priority = $cp\-\*(C'\fR{fd}.> .IP "\(bu" 4 When header are being read, Perlbal::Socket prints \f(CW\*(C`Perlbal::Socket::read_headers($self) is_res=$is_res\*(C'\fR .PP \fIDebug level 3\fR .IX Subsection "Debug level 3" .PP .Vb 1 \& PERLBAL_DEBUG = 3 .Ve .PP By setting the debug level to 3 you'll get all the messages from level 1 and 2 plus the following: .IP "\(bu" 4 Right before response headers are written to the client, Perlbal::BackendHTTP prints \f(CW\*(C` writing response headers to client\*(C'\fR .IP "\(bu" 4 As we're writing to the client, Perlbal::BackendHTTP prints \f(CW\*(C` content_length=VALUE\*(C'\fR and \f(CW\*(C` remain=VALUE\*(C'\fR, where the values are \f(CW\*(C`undef\*(C'\fR if they are not defined .IP "\(bu" 4 If we're done writing to the client, Perlbal::BackendHTTP prints \f(CW\*(C` done. detaching.\*(C'\fR .IP "\(bu" 4 Whenever we're determining if we should be sending keep-alive header information back to the client, Perlbal::ClientHTTPBase prints \f(CW\*(C` service\*(Aqs persist_client = $persist_client\*(C'\fR .IP "\(bu" 4 While determining if we should be sending keep-alive header information back to the client, if we were sent \f(CW\*(C`content\-length\*(C'\fR or it's a head request, as we're doing a keep alive Perlbal::ClientHTTPBase prints \f(CW\*(C` doing keep\-alive to client\*(C'\fR .IP "\(bu" 4 If we're not sending keep-alive header information back ot the client, Perlbal::ClientHTTPBase prints \f(CW\*(C` doing connection: close\*(C'\fR .IP "\(bu" 4 Right after we've finished sending all of the results to the user, Perlbal::ClientProxy prints \f(CW\*(C`ClientProxy::backend_finished\*(C'\fR .IP "\(bu" 4 When we've sent a response to a user fully and we need to reset state, Perlbal::ClientProxy prints \f(CW\*(C`ClientProxy::http_response_sent \-\- resetting state\*(C'\fR .IP "\(bu" 4 When we're writing a response to a client, Perlbal::ClientProxy prints \f(CW\*(C`ClientProxy::event_write\*(C'\fR .IP "\(bu" 4 After writing a response to a client, if it is still connected and we're triggering trigger our backend to keep reading, Perlbal::ClientProxy prints \f(CW\*(C` unstalling backend\*(C'\fR .IP "\(bu" 4 When reading a request, Perlbal::ClientProxy prints \f(CW\*(C`ClientProxy::event_read\*(C'\fR .IP "\(bu" 4 When reading a request and just before we read the headers, Perlbal::ClientProxy prints \f(CW\*(C` no headers. reading.\*(C'\fR .IP "\(bu" 4 When reading a request, if we're not buffering to disk or we're no longer reading, as we disable reads, Perlbal::ClientProxy prints \f(CW\*(C` disabling reads.\*(C'\fR .IP "\(bu" 4 As we're reading, Perlbal::ClientProxy prints \f(CW\*(C` reading $read_size bytes (VALUE bytes remain)\*(C'\fR, where \f(CW\*(C`VALUE bytes remain\*(C'\fR can be .IP "\(bu" 4 After each read, Perlbal::ClientProxy prints \f(CW\*(C` read $len bytes\*(C'\fR .IP "\(bu" 4 After we finished reading the request, Perlbal::ClientProxy prints \f(CW\*(C` done_reading = $done_reading, backend = BACKEND\*(C'\fR, where \f(CW\*(C`BACKEND\*(C'\fR can be \f(CW\*(C`undef\*(C'\fR .IP "\(bu" 4 When we send the headers to the backend and it responds before we're done reading from the client, further reads from the client are discarded; in this situation Perlbal::ClientProxy prints \f(CW\*(C` already responded.\*(C'\fR. If the client continues to send data, Perlbal::ClientProxy prints \f(CW\*(C` already responded [2].\*(C'\fR and then gives up on reading .IP "\(bu" 4 After reading, and having a backend available where we can write to, just before we do, Perlbal::ClientProxy prints \f(CW\*(C` got a backend. sending write to it.\*(C'\fR .IP "\(bu" 4 After reading, if there's no backend available, Perlbal::ClientProxy prints \f(CW\*(C` no backend. read_ahead = $self\-\*(C'\fR{read_ahead}.> .IP "\(bu" 4 If we know we've already started spooling a file to disk and we're about to continue doing so, Perlbal::ClientProxy prints \f(CW\*(C` bureason = $self\-\*(C'\fR{bureason}> .IP "\(bu" 4 If a backend wasn't available and we're about to request one, Perlbal::ClientProxy prints \f(CW\*(C` finally requesting a backend\*(C'\fR .IP "\(bu" 4 When we're trying to read headers and the client has disconnected, Perlbal::Socket prints \f(CW\*(C` client disconnected\*(C'\fR .IP "\(bu" 4 If we need to remove a trailing \f(CW\*(C`\er\en\*(C'\fR from the headers, Perlbal::Socket prints \f(CW\*(C` throwing away leading \er\en\*(C'\fR .IP "\(bu" 4 If we've read a packet with headers and by the end of it we can't find the end of them, Perlbal::Socket prints \f(CW\*(C` can\*(Aqt find end of headers\*(C'\fR .IP "\(bu" 4 Once we've read some headers, Perlbal::Socket prints \f(CW\*(C` pre\-parsed headers: [$hstr]\*(C'\fR .IP "\(bu" 4 After reading headers, if there's additional content that we've read, we push it back; when we do so, Perlbal::Socket prints \f(CW\*(C` pushing back $len bytes after header\*(C'\fR .IP "\(bu" 4 If we got bogus headers, and right before we close the connection due to a parsing failure, Perlbal::Socket prints \f(CW\*(C` bogus headers\*(C'\fR .IP "\(bu" 4 If we got valid headers, Perlbal::Socket prints \f(CW\*(C` got valid headers\*(C'\fR .IP "\(bu" 4 If we're reading buffered data from a client, Perlbal::Socket prints \f(CW\*(C`draining readbuf from $self to $dest: [$$bref]\*(C'\fR .PP \fIDebug level 4\fR .IX Subsection "Debug level 4" .PP By setting the debug level to 4 you get all the messages from levels 1 to 3. .PP Plus, \f(CW\*(C`write\*(C'\fR is redefined so that whenever \f(CW\*(C`write\*(C'\fR is called it first prints \f(CW\*(C`write($self, <$clen>"$content") from ($pkg, $filename, $line)\*(C'\fR. .PP .Vb 1 \& PERLBAL_DEBUG = 4 .Ve .SS "\s-1SEE\s0 \s-1ALSO\s0" .IX Subsection "SEE ALSO" Perlbal::Manual::Configuration, Perlbal::Manual::Management.