Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

perlbal::manual::highpriority(3pm) [debian man page]

Perlbal::Manual::HighPriority(3pm)			User Contributed Perl Documentation			Perlbal::Manual::HighPriority(3pm)

NAME
Perlbal::Manual::HighPriority - Perlbal's high/low priority queueing system. VERSION Perlbal 1.78. DESCRIPTION This document describes Perlbal's high/low priority queueing system. Queuing system Perlbal has three queues: normal, high priority and low priority. As their names suggest, this means that usually requests get to the normal queue and are dispatched in FIFO 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. 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. High priority with cookies Perlbal can use cookies to determine if a request should go to the high priority queue (configurable). The parameters to configure this are "high_priority_cookie" and "high_priority_cookie_contents"; 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: SET myservice.high_priority_cookie = name_of_the_field SET myservice.high_priority_cookie_contents = required_content_on_that_field Here's a clearer example: 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 check "make_high_priority" under Perlbal::Manual::Hooks. Queue relief 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 "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. SET web_proxy.queue_relief_size = 2000 SET web_proxy.queue_relief_chance = 30 # 0-100, in percent SEE ALSO "make_high_priority" and "make_low_priority" in Perlbal::Manual::Hooks, Perlbal::Plugin::HighPriority. perl v5.14.2 2011-01-23 Perlbal::Manual::HighPriority(3pm)

Check Out this Related Man Page

Perlbal::Manual::Logging(3pm)				User Contributed Perl Documentation			     Perlbal::Manual::Logging(3pm)

NAME
Perlbal::Manual::Logging - How Perlbal's logging system works VERSION Perlbal 1.78. DESCRIPTION Perlbal supports logging of a few messages (and you can log your messages in your plugins, for instance). This document describes how to achieve that. IMPORTANT: foreground vs. background If Perlbal is running on the foreground, it logs by calling "printf", which means you should get the logs on "STDOUT". If Perlbal is running on the background, it logs through Sys::Syslog. If Sys::Syslog is not available, there will be no logging, and THAT'S THE MOST IMPORTANT THING TO KNOW ABOUT PERLBAL'S LOGGING SYSTEM. How to log a message You can log a message by calling "Perlbal::log" as you'd call Sys::Syslog's "syslog": Perlbal::log( $priority, $format, @args ); You should read the documentation for Sys::Syslog for more information, but here's an example: Perlbal::log( 'info', 'beginning run' ); And here's another example: Perlbal::log( 'crit', "this thing crashed: $!" ); What is logged? o When we try to read from or write to a filehandle that is undefined, Perlbal::AIO logs a critical message: Perlbal::log("crit", "Undef $fh: $stack_trace"); o When failing to create a socket, Perlbal::BackendHTTP logs a critical message: Perlbal::log('crit', "Error creating socket: $!"); o When "inet_aton" fails to create a socket, Perlbal::BackendHTTP logs a critical message: Perlbal::log('crit', "inet_aton failed creating socket for $ip"); o When writing to a client, if we try to read more than we should from the backend, Perlbal::ClientHTTPBase logs a warning message: Perlbal::log('warning', "tried to readahead negative bytes. filesize=$self->{reproxy_file_size}, offset=$self->{reproxy_file_offset}"); o When opening a file being PUT for writing to disk, if there's an error (which is going to originate a 500 server error), Perlbal::ClientHTTPBase logs a warning message: Perlbal::log('warning', "system error: $msg ($info)"); o If we receive a request with a content length different from the actual length of the request, Perlbal::ClientProxy logs a critical message: Perlbal::log('crit', "Content length of $clen declared but $self->{buoutpos} bytes written to disk"); o When trying to buffer data to disk, if the operation fails Perlbal::ClientProxy logs a critical message: Perlbal::log('crit', "Failure to open $fn for buffered upload output"); o After buffering data to disk, if the file is empty, Perlbal::ClientProxy logs a critical message: Perlbal::log('crit', "Error writing buffered upload: $!. Tried to do $len bytes at $self->{buoutpos}."); o When purging a buffered upload on the disk, if an error occurs, Perlbal::ClientProxy logs a critical message: Perlbal::log('warning', "Unable to link $self->{bufilename}: $!"); o When marking a backend as pending, if there's already another one in that ip/port, Perlbal::Service will log a couple of warning messages: Perlbal::log('warning', "Warning: attempting to spawn backend connection that already existed."); Perlbal::log('warning', " -- [$filename:$line] $package::$subroutine"); o When deciding whether we should spawn one or more backend connections, if the total of pending conections is negative, Perlbal::Service will log a critical message: Perlbal::log('crit', "Bogus: service $self->{name} has pending connect count of $self->{pending_connect_count}?! Resetting."); o When spawning a backend connection, if there is no IP address for the backend, Perlbal::Service will log a critical message: Perlbal::log('crit', "No backend IP for service $self->{name}"); o When starting, Perlbal will log an info message: Perlbal::log('info', 'beginning run'); o When shutting down, Perlbal will log an info message: Perlbal::log('info', 'ending run'); o After each loop, is some error occurred, Perlbal will log a critical message: Perlbal::log('crit', "crash log: $_") foreach split(/ ? /, $@); o When attempting to create the pidfile, if unsuccessful, Perlbal will log an info message: Perlbal::log('info', "couldn't create pidfile '$file': $!" ); o When attempting to write to the pidfile, if unsuccessful, Perlbal will log an info message: Perlbal::log('info', "couldn't write into pidfile '$file': $!" ); Generating more logs by sending a USR1 signal to perlbal If you send a USR1 signal to perlbal, that tells it to log some basic statistics to the syslog. It's similar to connecting to a management service and issue a "show service" for each service, plus a "states" and a "queues" commands. Where is it logged to? The way Perlbal opens Sys::Syslog, it logs to /var/log/daemon.log by default. SEE ALSO You can tweek Sys::Syslog's configuration under /etc/syslog.conf. See Sys::Syslog for more details. perl v5.14.2 2012-03-23 Perlbal::Manual::Logging(3pm)
Man Page