Scroll to navigation

PENCTL(1) General Commands Manual PENCTL(1)

NAME

penctl - control a running pen load balancer

SYNOPSIS

penctl host:port|/path/to/socket command

EXAMPLE

penctl lbhost:8888 roundrobin

Turns off client tracking on the load balancer running on lbhost.

penctl /var/run/pen/tmp/ctrl status

Prints status information in html format.

DESCRIPTION

Penctl connects to the optional control socket on a pen load balancer. It reads commands from the command line, performs minimal syntax checking and sends them to pen. Replies, if any, are printed on stdout.

The program can also be used through the cgi script penctl.cgi, which allows pen to be controlled from any web browser.

OPTIONS

Specifies a control port where the load balancer listens for commands.

COMMANDS

Call abort() when a fatal error is encountered. This will create a core file which allows further troubleshooting. Disabled by default.
Exit normally on fatal error with an error code which indicates failure.
Adds an entry to access list N, where N is a number from 0 to 9. The source and mask addresses are in the usual dotted quad notation. If mask is omitted, it defaults to 255.255.255.255.

If the source address contains the character ':', the address is interpreted as IPv6. Unlike IPv4 access entries, a length is used to indicate the mask. If length is omitted, it defaults to 128.

If the source address is the special word "country", a two-letter country code can be used to restrict access to the load balancer. For this to work, pen must be built with geoip support.
Deletes all entries from access list N. The resulting access list permits all traffic.
Communication dumps in ascii format (cf option -a).
Communication dumps in hex format.
Return current blacklist time in seconds.
Set the blacklist time in seconds.
Do not make sockets nonblocking. This is obsolete as of 0.26.0 and does nothing.
Make sockets nonblocking.
Check connecting clients against access list N (default 0).
With argument, increase the maximum number of known clients. Returns max number of clients.
Close connection N
Display some basic information about connection N.
With argument, increase the max number of simultaneous connections. Returns max number.
Return address and port where pen listens for control connections.
Check accesses to the control port against access list N (default 0).
Return current debug level.
Set debug level to N.
Always wait for the next round of the main loop before forwarding data. Normally pen tries to do that immediately. This is obsolete as of 0.26.0 and does nothing.
Try to forward data immediately, to avoid the overhead of copying it to a temporary buffer and waiting for the next main loop round.
Use IF as the interface for Direct Server Return.
Act as a dummy web server with very limited functionality but high performance. Only useful for testing. Disabled by default.
Do not act as a dummy web server.
Use epoll for event management (Linux). This is the default on Linux.
Exit. Only available if pen was started with the -X option.
Use a hash on the client IP address for initial server selection.
Do not use a hash.
Add X-Forwarded-For headers to http requests.
Do not add X-Forwarded-For headers.
Close connections that have been inactive for N seconds. Default 0 = never close.
Create N reliable idle connections to the backend servers. Without argument, display the current/requested number of reliable idlers.
Read commands from file.
Use kqueue for event management (FreeBSD, NetBSD, OpenBSD). This is the default on the systems that have it.
Return local address and port pen listens to for incoming client connections.
Close the listening socket and reopen using specified address (optional) and port.
Show where pen is logging, if anywhere.
Log to FILE.
Write a summary of the current mode of operation. The listed modes are block, delayed_forward, hash, roundrobin, stubborn.
Turn off logging.
Max allowed number of pending nonblocking connections. Default 100, minimum 1.
Return the process id of the running daemon.
Use poll for event management.
Use the priority based algorithm.
Do not use the priority based algorithm.
Shows which clients have connected in the last N seconds (default 300).
Use round-robin server selection without client tracking

Use select for event management.
Change acl, address, port, weight, priority and/or max connections for server N, or blacklist it for T seconds.
List address, port, weight, priority and max number of simultaneous connections for each remote server.
Show to which connection socket N belongs.
Set the local address to IP for upstream connections, i.e. where Pen connects to backend servers.
Choose list of available SSL ciphers, specified in the format described in https://www.openssl.org/docs/apps/ciphers.html.
Allowing the client to request renegotiation is a potential denial of service vector. This command specifies the minimum number of seconds the client has to wait between requests for renegotiation requests. Default 3600 = effectively disabled.
Specifies the location of a file containing a pre-fetched OCSP response. The file must be refreshed regularly by a cron job or similar and the ssl_ocsp_response command repeated to make Pen re-read the file..
Manipulate SSL options. The available options are no_sslv2, no_sslv3, no_tlsv1, no_tlsv1.1, no_tlsv1.2, cipher_server_preference. Use the command multiple times to specify multiple options.
This command enables the Server Name Indication TLS extension by specifying a directory where domain.key, domain.crt and domain.ca files can be found.
Print status information in html format.
If the initial server selection is unavailable, close the client connection without trying another
Used in DSR mode. If N is an existing access list, Pen will reply to ARP requests for IP addresses that match the access list, and reply with SYN+ACK to TCP SYN requests to these addresses. The result is that someone trying to scan a network will be slowed down by a large number of false positives.
Close both sockets to upstream and downstream if one of them closes theirs. Default = off.
Set TCP_NODELAY on sockets, effectively turning off the Nagle algorithm.
Do not set TCP_NODELAY on sockets. This is the default.
Return current connect timeout in seconds.
Set connect timeout to N seconds.
Set tracking time, i.e. how long clients will be remembered. The default 0 will never expire clients based on time.
On compatible platforms, use the client's address as source address in the connection to the backend server.
Use Pen's address as source address in the connection to the backend server.
Return file name of html status reports, if any.
Set the name of html status reports.
Do not generate html status reports.
Use weight for server selection.
Do not use weight for server selection.
Write the current configuration into a file which can be used to start pen. If FILE is omitted, the configuration is written into pen's original configuration file.

SEE ALSO

pen(1)

AUTHOR

Copyright (C) 2002-2015 Ulric Eriksson, <ulric@siag.nu>.

LOCAL