NAME
Perlbal::Manual::Debugging - Debugging Perlbal
VERSION
Perlbal 1.78.
DESCRIPTION
Perlbal has two ways of debugging.
One of them is through a management console; the other is through debugging messages.
Debugging in a console
You'll need to set up a management service and use it to dump all the information you require.
The comprehensive documentation on this process can be found at Perlbal::Manual::Management.
Debugging messages
You can control the ammount of debugging messages Perlbal dumps by setting the environment variable PERLBAL_DEBUG to a value between 0 and 4:
PERLBAL_DEBUG = 0 # no debug
PERLBAL_DEBUG = 4 # debug everything
Debug level 1
You can activate basic debug by setting PERLBAL_DEBUG to 1:
PERLBAL_DEBUG = 1
The following debugging messages are turned on:
When a connection to a backend is closed, Perlbal::BackendHTTP prints
Backend $self is done; closing...When a connection to a backend is killed, Perlbal::ClientProxy prints
Client ($self) closing backend ($backend)When an HTTP request fails to be parsed, Perlbal::HTTPHeaders prints
HTTP parse failure: $reasonWhen the connection is promoted to SSL, Perlbal::TCPListener prints
.. socket upgraded to SSL!
Debug level 2
By setting the debug level to 2 you'll get all the messages from level 1.
PERLBAL_DEBUG = 2
You will also get a few others:
When a connection to a backend is opened and ready to be written to, Perlbal::BackendHTTP prints
Backend $self is writeable!When a response is about to be handled, Perlbal::BackendHTTP prints
BackendHTTP: handle_responseWhen a backend is ready to be read from, Perlbal::BackendHTTP prints
Backend $self is readable!When there's an error with the connection to the backend, Perlbal::BackendHTTP prints
BACKEND event_errWhenever we're determining if we should be sending keep-alive header information back to the client, Perlbal::ClientHTTPBase prints
ClientHTTPBase::setup_keepalive($self)Whenever the client is ready for more of its file, Perlbal::ClientHTTPBase prints
REPROXY SSL doneRight after we've read a chunk of a file and when a reproxy request is about to be sent, Perlbal::ClientHTTPBase prints
REPROXY Sent: $sentWhen we've written all data in the queue (and are about to stop waiting for write notifications), Perlbal::ClientHTTPBase prints
All writing done to $selfWhenever a client proxy is about to be closed, Perlbal::ClientProxy prints
Perlbal::ClientProxy closed, followed by a possibleagainand a possiblesaying $reasonWhen a client has disconnected, Perlbal::ClientProxy prints
ClientProxy::client_disconnectedWhen a backend requests a client of a high priority request and the client is available, "Service" in Perlbal prints
Got from fast queue, in front of $backlog othersWhen a backend requests a client of a normal priority request and the client is available, "Service" in Perlbal prints
Backend requesting client, got PRIORITY = $cp-{fd}.>When a backend requests a client of a low priority request and the client is available, "Service" in Perlbal prints
Backend requesting client, got low priority = $cp-{fd}.>When header are being read, Perlbal::Socket prints
Perlbal::Socket::read_headers($self) is_res=$is_res
Debug level 3
PERLBAL_DEBUG = 3
By setting the debug level to 3 you'll get all the messages from level 1 and 2 plus the following:
Right before response headers are written to the client, Perlbal::BackendHTTP prints
writing response headers to clientAs we're writing to the client, Perlbal::BackendHTTP prints
content_length=VALUEandremain=VALUE, where the values areundefif they are not definedIf we're done writing to the client, Perlbal::BackendHTTP prints
done. detaching.Whenever we're determining if we should be sending keep-alive header information back to the client, Perlbal::ClientHTTPBase prints
service's persist_client = $persist_clientWhile determining if we should be sending keep-alive header information back to the client, if we were sent
content-lengthor it's a head request, as we're doing a keep alive Perlbal::ClientHTTPBase printsdoing keep-alive to clientIf we're not sending keep-alive header information back ot the client, Perlbal::ClientHTTPBase prints
doing connection: closeRight after we've finished sending all of the results to the user, Perlbal::ClientProxy prints
ClientProxy::backend_finishedWhen we've sent a response to a user fully and we need to reset state, Perlbal::ClientProxy prints
ClientProxy::http_response_sent -- resetting stateWhen we're writing a response to a client, Perlbal::ClientProxy prints
ClientProxy::event_writeAfter writing a response to a client, if it is still connected and we're triggering trigger our backend to keep reading, Perlbal::ClientProxy prints
unstalling backendWhen reading a request, Perlbal::ClientProxy prints
ClientProxy::event_readWhen reading a request and just before we read the headers, Perlbal::ClientProxy prints
no headers. reading.When reading a request, if we're not buffering to disk or we're no longer reading, as we disable reads, Perlbal::ClientProxy prints
disabling reads.As we're reading, Perlbal::ClientProxy prints
reading $read_size bytes (VALUE bytes remain), whereVALUE bytes remaincan be <undef>After each read, Perlbal::ClientProxy prints
read $len bytesAfter we finished reading the request, Perlbal::ClientProxy prints
done_reading = $done_reading, backend = BACKEND, whereBACKENDcan beundefWhen 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
already responded.. If the client continues to send data, Perlbal::ClientProxy printsalready responded [2].and then gives up on readingAfter reading, and having a backend available where we can write to, just before we do, Perlbal::ClientProxy prints
got a backend. sending write to it.After reading, if there's no backend available, Perlbal::ClientProxy prints
no backend. read_ahead = $self-{read_ahead}.>If we know we've already started spooling a file to disk and we're about to continue doing so, Perlbal::ClientProxy prints
bureason = $self-{bureason}>If a backend wasn't available and we're about to request one, Perlbal::ClientProxy prints
finally requesting a backendWhen we're trying to read headers and the client has disconnected, Perlbal::Socket prints
client disconnectedIf we need to remove a trailing
\r\nfrom the headers, Perlbal::Socket printsthrowing away leading \r\nIf we've read a packet with headers and by the end of it we can't find the end of them, Perlbal::Socket prints
can't find end of headersOnce we've read some headers, Perlbal::Socket prints
pre-parsed headers: [$hstr]After reading headers, if there's additional content that we've read, we push it back; when we do so, Perlbal::Socket prints
pushing back $len bytes after headerIf we got bogus headers, and right before we close the connection due to a parsing failure, Perlbal::Socket prints
bogus headersIf we got valid headers, Perlbal::Socket prints
got valid headersIf we're reading buffered data from a client, Perlbal::Socket prints
draining readbuf from $self to $dest: [$$bref]
Debug level 4
By setting the debug level to 4 you get all the messages from levels 1 to 3.
Plus, write is redefined so that whenever write is called it first prints write($self, <$clen>"$content") from ($pkg, $filename, $line).
PERLBAL_DEBUG = 4
SEE ALSO
Perlbal::Manual::Configuration, Perlbal::Manual::Management.