crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs | LICENSE

commit 219e1f9fcec93927c76825db1d59e1adcdaa1804
parent 47934b5630003dd511e8292388698ff0d4b967c6
Author: finwo <finwo@pm.me>
Date:   Sat,  3 Jan 2026 19:33:17 +0100

1.51

Diffstat:
MChangeLog | 9+++++++++
Mdoc/crossroads.conf.7 | 18+++++++++++++++---
Mdoc/crossroads.html | 536++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
Mdoc/crossroads.pdf | 0
Adoc/main/conf/backendport.yo | 8++++++++
Mdoc/main/conf/server.yo | 5++---
Mdoc/main/config.yo | 1+
Mdoc/main/intro.yo | 14++++++++++++++
Mdoc/main/tips.yo | 3+++
Mdoc/main/tips/ipconntrackmax.yo | 7+++----
Mdoc/main/tips/rendering.yo | 3++-
Mdoc/main/tips/retries.yo | 2+-
Adoc/main/tips/virtual.yo | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Metc/Makefile.conf | 2+-
Metc/Makefile.def | 6+-----
Metc/svnrev.txt | 2+-
Msrc/crossroads-daemon/main.c | 2+-
Msrc/crossroads-mgr/crossroads-mgr.in | 2+-
Msrc/crossroads-mgr/crossroads-mgr.xslt | 45++++++++++++++++++++++++++++++++++++++-------
Msrc/crossroads.h | 6++++--
Msrc/crossroads/main.c | 2+-
Msrc/lib/allocreporter.c | 19++++++++++++-------
Msrc/lib/ansistamp.c | 2+-
Msrc/lib/backendavailable.c | 2+-
Msrc/lib/backendconnect.c | 2+-
Msrc/lib/backendcount.c | 2+-
Msrc/lib/choosebackend.c | 34+++++++++++++++++++++++++++++-----
Msrc/lib/configread.c | 2+-
Msrc/lib/configtest.c | 2+-
Msrc/lib/configwrite.c | 2+-
Msrc/lib/copysockets.c | 2+-
Msrc/lib/createcommandlinespace.c | 2+-
Msrc/lib/data.c | 12++++++------
Msrc/lib/deallocreporter.c | 2+-
Msrc/lib/decrclientcount.c | 2+-
Msrc/lib/dns.c | 2+-
Msrc/lib/error.c | 2+-
Msrc/lib/forktcpservicer.c | 2+-
Msrc/lib/hashpjw.c | 2+-
Msrc/lib/httpcopy.c | 2+-
Msrc/lib/httperror.c | 2+-
Msrc/lib/httpheaderaddheader.c | 2+-
Msrc/lib/httpheaderappendheader.c | 2+-
Msrc/lib/httpheaderconnectiontype.c | 2+-
Msrc/lib/httpheaderfree.c | 2+-
Msrc/lib/httpheaderhascookie.c | 2+-
Msrc/lib/httpheaderhttpver.c | 2+-
Msrc/lib/httpheadernew.c | 2+-
Msrc/lib/httpheaderread.c | 2+-
Msrc/lib/httpheaderremoveheader.c | 2+-
Msrc/lib/httpheadersetheader.c | 2+-
Msrc/lib/httpheaderval.c | 2+-
Msrc/lib/httpheaderwrite.c | 2+-
Msrc/lib/httpinsertheader.c | 2+-
Msrc/lib/httpserve.c | 2+-
Msrc/lib/httpserversocket.c | 2+-
Msrc/lib/httpwrite.c | 2+-
Msrc/lib/incrclientcount.c | 2+-
Msrc/lib/initsockaddr.c | 2+-
Msrc/lib/interrupt.c | 2+-
Msrc/lib/ipfaddallow.c | 2+-
Msrc/lib/ipfadddeny.c | 2+-
Msrc/lib/ipfallowed.c | 2+-
Msrc/lib/ipfdenied.c | 2+-
Msrc/lib/ipfloadfile.c | 2+-
Msrc/lib/ipfmatch.c | 2+-
Msrc/lib/ipfparse.c | 2+-
Msrc/lib/ishexdigit.c | 2+-
Msrc/lib/isspace.c | 2+-
Msrc/lib/lexer.c | 2+-
Msrc/lib/lockreporter.c | 2+-
Msrc/lib/logactivityany.c | 2+-
Msrc/lib/logactivitycontinuation.c | 2+-
Msrc/lib/logactivityend.c | 2+-
Msrc/lib/logactivitystart.c | 2+-
Msrc/lib/makesocket.c | 2+-
Msrc/lib/markactivity.c | 2+-
Msrc/lib/msg.c | 2+-
Msrc/lib/msgdumpbuf.c | 2+-
Msrc/lib/netbuffer.c | 2+-
Msrc/lib/netbufread.c | 2+-
Msrc/lib/netcopy.c | 2+-
Msrc/lib/netread.c | 2+-
Msrc/lib/netwrite.c | 2+-
Msrc/lib/parser.c | 2+-
Msrc/lib/parserclose.c | 2+-
Msrc/lib/parserfilename.c | 2+-
Msrc/lib/parserinput.c | 2+-
Msrc/lib/parseropen.c | 2+-
Msrc/lib/parserrun.c | 2+-
Msrc/lib/parserskipchar.c | 2+-
Msrc/lib/parserskipline.c | 2+-
Msrc/lib/restart.c | 2+-
Msrc/lib/runservice.c | 2+-
Msrc/lib/serve.c | 2+-
Msrc/lib/setproctitle.c | 2+-
Msrc/lib/showconfig.c | 7+++----
Msrc/lib/showservices.c | 2+-
Msrc/lib/showstatus.c | 19++++++++++++++++---
Msrc/lib/stagetostring.c | 2+-
Msrc/lib/statetostring.c | 4++--
Msrc/lib/stopdaemon.c | 2+-
Msrc/lib/strcasestr.c | 2+-
Msrc/lib/strexpandformat.c | 2+-
Msrc/lib/stringtostate.c | 2+-
Msrc/lib/strlcat.c | 2+-
Msrc/lib/strprintf.c | 2+-
Msrc/lib/strupr.c | 2+-
Msrc/lib/strvprintf.c | 2+-
Msrc/lib/symtabend.c | 2+-
Msrc/lib/symtablookup.c | 2+-
Msrc/lib/symtabset.c | 2+-
Msrc/lib/symtabstart.c | 2+-
Msrc/lib/sysrun.c | 2+-
Msrc/lib/tcpserve.c | 2+-
Msrc/lib/tellservice.c | 2+-
Msrc/lib/thruputlog.c | 2+-
Msrc/lib/trafficlog.c | 2+-
Msrc/lib/uidassume.c | 2+-
Msrc/lib/uidrestore.c | 2+-
Msrc/lib/unlockreporter.c | 2+-
Msrc/lib/usage.c | 2+-
Msrc/lib/vsyslog.c | 2+-
Msrc/lib/wakeuphandler.c | 2+-
Msrc/lib/warning.c | 2+-
Msrc/lib/writelog.c | 2+-
Msrc/lib/xcalloc.c | 2+-
Msrc/lib/xmalloc.c | 2+-
Msrc/lib/xrealloc.c | 2+-
Msrc/lib/xstrcat.c | 2+-
Msrc/lib/xstrcatch.c | 2+-
Msrc/lib/xstrdup.c | 2+-
Mtest/Makefile | 3++-
133 files changed, 683 insertions(+), 375 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,6 +1,15 @@ ChangeLog for Crossroads ------------------------------------------------------------------------------ +1.51 [KK 2007-07-10] + - Removed global MAX_BACKEND setting. The number of back ends per + service is now totally dynamic - derived from the + configuration. + - Added counts of available back ends, unavailable back ends and + so on to "crossroads -x status". The web interface + crossroads-mgr now picks this up. + - Documentation updated. Small fixes. + 1.50 [KK 2007-07-08] - Back end states can be initially set using the "state" directive. Command "crossroads tell" now requires keyword diff --git a/doc/crossroads.conf.7 b/doc/crossroads.conf.7 @@ -584,9 +584,8 @@ Each back end must be identified by the network name (server name) where it is located\&. For example: \f(CWserver 10\&.1\&.1\&.23\fP, or \f(CWserver web\&.mydomain\&.org\fP\&. A TCP port specifier can follow the server name, as in \f(CWserver -web\&.mydomain\&.org:80\fP\&. \fBNote that\fP resolved host names are -cached by Crossroads; there is no performance advantage in -specifying decimal addresses\&. (The DNS cache timeout can be +web\&.mydomain\&.org:80\fP\&. \fBNote that\fP resolved host names can be +cached by Crossroads\&. (The DNS cache timeout can be controlled using the invocation flag \f(CW-d\fP\&.) .IP "Syntax:" .IP o @@ -599,6 +598,19 @@ statement must be used to define the TCP port; There is no default\&. This is a required setting\&. .PP +\fBport - Specifying a back end port\fP +.IP "Description:" +Back ends must be known by their host name and a port\&. Both can +be simultaneously specified in a \f(CWserver\fP statement\&. When the +\f(CWserver\fP statement specifies a host name only, then a \f(CWport\fP +statement must be used to specify the port\&. +.IP "Syntax:" +\f(CWport\fP \fInumber\fP +.IP "Default:" +There is no default for the port\&. It must be specified either +using \f(CWserver\fP or using \f(CWport\fP\&. + +.PP \fBverbosity - Controlling verbosity at the back end level\fP .IP "Description:" Similar to \f(CWservice\fP specifications, a diff --git a/doc/crossroads.html b/doc/crossroads.html @@ -1,12 +1,12 @@ <a name="../crossroads-defs"></a><a name="defs"></a><html><head> -<title>Crossroads 1.50</title> +<title>Crossroads 1.51</title> <link rel="stylesheet" type="text/css" href="http://www.e-tunity.com/css/yodl.css"> <link rel="stylesheet" type="text/css" href="http://www.e-tunity.com/css/yodl.css"> <link rev="made" href="mailto:info@e-tunity.com"> </head> <body> <hr> -<h1>Crossroads 1.50</h1> +<h1>Crossroads 1.51</h1> <h2>Karel Kubat <br> Maintained by Karel Kubat (karel@kubat.nl)</h2> @@ -36,140 +36,143 @@ <dt><a href="#l5">1.4: Terminology</a></dt> <dt><a href="#l6">1.5: Porting Issues</a></dt> <dl> -<dt><a href="#l7">1.5.1: Porting issues for pre-1.43 installations</a></dt> -<dt><a href="#l8">1.5.2: Porting issues for pre-1.21 installations</a></dt> -<dt><a href="#l9">1.5.3: Porting issues for pre-0.26 installations</a></dt> -<dt><a href="#l10">1.5.4: Porting issues for pre-1.08 installations</a></dt> +<dt><a href="#l7">1.5.1: Porting issues fdor pre-1.50 installations</a></dt> +<dt><a href="#l8">1.5.2: Porting issues for pre-1.43 installations</a></dt> +<dt><a href="#l9">1.5.3: Porting issues for pre-1.21 installations</a></dt> +<dt><a href="#l10">1.5.4: Porting issues for pre-0.26 installations</a></dt> +<dt><a href="#l11">1.5.5: Porting issues for pre-1.08 installations</a></dt> </dl> </dl> -<dt><h3><a href="#l11">2: Installation for the impatient</a></h3></dt> -<dt><h3><a href="#l12">3: Using Crossroads</a></h3></dt> +<dt><h3><a href="#l12">2: Installation for the impatient</a></h3></dt> +<dt><h3><a href="#l13">3: Using Crossroads</a></h3></dt> <dl> -<dt><a href="#l13">3.1: The Balancer: crossroads</a></dt> +<dt><a href="#l14">3.1: The Balancer: crossroads</a></dt> <dl> -<dt><a href="#l14">3.1.1: General Commandline Syntax</a></dt> -<dt><a href="#l15">3.1.2: Status Reporting from the Command Line</a></dt> -<dt><a href="#l16">3.1.3: Logging-related options</a></dt> -<dt><a href="#l17">3.1.4: Reloading Configurations</a></dt> +<dt><a href="#l15">3.1.1: General Commandline Syntax</a></dt> +<dt><a href="#l16">3.1.2: Status Reporting from the Command Line</a></dt> +<dt><a href="#l17">3.1.3: Logging-related options</a></dt> +<dt><a href="#l18">3.1.4: Reloading Configurations</a></dt> </dl> -<dt><a href="#l18">3.2: The Web Frontend: crossroads-mgr</a></dt> +<dt><a href="#l19">3.2: The Web Frontend: crossroads-mgr</a></dt> </dl> -<dt><h3><a href="#l19">4: The configuration</a></h3></dt> +<dt><h3><a href="#l20">4: The configuration</a></h3></dt> <dl> -<dt><a href="#l20">4.1: General language elements</a></dt> +<dt><a href="#l21">4.1: General language elements</a></dt> <dl> -<dt><a href="#l21">4.1.1: Empty lines and comments</a></dt> -<dt><a href="#l22">4.1.2: Preprocessor directives</a></dt> -<dt><a href="#l23">4.1.3: Keywords, numbers, identifiers, generic strings</a></dt> +<dt><a href="#l22">4.1.1: Empty lines and comments</a></dt> +<dt><a href="#l23">4.1.2: Preprocessor directives</a></dt> +<dt><a href="#l24">4.1.3: Keywords, numbers, identifiers, generic strings</a></dt> </dl> -<dt><a href="#l24">4.2: Service definitions</a></dt> +<dt><a href="#l25">4.2: Service definitions</a></dt> <dl> -<dt><a href="#l25">4.2.1: port - Specifying the listen port</a></dt> -<dt><a href="#l26">4.2.2: type - Defining the service type</a></dt> -<dt><a href="#l27">4.2.3: headerinspection - are all HTTP headers inspected</a></dt> -<dt><a href="#l28">4.2.4: bindto - Binding to a specific IP address</a></dt> -<dt><a href="#l29">4.2.5: verbosity - Controlling debug output</a></dt> -<dt><a href="#l30">4.2.6: dispatchmode - How are back ends selected</a></dt> -<dt><a href="#l31">4.2.7: revivinginterval - Back end wakeup calls</a></dt> -<dt><a href="#l32">4.2.8: checkinterval - Periodic back end checks</a></dt> -<dt><a href="#l33">4.2.9: maxconnections - Limiting concurrent clients at service level</a></dt> -<dt><a href="#l34">4.2.10: backlog - The TCP Back Log size</a></dt> -<dt><a href="#l35">4.2.11: shmkey - Shared Memory Access</a></dt> -<dt><a href="#l36">4.2.12: allow* and deny* - Allowing or denying connections</a></dt> -<dt><a href="#l37">4.2.13: useraccount - Limiting the effective ID of external processes</a></dt> +<dt><a href="#l26">4.2.1: port - Specifying the listen port</a></dt> +<dt><a href="#l27">4.2.2: type - Defining the service type</a></dt> +<dt><a href="#l28">4.2.3: headerinspection - are all HTTP headers inspected</a></dt> +<dt><a href="#l29">4.2.4: bindto - Binding to a specific IP address</a></dt> +<dt><a href="#l30">4.2.5: verbosity - Controlling debug output</a></dt> +<dt><a href="#l31">4.2.6: dispatchmode - How are back ends selected</a></dt> +<dt><a href="#l32">4.2.7: revivinginterval - Back end wakeup calls</a></dt> +<dt><a href="#l33">4.2.8: checkinterval - Periodic back end checks</a></dt> +<dt><a href="#l34">4.2.9: maxconnections - Limiting concurrent clients at service level</a></dt> +<dt><a href="#l35">4.2.10: backlog - The TCP Back Log size</a></dt> +<dt><a href="#l36">4.2.11: shmkey - Shared Memory Access</a></dt> +<dt><a href="#l37">4.2.12: allow* and deny* - Allowing or denying connections</a></dt> +<dt><a href="#l38">4.2.13: useraccount - Limiting the effective ID of external processes</a></dt> </dl> -<dt><a href="#l38">4.3: Backend definitions</a></dt> +<dt><a href="#l39">4.3: Backend definitions</a></dt> <dl> -<dt><a href="#l39">4.3.1: server - Specifying the back end address</a></dt> -<dt><a href="#l40">4.3.2: verbosity - Controlling verbosity at the back end level</a></dt> -<dt><a href="#l41">4.3.3: retries - Specifying allowed failures</a></dt> -<dt><a href="#l42">4.3.4: weight - When a back end is more equal than others</a></dt> -<dt><a href="#l43">4.3.5: decay - Levelling out activity of a back end</a></dt> -<dt><a href="#l44">4.3.6: state - Setting an initial back end state</a></dt> -<dt><a href="#l45">4.3.7: onstart, onend, onfail - Action Hooks</a></dt> -<dt><a href="#l46">4.3.8: trafficlog and throughputlog - Debugging and Performance Aids</a></dt> -<dt><a href="#l47">4.3.9: stickycookie - Back end selection with an HTTP cookie</a></dt> -<dt><a href="#l48">4.3.10: HTTP Header Modification Directives</a></dt> +<dt><a href="#l40">4.3.1: server - Specifying the back end address</a></dt> +<dt><a href="#l41">4.3.2: port - Specifying a back end port</a></dt> +<dt><a href="#l42">4.3.3: verbosity - Controlling verbosity at the back end level</a></dt> +<dt><a href="#l43">4.3.4: retries - Specifying allowed failures</a></dt> +<dt><a href="#l44">4.3.5: weight - When a back end is more equal than others</a></dt> +<dt><a href="#l45">4.3.6: decay - Levelling out activity of a back end</a></dt> +<dt><a href="#l46">4.3.7: state - Setting an initial back end state</a></dt> +<dt><a href="#l47">4.3.8: onstart, onend, onfail - Action Hooks</a></dt> +<dt><a href="#l48">4.3.9: trafficlog and throughputlog - Debugging and Performance Aids</a></dt> +<dt><a href="#l49">4.3.10: stickycookie - Back end selection with an HTTP cookie</a></dt> +<dt><a href="#l50">4.3.11: HTTP Header Modification Directives</a></dt> </dl> </dl> -<dt><h3><a href="#l49">5: Tips, Tricks and Random Remarks</a></h3></dt> +<dt><h3><a href="#l51">5: Tips, Tricks and Random Remarks</a></h3></dt> <dl> -<dt><a href="#l50">5.1: Configuration examples</a></dt> +<dt><a href="#l52">5.1: Configuration examples</a></dt> <dl> -<dt><a href="#l51">5.1.1: A load balancer for three webserver back ends</a></dt> -<dt><a href="#l52">5.1.2: An HTTP forwarder when travelling</a></dt> -<dt><a href="#l53">5.1.3: SSH login with enforced idle logout</a></dt> +<dt><a href="#l53">5.1.1: A load balancer for three webserver back ends</a></dt> +<dt><a href="#l54">5.1.2: An HTTP forwarder when travelling</a></dt> +<dt><a href="#l55">5.1.3: SSH login with enforced idle logout</a></dt> </dl> -<dt><a href="#l54">5.2: How back ends are selected in load balancing</a></dt> +<dt><a href="#l56">5.2: How back ends are selected in load balancing</a></dt> <dl> -<dt><a href="#l55">5.2.1: Bysize, byduration or byconnections?</a></dt> -<dt><a href="#l56">5.2.2: Averaging size and duration</a></dt> -<dt><a href="#l57">5.2.3: Specifying decays</a></dt> -<dt><a href="#l58">5.2.4: Adjusting the weights</a></dt> +<dt><a href="#l57">5.2.1: Bysize, byduration or byconnections?</a></dt> +<dt><a href="#l58">5.2.2: Averaging size and duration</a></dt> +<dt><a href="#l59">5.2.3: Specifying decays</a></dt> +<dt><a href="#l60">5.2.4: Adjusting the weights</a></dt> </dl> -<dt><a href="#l59">5.3: Periodic probes and wake up calls</a></dt> +<dt><a href="#l61">5.3: Periodic probes and wake up calls</a></dt> <dl> -<dt><a href="#l60">5.3.1: Syntax</a></dt> -<dt><a href="#l61">5.3.2: Security Considerations</a></dt> -<dt><a href="#l62">5.3.3: An example</a></dt> +<dt><a href="#l62">5.3.1: Syntax</a></dt> +<dt><a href="#l63">5.3.2: Security Considerations</a></dt> +<dt><a href="#l64">5.3.3: An example</a></dt> </dl> -<dt><a href="#l63">5.4: Throttling the number of concurrent connections</a></dt> -<dt><a href="#l64">5.5: TCP Session Stickiness</a></dt> -<dt><a href="#l65">5.6: HTTP Session Stickiness</a></dt> +<dt><a href="#l65">5.4: Throttling the number of concurrent connections</a></dt> +<dt><a href="#l66">5.5: TCP Session Stickiness</a></dt> +<dt><a href="#l67">5.6: HTTP Session Stickiness</a></dt> <dl> -<dt><a href="#l66">5.6.1: Don't use stickiness!</a></dt> -<dt><a href="#l67">5.6.2: But if you must..</a></dt> +<dt><a href="#l68">5.6.1: Don't use stickiness!</a></dt> +<dt><a href="#l69">5.6.2: But if you must..</a></dt> </dl> -<dt><a href="#l68">5.7: Passing the client's IP address</a></dt> +<dt><a href="#l70">5.7: Passing the client's IP address</a></dt> <dl> -<dt><a href="#l69">5.7.1: Sample Crossroads configuration</a></dt> -<dt><a href="#l70">5.7.2: Sample Apache configuration</a></dt> +<dt><a href="#l71">5.7.1: Sample Crossroads configuration</a></dt> +<dt><a href="#l72">5.7.2: Sample Apache configuration</a></dt> </dl> -<dt><a href="#l71">5.8: Deep or shallow HTTP header inspection</a></dt> -<dt><a href="#l72">5.9: Debugging network traffic</a></dt> -<dt><a href="#l73">5.10: IP filtering: Limiting Access by Client IP Address</a></dt> +<dt><a href="#l73">5.8: Deep or shallow HTTP header inspection</a></dt> +<dt><a href="#l74">5.9: Debugging network traffic</a></dt> +<dt><a href="#l75">5.10: IP filtering: Limiting Access by Client IP Address</a></dt> <dl> -<dt><a href="#l74">5.10.1: General Examples</a></dt> -<dt><a href="#l75">5.10.2: Using External Files</a></dt> -<dt><a href="#l76">5.10.3: Mixing Directives</a></dt> +<dt><a href="#l76">5.10.1: General Examples</a></dt> +<dt><a href="#l77">5.10.2: Using External Files</a></dt> +<dt><a href="#l78">5.10.3: Mixing Directives</a></dt> </dl> -<dt><a href="#l77">5.11: Using an external program to dispatch</a></dt> +<dt><a href="#l79">5.11: Using an external program to dispatch</a></dt> <dl> -<dt><a href="#l78">5.11.1: Configuring the external handler</a></dt> -<dt><a href="#l79">5.11.2: Writing the external handler</a></dt> -<dt><a href="#l80">5.11.3: Examples of external handlers</a></dt> +<dt><a href="#l80">5.11.1: Configuring the external handler</a></dt> +<dt><a href="#l81">5.11.2: Writing the external handler</a></dt> +<dt><a href="#l82">5.11.3: Examples of external handlers</a></dt> </dl> -<dt><a href="#l81">5.12: Linux and ip_conntrack_max</a></dt> -<dt><a href="#l82">5.13: Marking back ends as bad after more than one try</a></dt> -<dt><a href="#l83">5.14: Using the Web Interface crossroads-mgr</a></dt> +<dt><a href="#l83">5.12: Linux and ip_conntrack_max</a></dt> +<dt><a href="#l84">5.13: Marking back ends as bad after more than one try</a></dt> +<dt><a href="#l85">5.14: Using the Web Interface crossroads-mgr</a></dt> <dl> -<dt><a href="#l84">5.14.1: Starting crossroads-mgr</a></dt> +<dt><a href="#l86">5.14.1: Starting crossroads-mgr</a></dt> </dl> -<dt><a href="#l85">5.15: Rendering Crossroads' status in a web page</a></dt> -<dt><a href="#l86">5.16: Crossroads and DNS caching</a></dt> +<dt><a href="#l87">5.15: Rendering Crossroads' status in a web page</a></dt> +<dt><a href="#l88">5.16: Crossroads and DNS caching</a></dt> +<dt><a href="#l89">5.17: Managing a Pool of Virtual Back Ends</a></dt> </dl> -<dt><h3><a href="#l87">6: Benchmarking</a></h3></dt> +<dt><h3><a href="#l90">6: Benchmarking</a></h3></dt> <dl> -<dt><a href="#l88">6.1: Benchmark 1: Accessing a proxy via crossroads or directly</a></dt> +<dt><a href="#l91">6.1: Benchmark 1: Accessing a proxy via crossroads or directly</a></dt> <dl> -<dt><a href="#l89">6.1.1: Results</a></dt> -<dt><a href="#l90">6.1.2: Discussion</a></dt> +<dt><a href="#l92">6.1.1: Results</a></dt> +<dt><a href="#l93">6.1.2: Discussion</a></dt> </dl> -<dt><a href="#l91">6.2: Benchmark 2: Crossroads versus Linux Virtual Server (LVS)</a></dt> +<dt><a href="#l94">6.2: Benchmark 2: Crossroads versus Linux Virtual Server (LVS)</a></dt> <dl> -<dt><a href="#l92">6.2.1: Environment</a></dt> -<dt><a href="#l93">6.2.2: Tests and results</a></dt> +<dt><a href="#l95">6.2.1: Environment</a></dt> +<dt><a href="#l96">6.2.2: Tests and results</a></dt> </dl> </dl> -<dt><h3><a href="#l94">7: Compiling and Installing</a></h3></dt> +<dt><h3><a href="#l97">7: Compiling and Installing</a></h3></dt> <dl> -<dt><a href="#l95">7.1: Prerequisites</a></dt> -<dt><a href="#l96">7.2: Compiling and installing</a></dt> -<dt><a href="#l97">7.3: Configuring crossroads</a></dt> -<dt><a href="#l98">7.4: A boot script</a></dt> +<dt><a href="#l98">7.1: Prerequisites</a></dt> +<dt><a href="#l99">7.2: Compiling and installing</a></dt> +<dt><a href="#l100">7.3: Configuring crossroads</a></dt> +<dt><a href="#l101">7.4: A boot script</a></dt> <dl> -<dt><a href="#l99">7.4.1: SysV Style Startup</a></dt> -<dt><a href="#l100">7.4.2: BSD Style Startup</a></dt> +<dt><a href="#l102">7.4.1: SysV Style Startup</a></dt> +<dt><a href="#l103">7.4.2: BSD Style Startup</a></dt> </dl> <p><hr><p> @@ -362,7 +365,22 @@ configuration file of Crossroads, existing configuration files may need to be made suitable for new versions. <p> <a name="l7"></a> -<strong>1.5.1: Porting issues for pre-1.43 installations</strong> +<strong>1.5.1: Porting issues fdor pre-1.50 installations</strong> +<p> +As of version 1.50, the command <code>crossroads tell</code> has been + changed. To set a state, the command must be used as follows: +<p> +<center><code>crossroads</code> <code>tell</code> <em>service</em> <em>backend</em> <code>state</code> + <em>newstate</em></center> +<p> +The keyword <code>state</code> was added. This is because <code>crossroads + tell</code> can also set a new server address; in that case the keyword + <code>server</code> is required. If you have automatic health checkers or + the like that change the back end states, please modify the + commands to suit this. +<p> +<a name="l8"></a> +<strong>1.5.2: Porting issues for pre-1.43 installations</strong> <p> As of version 1.43, the shared memory key calculations are based on a different algorithm. This key is e.g. necessary when starting @@ -383,8 +401,8 @@ Furthermore, shell-style comment is no longer supported as of your configuration files use shell-style comment, please convert this to <strong>C</strong> or <strong>C++</strong> style. <p> -<a name="l8"></a> -<strong>1.5.2: Porting issues for pre-1.21 installations</strong> +<a name="l9"></a> +<strong>1.5.3: Porting issues for pre-1.21 installations</strong> <p> As of version 1.21, the event-hook directives <code>onsuccess</code> and <code>onfailure</code> no longer exists. @@ -398,8 +416,8 @@ The commands that are run via <code>onstart</code>, <code>onend</code> or <code> are subject to format expansion; e.g., <code>%1w</code> is expanded to the weight of the first back end, etc.. See section <a href="crossroads.html#config">4</a> for details. <p> -<a name="l9"></a> -<strong>1.5.3: Porting issues for pre-0.26 installations</strong> +<a name="l10"></a> +<strong>1.5.4: Porting issues for pre-0.26 installations</strong> <p> As of version 0.26 the syntax of the configuration file has changed. In particular: @@ -417,8 +435,8 @@ Therefore when converting configuration files to the new syntax, <em>session</em> is used strictly in that sense -- and no longer for a TCP connection.) <p> -<a name="l10"></a> -<strong>1.5.4: Porting issues for pre-1.08 installations</strong> +<a name="l11"></a> +<strong>1.5.5: Porting issues for pre-1.08 installations</strong> <p> As of version 1.08, the following directives no longer are supported: @@ -438,7 +456,7 @@ As of version 1.08, the following directives no longer are This incidentally also makes it possible to change the header name (here: <code>XR-Real-IP</code>).</ul> <p> -<a name="l11"></a> +<a name="l12"></a> <h2>2: Installation for the impatient</h2> <a name="impatient"></a> For the impatient, here's the very-quick-but-very-superficial recipy @@ -514,9 +532,9 @@ That's off course assuming that you want to balance HTTP on running, port 1000. </ul> <p> -<a name="l12"></a> +<a name="l13"></a> <h2>3: Using Crossroads</h2> -<a name="using"></a><a name="l13"></a> +<a name="using"></a><a name="l14"></a> <h3>3.1: The Balancer: crossroads</h3> <p> The Crossroads balancer is started from the commandline, and highly depends on @@ -531,7 +549,7 @@ second program called <code>crossroads-daemon</code>. This program is not meant to be started from the command line; it is administered through the front end <code>crossroads</code>. <p> -<a name="l14"></a> +<a name="l15"></a> <strong>3.1.1: General Commandline Syntax</strong> <p> This section shows the most basic usage. As said above, start @@ -567,7 +585,7 @@ This section shows the most basic usage. As said above, start report on back end states. </ul> <p> -<a name="l15"></a> +<a name="l16"></a> <strong>3.1.2: Status Reporting from the Command Line</strong> <p> The command <code>crossroads status</code> shows a verbose human-readable @@ -608,7 +626,7 @@ technical reason for this: the total counter gets updated at a different rate than separate back end counts. This may be fixed in a future release.) <p> -<a name="l16"></a> +<a name="l17"></a> <strong>3.1.3: Logging-related options</strong> <p> Two 'flags' of Crossroads are specifically logging-related. This @@ -651,7 +669,7 @@ That instructs <code>syslogd</code> to send <code>LOG_LOCAL7</code> requests to <li> Finally, monitor <code>/var/log/crossroads.log</code> for Crossroads' messages.</ul> <p> -<a name="l17"></a> +<a name="l18"></a> <strong>3.1.4: Reloading Configurations</strong> <p> Crossroads doesn't support the reloading of a configuration while @@ -662,7 +680,7 @@ However, external lists of allowed or denied IP addresses can be reloaded by sending a signal -1 (<code>SIGHUP</code>) to Crossroads. See section <a href="crossroads.html#servicedef">4.2</a> for the details. <p> -<a name="l18"></a> +<a name="l19"></a> <h3>3.2: The Web Frontend: crossroads-mgr</h3> <p> A web front end for Crossroads is <code>crossroads-mgr</code>. Type @@ -681,7 +699,7 @@ There are lots of other options that can be used with <p> -<a name="l19"></a> +<a name="l20"></a> <h2>4: The configuration</h2> <a name="config"></a>The configuration that crossroads uses is normally stored in the file /etc/crossroads.conf. This location can be overruled using the @@ -690,13 +708,13 @@ command line flag <code>-c</code>. This section explains the syntax of the configuration file, and what all settings do. <p> -<a name="l20"></a> +<a name="l21"></a> <h3>4.1: General language elements</h3> <p> This section describes the general elements of the crossroads configuration language. <p> -<a name="l21"></a> +<a name="l22"></a> <strong>4.1.1: Empty lines and comments</strong> <p> Empty lines are of course allowed in the @@ -712,7 +730,7 @@ best'.&nbsp;(I favor C or C++ comment. My favorite editor <em>emacs</em> can be put in <code>cmode</code> and nicely highlight what's comment and what's not. And as a bonus it will auto-indent the configuration!) <p> -<a name="l22"></a> +<a name="l23"></a> <strong>4.1.2: Preprocessor directives</strong> <p> Similar to <strong>C</strong> or <strong>C++</strong>, the Crossroads grammar knows <code>#include</code> @@ -763,7 +781,7 @@ service web { </pre> <p> -<a name="l23"></a> +<a name="l24"></a> <strong>4.1.3: Keywords, numbers, identifiers, generic strings</strong> <p> In a configuration file, statements are identified by <em>keywords</em>, @@ -798,7 +816,7 @@ Finally, an argument can be a 'boolean' value. Crossroads knows <code>true</code>, <code>yes</code> and <code>on</code> all mean the same and can be used interchangeably; as can the keywords <code>false</code>, <code>no</code> and <code>off</code>. <p> -<a name="l24"></a> +<a name="l25"></a> <h3>4.2: Service definitions</h3> <a name="servicedef"></a> <p> Service definitions are blocks in the configuration file that @@ -822,7 +840,7 @@ identifying names differ. The following list shows possible statements. Each statement must end with a semicolon, except for the <code>backend</code> statement, which has is own block (more on this later). <p> -<a name="conf/port"></a><a name="l25"></a> +<a name="conf/port"></a><a name="l26"></a> <strong>4.2.1: port - Specifying the listen port</strong> <a name="confport - Specifying the listen port"></a> <dl> <p><dt><strong>Description:</strong><dd> The <code>port</code> statement defines to which TCP port a service @@ -832,7 +850,7 @@ statements. Each statement must end with a semicolon, except for the <p><dt><strong>Default:</strong><dd> There is no default. This is a required setting. </dl> <p> -<a name="conf/type"></a><a name="l26"></a> +<a name="conf/type"></a><a name="l27"></a> <strong>4.2.2: type - Defining the service type</strong> <a name="conftype - Defining the service type"></a> <dl> <p><dt><strong>Description:</strong><dd> The <code>type</code> statement defines how crossroads handles the stated @@ -852,7 +870,7 @@ Unless you really need such special features, use the type <code>any</code> (the <p><dt><strong>Default:</strong><dd> <code>any</code> </dl> <p> -<a name="conf/headerinspection"></a><a name="l27"></a> +<a name="conf/headerinspection"></a><a name="l28"></a> <strong>4.2.3: headerinspection - are all HTTP headers inspected</strong> <a name="confheaderinspection - are all HTTP headers inspected"></a> <dl> <p><dt><strong>Description:</strong><dd> The <code>headerinspection</code> directive defines whether Crossroads @@ -869,7 +887,7 @@ that forms the server's answer, are analyzed. <p><dt><strong>Default:</strong><dd> <code>deep</code> </dl> <p> -<a name="conf/bindto"></a><a name="l28"></a> +<a name="conf/bindto"></a><a name="l29"></a> <strong>4.2.4: bindto - Binding to a specific IP address</strong> <a name="confbindto - Binding to a specific IP address"></a> <dl> <p><dt><strong>Description:</strong><dd> The <code>bindto</code> statement is used in situations where crossroads @@ -883,7 +901,7 @@ that forms the server's answer, are analyzed. <p><dt><strong>Default:</strong><dd> <code>any</code> </dl> <p> -<a name="conf/verbose"></a><a name="l29"></a> +<a name="conf/verbose"></a><a name="l30"></a> <strong>4.2.5: verbosity - Controlling debug output</strong> <a name="confverbosity - Controlling debug output"></a> <dl> <p><dt><strong>Description:</strong><dd> Verbosity statements come in two forms: <code>verbosity on</code> or @@ -900,7 +918,7 @@ that forms the server's answer, are analyzed. <p><dt><strong>Default:</strong><dd> <code>off</code> </dl> <p> -<a name="conf/dispatchmode"></a><a name="l30"></a> +<a name="conf/dispatchmode"></a><a name="l31"></a> <strong>4.2.6: dispatchmode - How are back ends selected</strong> <a name="confdispatchmode - How are back ends selected"></a> <dl> <p><dt><strong>Description:</strong><dd> The dispatch mode controls how crossroads selects a back end from @@ -987,7 +1005,7 @@ Your 'right' dispatch mode will depend on the type of service. Given <p><dt><strong>Default:</strong><dd> <code>roundrobin</code> </dl> <p> -<a name="conf/revivinginterval"></a><a name="l31"></a> +<a name="conf/revivinginterval"></a><a name="l32"></a> <strong>4.2.7: revivinginterval - Back end wakeup calls</strong> <a name="confrevivinginterval - Back end wakeup calls"></a> <dl> <p><dt><strong>Description:</strong><dd> A reviving interval definition is used when Crossroads @@ -1017,7 +1035,7 @@ An example of the definition is <code>revivinginterval 10</code>. When this <p><dt><strong>Default:</strong><dd> 0 (no wakeup calls) </dl> <p> -<a name="conf/checkinterval"></a><a name="l32"></a> +<a name="conf/checkinterval"></a><a name="l33"></a> <strong>4.2.8: checkinterval - Periodic back end checks</strong> <a name="confcheckinterval - Periodic back end checks"></a> <dl> <p><dt><strong>Description:</strong><dd> When a check interval is stated, Crossroads will periodically @@ -1042,7 +1060,7 @@ The second form activates an external program (see section <p><dt><strong>Default:</strong><dd> 0 (no periodic checks) </dl> <p> -<a name="conf/maxconnections"></a><a name="l33"></a> +<a name="conf/maxconnections"></a><a name="l34"></a> <strong>4.2.9: maxconnections - Limiting concurrent clients at service level</strong> <a name="confmaxconnections - Limiting concurrent clients at service level"></a> <dl> <p><dt><strong>Description:</strong><dd> The maximum number of connections is specified using @@ -1058,7 +1076,7 @@ The second form activates an external program (see section <p><dt><strong>Default:</strong><dd> 0, meaning that all connections will be accepted. </dl> <p> -<a name="conf/backlog"></a><a name="l34"></a> +<a name="conf/backlog"></a><a name="l35"></a> <strong>4.2.10: backlog - The TCP Back Log size</strong> <a name="confbacklog - The TCP Back Log size"></a> <dl> <p><dt><strong>Description:</strong><dd> The TCP back log size is a number that controls how many @@ -1074,7 +1092,7 @@ The second form activates an external program (see section value for socket back log size. </dl> <p> -<a name="conf/shmkey"></a><a name="l35"></a> +<a name="conf/shmkey"></a><a name="l36"></a> <strong>4.2.11: shmkey - Shared Memory Access</strong> <a name="confshmkey - Shared Memory Access"></a> <dl> <p><dt><strong>Description:</strong><dd> Different Crossroads @@ -1095,7 +1113,7 @@ The actual key value doesn't matter much, as long as it's unique own key, based on the service name. </dl> <p> -<a name="conf/allow"></a><a name="l36"></a> +<a name="conf/allow"></a><a name="l37"></a> <strong>4.2.12: allow* and deny* - Allowing or denying connections</strong> <a name="confallow* and deny* - Allowing or denying connections"></a> <dl> <p><dt><strong>Description:</strong><dd> Crossroads can allow or deny @@ -1164,7 +1182,7 @@ This is probably best explained by a few examples: <p><dt><strong>Default:</strong><dd> In absence of these statements, all client IP's are accepted. </dl> <p> -<a name="conf/useraccount"></a><a name="l37"></a> +<a name="conf/useraccount"></a><a name="l38"></a> <strong>4.2.13: useraccount - Limiting the effective ID of external processes</strong> <a name="confuseraccount - Limiting the effective ID of external processes"></a> <dl> <p><dt><strong>Description:</strong><dd> Using the directive <code>useraccount</code>, the effective user and group @@ -1182,7 +1200,7 @@ This is probably best explained by a few examples: ID that was in effect when Crossroads was started. </dl> <p> -<a name="l38"></a> +<a name="l39"></a> <h3>4.3: Backend definitions</h3> <p> Inside the service definitions as are described in the previous @@ -1218,16 +1236,15 @@ Crossroads treats the network traffic as a stream of HTTP messages; i.e., when the service is declared with <code>type http</code>. Incase of <code>type any</code>, the HTTP-specific directives have no effect. <p> -<a name="conf/server.yo"></a><a name="l39"></a> +<a name="conf/server.yo"></a><a name="l40"></a> <strong>4.3.1: server - Specifying the back end address</strong> <a name="confserver - Specifying the back end address"></a> <dl> <p><dt><strong>Description:</strong><dd> Each back end must be identified by the network name (server name) where it is located. For example: <code>server 10.1.1.23</code>, or <code>server web.mydomain.org</code>. A TCP port specifier can follow the server name, as in <code>server - web.mydomain.org:80</code>. <strong>Note that</strong> resolved host names are - cached by Crossroads; there is no performance advantage in - specifying decimal addresses. (The DNS cache timeout can be + web.mydomain.org:80</code>. <strong>Note that</strong> resolved host names can be + cached by Crossroads. (The DNS cache timeout can be controlled using the invocation flag <code>-d</code>.) <p><dt><strong>Syntax:</strong><dd> <ul> <li> <code>server</code> <em>servername</em>, where <em>servername</em> is a @@ -1237,8 +1254,20 @@ i.e., when the service is declared with <code>type http</code>. Incase of <p><dt><strong>Default:</strong><dd> There is no default. This is a required setting. </dl> <p> -<a name="conf/verbose-backend.yo"></a><a name="l40"></a> -<strong>4.3.2: verbosity - Controlling verbosity at the back end level</strong> <a name="confverbosity - Controlling verbosity at the back end level"></a> +<a name="conf/backendport.yo"></a><a name="l41"></a> +<strong>4.3.2: port - Specifying a back end port</strong> <a name="confport - Specifying a back end port"></a> + <dl> + <p><dt><strong>Description:</strong><dd> Back ends must be known by their host name and a port. Both can + be simultaneously specified in a <code>server</code> statement. When the + <code>server</code> statement specifies a host name only, then a <code>port</code> + statement must be used to specify the port. + <p><dt><strong>Syntax:</strong><dd> <code>port</code> <em>number</em> + <p><dt><strong>Default:</strong><dd> There is no default for the port. It must be specified either + using <code>server</code> or using <code>port</code>. + </dl> +<p> +<a name="conf/verbose-backend.yo"></a><a name="l42"></a> +<strong>4.3.3: verbosity - Controlling verbosity at the back end level</strong> <a name="confverbosity - Controlling verbosity at the back end level"></a> <dl> <p><dt><strong>Description:</strong><dd> Similar to <code>service</code> specifications, a <code>backend</code> can have its own verbosity (<code>on</code> or <code>off</code>). When @@ -1251,8 +1280,8 @@ i.e., when the service is declared with <code>type http</code>. Incase of <p><dt><strong>Default:</strong><dd> <code>off</code> </dl> <p> -<a name="conf/retries.yo"></a><a name="l41"></a> -<strong>4.3.3: retries - Specifying allowed failures</strong> <a name="confretries - Specifying allowed failures"></a> +<a name="conf/retries.yo"></a><a name="l43"></a> +<strong>4.3.4: retries - Specifying allowed failures</strong> <a name="confretries - Specifying allowed failures"></a> <dl> <p><dt><strong>Description:</strong><dd> Back ends that are 'flaky' or on a less reliable network can be marked as unavailable after not just one failure, but after @@ -1266,8 +1295,8 @@ i.e., when the service is declared with <code>type http</code>. Incase of connection. </dl> <p> -<a name="conf/weight"></a><a name="l42"></a> -<strong>4.3.4: weight - When a back end is more equal than others</strong> <a name="confweight - When a back end is more equal than others"></a> +<a name="conf/weight"></a><a name="l44"></a> +<strong>4.3.5: weight - When a back end is more equal than others</strong> <a name="confweight - When a back end is more equal than others"></a> <dl> <p><dt><strong>Description:</strong><dd> To influence how backends are selected, a backend can specify its 'weight' in the process. The higher the weight, the less likely a @@ -1285,8 +1314,8 @@ The weighing mechanism only applies to the dispatch modes <p><dt><strong>Default:</strong><dd> 1; all back ends have equal weight. </dl> <p> -<a name="conf/decay"></a><a name="l43"></a> -<strong>4.3.5: decay - Levelling out activity of a back end</strong> <a name="confdecay - Levelling out activity of a back end"></a> +<a name="conf/decay"></a><a name="l45"></a> +<strong>4.3.6: decay - Levelling out activity of a back end</strong> <a name="confdecay - Levelling out activity of a back end"></a> <dl> <p><dt><strong>Description:</strong><dd> To make sure that a 'spike' of activity doesn't influence the perceived load of a back end forever, you may @@ -1307,8 +1336,8 @@ This means that when a given back end is hit, then its usage data <p><dt><strong>Default:</strong><dd> 0, meaning that no decay is applied to usage statistics. </dl> <p> -<a name="conf/state"></a><a name="l44"></a> -<strong>4.3.6: state - Setting an initial back end state</strong> <a name="confstate - Setting an initial back end state"></a> +<a name="conf/state"></a><a name="l46"></a> +<strong>4.3.7: state - Setting an initial back end state</strong> <a name="confstate - Setting an initial back end state"></a> <dl> <p><dt><strong>Description:</strong><dd> Using the <code>state</code> directive a back end can be 'primed' with an initial state. The keyword <code>state</code> can be followed by @@ -1324,8 +1353,8 @@ This means that when a given back end is hit, then its usage data initial dispatching. </dl> <p> -<a name="conf/onhooks"></a><a name="l45"></a> -<strong>4.3.7: onstart, onend, onfail - Action Hooks</strong> <a name="confonstart, onend, onfail - Action Hooks"></a> +<a name="conf/onhooks"></a><a name="l47"></a> +<strong>4.3.8: onstart, onend, onfail - Action Hooks</strong> <a name="confonstart, onend, onfail - Action Hooks"></a> <dl> <p><dt><strong>Description:</strong><dd> The three directives <code>onstart</code>, <code>onend</code> and <code>onfail</code> can be specified to start system commands (external programs) when a @@ -1384,8 +1413,8 @@ The format is always <code>on</code><em>type</em> <em>command</em>. The <em>comm connection, success or failure of a back end. </dl> <p> -<a name="conf/trafficlog"></a><a name="l46"></a> -<strong>4.3.8: trafficlog and throughputlog - Debugging and Performance Aids</strong> <a name="conftrafficlog and throughputlog - Debugging and Performance Aids"></a> +<a name="conf/trafficlog"></a><a name="l48"></a> +<strong>4.3.9: trafficlog and throughputlog - Debugging and Performance Aids</strong> <a name="conftrafficlog and throughputlog - Debugging and Performance Aids"></a> <dl> <p><dt><strong>Description:</strong><dd> Two directives are available to log network traffic to files. They are <code>trafficlog</code> and @@ -1404,8 +1433,8 @@ The <code>throughputlog</code> statement writes shorthand transmissions to <p><dt><strong>Default:</strong><dd> none </dl> <p> -<a name="conf/stickycookie"></a><a name="l47"></a> -<strong>4.3.9: stickycookie - Back end selection with an HTTP cookie</strong> <a name="confstickycookie - Back end selection with an HTTP cookie"></a> +<a name="conf/stickycookie"></a><a name="l49"></a> +<strong>4.3.10: stickycookie - Back end selection with an HTTP cookie</strong> <a name="confstickycookie - Back end selection with an HTTP cookie"></a> <dl> <p><dt><strong>Description:</strong><dd> The directive <code>stickycookie</code> <em>value</em> causes Crossroads to unpack clients' requests, to check for @@ -1444,8 +1473,8 @@ There are basically to provide such cookies to a browser. First, a <p><dt><strong>Default:</strong><dd> There is no default. </dl> <p> -<a name="conf/addclientheader"></a><a name="l48"></a> -<strong>4.3.10: HTTP Header Modification Directives</strong> <a name="confHTTP Header Modification Directives"></a> +<a name="conf/addclientheader"></a><a name="l50"></a> +<strong>4.3.11: HTTP Header Modification Directives</strong> <a name="confHTTP Header Modification Directives"></a> <dl> <p><dt><strong>Description:</strong><dd> Crossroads understands the following header modification directives: <code>addclientheader</code>, @@ -1626,16 +1655,16 @@ service ... { <p><dt><strong>Default:</strong><dd> There is no default. </dl> <p> -<a name="l49"></a> +<a name="l51"></a> <h2>5: Tips, Tricks and Random Remarks</h2> <a name="tips"></a>The following sections elaborate on the directives as described in section <a href="crossroads.html#config">4</a> to illustrate how crossroads works and to help you achieve the "optimal" balancing configuration. <p> -<a name="l50"></a> +<a name="l52"></a> <h3>5.1: Configuration examples</h3> <a name="tips/examples"></a> -<a name="l51"></a> +<a name="l53"></a> <strong>5.1.1: A load balancer for three webserver back ends</strong> <p> The following configuration example binds crossroads to port 80 of the @@ -1764,7 +1793,7 @@ service www { </pre> <p> -<a name="l52"></a> +<a name="l54"></a> <strong>5.1.2: An HTTP forwarder when travelling</strong> <p> As another example, here's my /etc/crossroads.conf that I use on my @@ -1853,7 +1882,7 @@ and <code>LocalSquid</code> are both active, then <code>crossroads tell httpprox sshtunnel down</code> will 'take down' the back end <code>SshTunnel</code> -- and will automatically cause crossroads to switch to <code>LocalSquid</code>. <p> -<a name="l53"></a> +<a name="l55"></a> <strong>5.1.3: SSH login with enforced idle logout</strong> <p> The following example shows how crossroads 'throttles' SSH @@ -1879,7 +1908,7 @@ service Ssh { </pre> <p> -<a name="l54"></a> +<a name="l56"></a> <h3>5.2: How back ends are selected in load balancing</h3> <a name="howselected"></a> <a name="tips/howselected"></a>In order to tune your load balancing, you'll need to understand how crossroads computes usage, how weighing works, and so on. In this @@ -1887,7 +1916,7 @@ section we'll focus on the dispatching modes <code>bysize</code>, <code>bydurati and <code>byconnections</code> only. The other dispatching types are self-explanatory. <p> -<a name="l55"></a> +<a name="l57"></a> <strong>5.2.1: Bysize, byduration or byconnections?</strong> <p> As stated before, crossroads doesn't know 'what a service does' and @@ -1937,7 +1966,7 @@ E.g., consider a database connection. What's <p> </ul> <p> -<a name="l56"></a> +<a name="l58"></a> <strong>5.2.2: Averaging size and duration</strong> <p> The configuration statement <code>dispatchmode bysize</code> or <code>byduration</code> @@ -1958,7 +1987,7 @@ In contrast, when e.g. <code>over 3</code> is in effect, then a sudden load does show up -- because it highly contributes to the average of three connections. <p> -<a name="l57"></a> +<a name="l59"></a> <strong>5.2.3: Specifying decays</strong> <p> Decays are also only relevant when crossroads computes the 'next best @@ -2012,7 +2041,7 @@ service soap { </pre> <p> -<a name="l58"></a> +<a name="l60"></a> <strong>5.2.4: Adjusting the weights</strong> <p> The back end modifier <code>weight</code> is useful in situations where your @@ -2066,7 +2095,7 @@ both A and B crash). Note also that A's usage data decay much faster than B's and C's: we're assuming that this big server recovers quicker than its smaller siblings. <p> -<a name="l59"></a> +<a name="l61"></a> <h3>5.3: Periodic probes and wake up calls</h3> <a name="tips/periodic"></a>Crossroads has two methods of periodic back end verifications: <p> @@ -2090,7 +2119,7 @@ than its smaller siblings. <code>checkinterval</code>. During each check, back ends can be marked as available or as unavailable.</ul> <p> -<a name="l60"></a> +<a name="l62"></a> <strong>5.3.1: Syntax</strong> <p> The syntax of both verifications is: @@ -2142,7 +2171,7 @@ The <em>arguments</em> are expanded according to the following table: <li> Any other chararacter following a <code>%</code> sign is taken literally; e.g. <code>%z</code> is just a z.</ul> <p> -<a name="l61"></a> +<a name="l63"></a> <strong>5.3.2: Security Considerations</strong> <p> When <code>externalhandler</code> is in effect, Crossroads spawns an external @@ -2151,7 +2180,7 @@ a restricted user account. <p> The directive <code>useraccount</code> can be used to accomplish this. <p> -<a name="l62"></a> +<a name="l64"></a> <strong>5.3.3: An example</strong> <p> The following configuration balances SMTP requests to two back @@ -2188,7 +2217,7 @@ service smtp { </pre> <p> -<a name="l63"></a> +<a name="l65"></a> <h3>5.4: Throttling the number of concurrent connections</h3> <a name="tips/throttling"></a>If you suspect that your service may occasionally receive 'spikes' of activity&nbsp;(which you should always assume), then it might be a @@ -2217,7 +2246,7 @@ too much, a situation may occur where that back end is about to be hit. A <code>maxconnections</code> statement on the level of that back may then protect it. <p> -<a name="l64"></a> +<a name="l66"></a> <h3>5.5: TCP Session Stickiness</h3> <a name="tips/tcpstickiness"></a>If you need to make sure that a client that once gets dispatched to a given back end keeps re-visiting the back end, then Crossroads offers @@ -2242,7 +2271,7 @@ If the preferred back end is unavailable, then the action that Crossroads takes is to dispatch as if <code>byconnections</code>: of the available back ends, the one with the least connections is taken. <p> -<a name="l65"></a> +<a name="l67"></a> <h3>5.6: HTTP Session Stickiness</h3> <a name="tips/httpstickiness"></a>This section focuses on HTTP session stickiness. This term refers to the ability of a balancer to route a conversation between browser and @@ -2250,7 +2279,7 @@ a backend farm with webservers always to the same back end. In other words: once a back end is selected by the balancer, it will remain the back end of choice, even for subsequent connections. <p> -<a name="l66"></a> +<a name="l68"></a> <strong>5.6.1: Don't use stickiness!</strong> <p> The rule of thumb as far as the balancer is concerned, is: <strong>Do not @@ -2282,7 +2311,7 @@ that all PHP applications have access to these data. Application servers such as Websphere can be configured to replicate session data between nodes. <p> -<a name="l67"></a> +<a name="l69"></a> <strong>5.6.2: But if you must..</strong> <p> If you really need stickiness, think first whether you might use TCP @@ -2364,7 +2393,7 @@ Note how the cookie names and values in the directives <code>stickycookie</code> and <code>addclientheader</code> match. That is obviously a prerequisite for stickiness. <p> -<a name="l68"></a> +<a name="l70"></a> <h3>5.7: Passing the client's IP address</h3> <a name="tips/clientip"></a>Since Crossroads just shuttles bytes to and fro, meta-information of network connections is lost. As far as the back ends are concerned, @@ -2394,7 +2423,7 @@ header: <code>X-Real-IP</code>, holding the client's IP address. performance will be hampered -- all passing messages will have to be unpacked and analyzed. <p> -<a name="l69"></a> +<a name="l71"></a> <strong>5.7.1: Sample Crossroads configuration</strong> <p> The below sample configuration shows two HTTP back ends that receive @@ -2421,7 +2450,7 @@ service www { </pre> <p> -<a name="l70"></a> +<a name="l72"></a> <strong>5.7.2: Sample Apache configuration</strong> <p> The method by which each back end analyzes the header <code>X-Real-IP</code> @@ -2453,7 +2482,7 @@ LogFormat "%{X-Real-IP}i %l %u %t %D \"%r\" %&gt;s %b" common </pre> <p> -<a name="l71"></a> +<a name="l73"></a> <h3>5.8: Deep or shallow HTTP header inspection</h3> <a name="tips/deeporshallow"></a>The service-level directive <code>headerinspection</code> defines which HTTP headers Crossroads will analyze. Often, several HTTP requests and @@ -2565,7 +2594,7 @@ In these examples, <code>shallow</code> mode is not usable, because the HTTP server signature. All subsequent transactions would still show the HTTP server signature to the world.</ul> <p> -<a name="l72"></a> +<a name="l74"></a> <h3>5.9: Debugging network traffic</h3> <a name="tips/debugging"></a> Incase the traffic between client and backend @@ -2688,9 +2717,9 @@ Summarizing, the throughput times of a client-back end connection analyze the output and to compute round trip times. Such scripts are not (yet) included in Crossroads. <p> -<a name="l73"></a> +<a name="l75"></a> <h3>5.10: IP filtering: Limiting Access by Client IP Address</h3> -<a name="tips/ipfiltering"></a><a name="l74"></a> +<a name="tips/ipfiltering"></a><a name="l76"></a> <strong>5.10.1: General Examples</strong> <p> The directives <code>allowfrom</code>, <code>denyfrom</code>, <code>allowfile</code> and @@ -2727,7 +2756,7 @@ with 192.168.1. The specifier <code>192.168.1/24</code> states that there are three network bytes (192, 168 and 1), and 24 bits (or 3 bytes) are relevant; so that the fourth network byte doesn't matter. <p> -<a name="l75"></a> +<a name="l77"></a> <strong>5.10.2: Using External Files</strong> <p> The directives <code>allowfile</code> and <code>denyfile</code> allow you to specify IP @@ -2759,7 +2788,7 @@ is running, you may edit <code>/tmp/allow.txt</code>, and then issue <code>killa -1 crossroads</code>. The new contents of <code>/tmp/allow.txt</code> will be reloaded. <p> -<a name="l76"></a> +<a name="l78"></a> <strong>5.10.3: Mixing Directives</strong> <p> Crossroads allows to mix all directives in one service @@ -2826,14 +2855,14 @@ Crossroads only performs syntactic checking of the configuration. Some of the above samples are syntactically correct, but make no semantic sense: Crossroads doesn't warn for such situations. <p> -<a name="l77"></a> +<a name="l79"></a> <h3>5.11: Using an external program to dispatch</h3> <a name="externalhandler"></a> <a name="tips/externalhandler"></a>As mentioned before, Crossroads supports several built-in dispatch modes. However, you are always free to hook-in your own dispatch mode that determines the next back end using your own specific algorithm. This section explains how to do it. <p> -<a name="l78"></a> +<a name="l80"></a> <strong>5.11.1: Configuring the external handler</strong> <p> First, the <code>dispatchmode</code> statement needs to inform Crossroads that @@ -2879,7 +2908,7 @@ phase in which an external handler is called, since there is no current back end yet (the job of the handler is to supply one, so at the time of calling, <code>%b</code> is undefined). <p> -<a name="l79"></a> +<a name="l81"></a> <strong>5.11.2: Writing the external handler</strong> <p> The external handler is activated using the arguments that are @@ -2888,7 +2917,7 @@ whatever it wants, but ultimately, it must write a back end name on its <em>stdout</em>. Crossroads reads this, and if the back end is available, uses that back end for the connection. <p> -<a name="l80"></a> +<a name="l82"></a> <strong>5.11.3: Examples of external handlers</strong> <p> This section shows some examples of Crossroads configurations @@ -3315,7 +3344,7 @@ if ($action eq 'dispatch') { </pre> <p> -<a name="l81"></a> +<a name="l83"></a> <h3>5.12: Linux and ip_conntrack_max</h3> <a name="tips/ipconntrackmax"></a>The kernel value of <code>ip_conntrack_max</code> is important for routers and balancers under Linux. Basically it's the maximum number of tracked @@ -3340,25 +3369,24 @@ The solution is as follows: the current value. <li> Add something to the shown value (e.g., multiply by two), and inform - the kernel of the new value, using <code>echo</code> (new-value) <code>&gt; + the kernel of the new value, using <code>echo</code> <em>new-value</em> <code>&gt; /proc/sys/net/ipv4/ip_conntrack_max</code> <li> Make sure that the same step occurs somewhere in your - boot sequence as well, or that the new valueit is stated in a - configuration - file such as <code>/etc/sysctl.conf</code>.</ul> + boot sequence as well, or that the new value is stated in a + configuration file such as <code>/etc/sysctl.conf</code>.</ul> <p> The value for <em>new-value</em> is something that you'll have to figure out yourself. Note however that each count will cause the kernel to reserve 350 bytes. So if you set <code>ip_conntrack_max</code> to 100.000, then you're already taking 33.3Mb off the total available memory. <p> -<a name="l82"></a> +<a name="l84"></a> <h3>5.13: Marking back ends as bad after more than one try</h3> <a name="tips/retries"></a>Crossroads allows you to specify on a per-back end basis how many retries are needed before a back end is considered unavailable. The default is just one, meaning that after one failed connection, Crossroads will mark a back end as unavailable (the back end may be -'revived', if you use <code>revivinginterval</code>). +'revived', if you use <code>revivinginterval</code> or <code>checkinterval</code>). <p> Increasing the number is specified using the keyword <code>retries</code>. The following configuration defines two back ends; the one on the IP @@ -3397,7 +3425,7 @@ retry connecting with a small one-second delay in between. A high <code>retries</code> number means also lots of one-second delays, in which time a client is kept waiting. <p> -<a name="l83"></a> +<a name="l85"></a> <h3>5.14: Using the Web Interface crossroads-mgr</h3> <a name="tips/webinterface"></a>The mini-webserver <code>crossroads-mgr</code> provides an intuitive web interface to the state of Crossroads. Once started, an administrator @@ -3448,7 +3476,7 @@ The web interface doesn't offer extra functionality over the command line tools; but all information is available at one glance, and accessible without a shell access to the balancer. <p> -<a name="l84"></a> +<a name="l86"></a> <strong>5.14.1: Starting crossroads-mgr</strong> <p> The basic command to start <code>crossroads-mgr</code> is @@ -3511,14 +3539,15 @@ echo -e 'viewer:showme\nmodifier:changeit' | </pre> <p> -<a name="l85"></a> +<a name="l87"></a> <h3>5.15: Rendering Crossroads' status in a web page</h3> <a name="xmlstatus"></a> <a name="tips/rendering"></a>The Crossroads flag <code>-x</code> causes the status output to be generated as an XML document. This format can be nicely used to render the output as an HTML page. <p> E.g., the following sample shows how Crossroads reports its status in -XML format: +XML format (the actual XML structure that Crossroads outputs may be +different from this example, depending on the version): <p> <pre> &lt;?xml version="1.0" encoding="UTF-8"?&gt; @@ -3581,7 +3610,7 @@ somewhat more liberal. There are basically two options: users belonging to the same group as the Crossroads starter can run <code>crossroads status</code>.</ul> <p> -<a name="l86"></a> +<a name="l88"></a> <h3>5.16: Crossroads and DNS caching</h3> <a name="tips/dnscaching"></a> The option <code>-d</code> allows you to control Crossroads' built in DNS @@ -3605,13 +3634,98 @@ Crossroads to use its DNS cache to store results. Each result is stored for up to <em>nsec</em> seconds - after that, a new request for the back end will lead to a new DNS lookup. <p> -<a name="l87"></a> +<a name="l89"></a> +<h3>5.17: Managing a Pool of Virtual Back Ends</h3> +<a name="tips/virtual"></a>Crossroads can be used as a central dispatcher for computing on +demand. E.g., imagine a situation where a web service exists on one or +two servers, with the option of adding new servers in case of a high +load. The "other" servers, besides the first two ones, are a virtual +pool - the pool size and the IP addresses may not be known in advance. +<p> +The following Crossroads' features are used in this example: +<p> +<ul> +<p> +<li> The back ends of Crossroads can have an initial state. For + the two real servers which are already present this would be + <code>up</code> (the default). For the non-present ones this would be + <code>down</code>: Crossroads excludes back ends that are down from the set + of candidate workers, and does not check their presence using + <code>revivalinterval</code> or <code>checkinterval</code>. +<p> +<li> The back ends must be configured to have a server address and + port, but this can be later reconfigured runtime. E.g., the + virtual pool servers would be initially configured on + <code>localhost:80</code>, and later the addresses would be filled in.</ul> +<p> +A sample Crossroads configuration is shown below. It defines 20 back +ends: two are always present, and 18 are in the virtual pool. +<p> +<pre> +service vpool { + port 80; + revivinginterval 3; + dispatchmode byconnections; + + /* The two back ends that are always present: */ + backend real_01 { server 10.1.1.1:80; } + backend real_02 { server 10.1.1.2:80; } + + /* The virtual pool: */ + backend virt_01 { server localhost:80; state down; } + backend virt_02 { server localhost:80; state down; } + backend virt_03 { server localhost:80; state down; } + backend virt_04 { server localhost:80; state down; } + backend virt_05 { server localhost:80; state down; } + backend virt_06 { server localhost:80; state down; } + backend virt_07 { server localhost:80; state down; } + backend virt_08 { server localhost:80; state down; } + backend virt_09 { server localhost:80; state down; } + backend virt_10 { server localhost:80; state down; } + backend virt_11 { server localhost:80; state down; } + backend virt_12 { server localhost:80; state down; } + backend virt_13 { server localhost:80; state down; } + backend virt_14 { server localhost:80; state down; } + backend virt_15 { server localhost:80; state down; } + backend virt_16 { server localhost:80; state down; } + backend virt_17 { server localhost:80; state down; } + backend virt_18 { server localhost:80; state down; } + +} +</pre> + +<p> +New back ends can be enabled using <code>crossroads tell</code>. E.g., to +enable back end <code>virt_01</code> on IP address 10.100.1.1:80, the commands +are: +<p> +<pre> +crossroads tell vpool virt_01 server 10.100.1.1:80 + crossroads tell vpool virt_01 up +</pre> + +<p> +To disable a back end, its state is reset to <code>down</code>. The IP address +doesn't even have to be erased: +<p> +<pre> +crossroads tell vpool virt_01 down +</pre> + +<p> +A script to monitor the total number of connections, and to add a back +end or to remove one, is left to the reader. The output of +<code>crossroads -x status</code> can be very helpful here: it reports on the +states of all back ends, their connections, the total number of +available or down back ends, etc.. +<p> +<a name="l90"></a> <h2>6: Benchmarking</h2> <a name="benchmarking"></a>This section shows how crossroads affects the transmitting of HTML data when used as an intermediate 'station' through which all data travels. <p> -<a name="l88"></a> +<a name="l91"></a> <h3>6.1: Benchmark 1: Accessing a proxy via crossroads or directly</h3> <p> The benchmark was run on a system where the following was varied: @@ -3639,7 +3753,7 @@ service HttpProxy { </pre> <p> -<a name="l89"></a> +<a name="l92"></a> <strong>6.1.1: Results</strong> <p> The results of this test are that crossroads causes a negligible @@ -3662,7 +3776,7 @@ sys 0m0.230s </pre> <p> -<a name="l90"></a> +<a name="l93"></a> <strong>6.1.2: Discussion</strong> <p> The above shown results are quite favorable to crossroads. However, @@ -3694,7 +3808,7 @@ seldom in the real world: back end). Again, this processing time will weigh much heavier than the multiple read/writes.</ul> <p> -<a name="l91"></a> +<a name="l94"></a> <h3>6.2: Benchmark 2: Crossroads versus Linux Virtual Server (LVS)</h3> <p> LVS is a kernel-based balancer that acts like a masquerading @@ -3708,7 +3822,7 @@ LVS isn't aware of downtime of back ends (unless one implements an external heartbeat). Also, crossroads offers more complex balancing than LVS. <p> -<a name="l92"></a> +<a name="l95"></a> <strong>6.2.1: Environment</strong> <p> On the balancer, LVS was run on port 80, its forwarding set up for two @@ -3739,7 +3853,7 @@ service http { </pre> <p> -<a name="l93"></a> +<a name="l96"></a> <strong>6.2.2: Tests and results</strong> <p> In the first test, ports 80 and 81 on the balancer were 'bombed' with @@ -3818,9 +3932,9 @@ are shown in the below table: Again, the results show that crossroads performs just as effectively as LVS, even with large data chunks! <p> -<a name="l94"></a> +<a name="l97"></a> <h2>7: Compiling and Installing</h2> <a name="installation"></a> -<a name="compiling"></a><a name="l95"></a> +<a name="compiling"></a><a name="l98"></a> <h3>7.1: Prerequisites</h3> <p> The creation of crossroads requires: @@ -3839,7 +3953,7 @@ The creation of crossroads requires: Basically a Linux or Apple MacOSX box will do nicely. To compile and install crossroads, follow these steps. <p> -<a name="l96"></a> +<a name="l99"></a> <h3>7.2: Compiling and installing</h3> <p> <ul> @@ -3903,7 +4017,7 @@ crossroads, follow these steps. <p> </ul> <p> -<a name="l97"></a> +<a name="l100"></a> <h3>7.3: Configuring crossroads</h3> <p> Now that the binary is available on your system, you need to create a @@ -3951,13 +4065,13 @@ which crossroads daemons are running. Finally, the tailing of <code>/var/log/messages</code> shows what's going on -- especially if you have <code>verbosity true</code> statements in the configuration. <p> -<a name="l98"></a> +<a name="l101"></a> <h3>7.4: A boot script</h3> <p> Finally, you may want to create a boot-time startup script. The exact procedure depends on the used Unix flavor. <p> -<a name="l99"></a> +<a name="l102"></a> <strong>7.4.1: SysV Style Startup</strong> <p> On SysV style systems, there's a startup script directory @@ -4011,7 +4125,7 @@ If your runlevel is 5, then the right <code>cd</code> command is to <code>/etc/rc.d/rc5.d</code>. Alternatively, you can create the symlinks in both runlevel directories.</ul> <p> -<a name="l100"></a> +<a name="l103"></a> <strong>7.4.2: BSD Style Startup</strong> <p> On BSD style systems, daemons are booted directly from <code>/etc/rc</code> and diff --git a/doc/crossroads.pdf b/doc/crossroads.pdf Binary files differ. diff --git a/doc/main/conf/backendport.yo b/doc/main/conf/backendport.yo @@ -0,0 +1,8 @@ +conf(port - Specifying a back end port) + (Back ends must be known by their host name and a port. Both can + be simultaneously specified in a tt(server) statement. When the + tt(server) statement specifies a host name only, then a tt(port) + statement must be used to specify the port.) + (tt(port) em(number)) + (There is no default for the port. It must be specified either + using tt(server) or using tt(port).) diff --git a/doc/main/conf/server.yo b/doc/main/conf/server.yo @@ -3,9 +3,8 @@ conf(server - Specifying the back end address) (server name) where it is located. For example: tt(server 10.1.1.23), or tt(server web.mydomain.org). A TCP port specifier can follow the server name, as in tt(server - web.mydomain.org:80). bf(Note that) resolved host names are - cached by Crossroads; there is no performance advantage in - specifying decimal addresses. (The DNS cache timeout can be + web.mydomain.org:80). bf(Note that) resolved host names can be + cached by Crossroads. (The DNS cache timeout can be controlled using the invocation flag tt(-d).)) (itemization( it() tt(server) em(servername), where em(servername) is a diff --git a/doc/main/config.yo b/doc/main/config.yo @@ -187,6 +187,7 @@ i.e., when the service is declared with tt(type http). Incase of tt(type any), the HTTP-specific directives have no effect. includefile(conf/server.yo) +includefile(conf/backendport.yo) includefile(conf/verbose-backend.yo) includefile(conf/retries.yo) includefile(conf/weight) diff --git a/doc/main/intro.yo b/doc/main/intro.yo @@ -182,6 +182,20 @@ configurations to new versions. Given the changes of the syntax of the configuration file of Crossroads, existing configuration files may need to be made suitable for new versions. +subsubsect(Porting issues fdor pre-1.50 installations) + + As of version 1.50, the command tt(crossroads tell) has been + changed. To set a state, the command must be used as follows: + + center(tt(crossroads) tt(tell) em(service) em(backend) tt(state) + em(newstate)) + + The keyword tt(state) was added. This is because tt(crossroads + tell) can also set a new server address; in that case the keyword + tt(server) is required. If you have automatic health checkers or + the like that change the back end states, please modify the + commands to suit this. + subsubsect(Porting issues for pre-1.43 installations) As of version 1.43, the shared memory key calculations are based diff --git a/doc/main/tips.yo b/doc/main/tips.yo @@ -49,3 +49,6 @@ includefile(tips/rendering) subsect(Crossroads and DNS caching) includefile(tips/dnscaching) + +subsect(Managing a Pool of Virtual Back Ends) +includefile(tips/virtual) diff --git a/doc/main/tips/ipconntrackmax.yo b/doc/main/tips/ipconntrackmax.yo @@ -21,12 +21,11 @@ itemization( the current value. it() Add something to the shown value (e.g., multiply by two), and inform - the kernel of the new value, using tt(echo) (new-value) tt(> + the kernel of the new value, using tt(echo) em(new-value) tt(> /proc/sys/net/ipv4/ip_conntrack_max) it() Make sure that the same step occurs somewhere in your - boot sequence as well, or that the new valueit is stated in a - configuration - file such as tt(/etc/sysctl.conf).) + boot sequence as well, or that the new value is stated in a + configuration file such as tt(/etc/sysctl.conf).) The value for em(new-value) is something that you'll have to figure out yourself. Note however that each count will cause the kernel to diff --git a/doc/main/tips/rendering.yo b/doc/main/tips/rendering.yo @@ -3,7 +3,8 @@ an XML document. This format can be nicely used to render the output as an HTML page. E.g., the following sample shows how Crossroads reports its status in -XML format: +XML format (the actual XML structure that Crossroads outputs may be +different from this example, depending on the version): verb(\ <?xml version="1.0" encoding="UTF-8"?> diff --git a/doc/main/tips/retries.yo b/doc/main/tips/retries.yo @@ -2,7 +2,7 @@ Crossroads allows you to specify on a per-back end basis how many retries are needed before a back end is considered unavailable. The default is just one, meaning that after one failed connection, Crossroads will mark a back end as unavailable (the back end may be -'revived', if you use tt(revivinginterval)). +'revived', if you use tt(revivinginterval) or tt(checkinterval)). Increasing the number is specified using the keyword tt(retries). The following configuration defines two back ends; the one on the IP diff --git a/doc/main/tips/virtual.yo b/doc/main/tips/virtual.yo @@ -0,0 +1,77 @@ +Crossroads can be used as a central dispatcher for computing on +demand. E.g., imagine a situation where a web service exists on one or +two servers, with the option of adding new servers in case of a high +load. The "other" servers, besides the first two ones, are a virtual +pool - the pool size and the IP addresses may not be known in advance. + +The following Crossroads' features are used in this example: + +itemization( + + it() The back ends of Crossroads can have an initial state. For + the two real servers which are already present this would be + tt(up) (the default). For the non-present ones this would be + tt(down): Crossroads excludes back ends that are down from the set + of candidate workers, and does not check their presence using + tt(revivalinterval) or tt(checkinterval). + + it() The back ends must be configured to have a server address and + port, but this can be later reconfigured runtime. E.g., the + virtual pool servers would be initially configured on + tt(localhost:80), and later the addresses would be filled in.) + +A sample Crossroads configuration is shown below. It defines 20 back +ends: two are always present, and 18 are in the virtual pool. + +verb(\ +service vpool { + port 80; + revivinginterval 3; + dispatchmode byconnections; + + /* The two back ends that are always present: */ + backend real_01 { server 10.1.1.1:80; } + backend real_02 { server 10.1.1.2:80; } + + /* The virtual pool: */ + backend virt_01 { server localhost:80; state down; } + backend virt_02 { server localhost:80; state down; } + backend virt_03 { server localhost:80; state down; } + backend virt_04 { server localhost:80; state down; } + backend virt_05 { server localhost:80; state down; } + backend virt_06 { server localhost:80; state down; } + backend virt_07 { server localhost:80; state down; } + backend virt_08 { server localhost:80; state down; } + backend virt_09 { server localhost:80; state down; } + backend virt_10 { server localhost:80; state down; } + backend virt_11 { server localhost:80; state down; } + backend virt_12 { server localhost:80; state down; } + backend virt_13 { server localhost:80; state down; } + backend virt_14 { server localhost:80; state down; } + backend virt_15 { server localhost:80; state down; } + backend virt_16 { server localhost:80; state down; } + backend virt_17 { server localhost:80; state down; } + backend virt_18 { server localhost:80; state down; } + +}) + +New back ends can be enabled using tt(crossroads tell). E.g., to +enable back end tt(virt_01) on IP address 10.100.1.1:80, the commands +are: + +verb(\ + crossroads tell vpool virt_01 server 10.100.1.1:80 + crossroads tell vpool virt_01 up) + +To disable a back end, its state is reset to tt(down). The IP address +doesn't even have to be erased: + +verb(\ + crossroads tell vpool virt_01 down) + +A script to monitor the total number of connections, and to add a back +end or to remove one, is left to the reader. The output of +tt(crossroads -x status) can be very helpful here: it reports on the +states of all back ends, their connections, the total number of +available or down back ends, etc.. + diff --git a/etc/Makefile.conf b/etc/Makefile.conf @@ -7,7 +7,7 @@ LIBS := $(shell $(BASE)/tools/c-conf -c $(BASE)/src/c-conf.cache lib \ # Compiletime defines. Remember to update show_config() when changing # this list! -DEFS := -DDEFAULT_CONF='"$(DEFAULT_CONF)"' -DMAX_BACKEND=$(MAX_BACKEND) \ +DEFS := -DDEFAULT_CONF='"$(DEFAULT_CONF)"' \ -DSLEEP_TIME=$(SLEEP_TIME) -DDNS_CACHESIZE=$(DNS_CACHESIZE) \ -DDNS_CACHETTL=$(DNS_CACHETTL) -DDEF_MAX=$(DEF_MAX) \ -DCONNECT_TIMEOUT=$(CONNECT_TIMEOUT) -DVER='"$(VER)/$(REVVER)"' \ diff --git a/etc/Makefile.def b/etc/Makefile.def @@ -6,7 +6,7 @@ # Versioning. This defines the overall version ID and must match the topmost # entry in the ChangeLog. -VER = 1.50 +VER = 1.51 # Years that Crossroads has been 'round. YEARS = 2005-2007 @@ -22,10 +22,6 @@ REVVER = $(shell $(BASE)/etc/svnrev $(BASE)/ChangeLog $(BASE)/etc/svnrev.txt) # Default config DEFAULT_CONF = /etc/crossroads.conf -# The max nr of backends of a given service. This is a fixed number, -# because it defines the size of the shared memory that crossroads claims. -MAX_BACKEND = 20 - # The length of a fully qualified domain name. See RFC2181. FQDN_LENGTH = 256 diff --git a/etc/svnrev.txt b/etc/svnrev.txt @@ -1 +1 @@ -184 +185 diff --git a/src/crossroads-daemon/main.c b/src/crossroads-daemon/main.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/crossroads-mgr/crossroads-mgr.in b/src/crossroads-mgr/crossroads-mgr.in @@ -39,7 +39,7 @@ $daemon->start ($prog->port()); # doesn't return ::getopts ('vfl:x:X:b:B:', \%opts) or usage(); # Act according to argument; 'start' is handled here. - if ($ARGV[0] eq 'stop' and $#ARGV == 0) { + if ($ARGV[0] eq 'stop') { stop(); exit (0); } elsif ($ARGV[0] eq 'status' and $#ARGV == 0) { diff --git a/src/crossroads-mgr/crossroads-mgr.xslt b/src/crossroads-mgr/crossroads-mgr.xslt @@ -14,8 +14,6 @@ function setaddress (target) { var hostname = document.getElementById (target + '/hostname').value; var port = document.getElementById (target + '/port').value; - // alert ('Setting address for ' + target + ' to ' + - // hostname + ':' + port); document.location = '/set/' + target + '/server/' + hostname + '/' + port; } @@ -51,7 +49,9 @@ <i> Generated by Crossroads __VER__. Visit - <a href="http://crossroads.e-tunity.com">http://crossroads.e-tunity.com</a> + <a href="http://crossroads.e-tunity.com"> + http://crossroads.e-tunity.com + </a> for documentation and downloads. <br/> </i> </div> @@ -67,9 +67,40 @@ <xsl:template match="/status/service"> <tr> - <td class="service"> <b> Service <xsl:value-of select="@name"/> </b> </td> + <td class="service" valign="top"> + <b> Service <xsl:value-of select="@name"/> </b> + </td> <td class="service" colspan="3"> - <xsl:value-of select="connections"/> connections + <table> + <tr> + <td class="service">Total connections:</td> + <td class="service"><xsl:value-of select="connections"/></td> + </tr> + <xsl:if test="backends_available &gt; 0"> + <tr> + <td class="service">Available back ends:</td> + <td class="service"><xsl:value-of select="backends_available"/></td> + </tr> + </xsl:if> + <xsl:if test="backends_unavailable &gt; 0"> + <tr> + <td class="service">Unvailable back ends:</td> + <td class="service"><xsl:value-of select="backends_unavailable"/></td> + </tr> + </xsl:if> + <xsl:if test="backends_down &gt; 0"> + <tr> + <td class="service">Down back ends:</td> + <td class="service"><xsl:value-of select="backends_down"/></td> + </tr> + </xsl:if> + <xsl:if test="backends_waking &gt; 0"> + <tr> + <td class="service">Waking back ends:</td> + <td class="service"><xsl:value-of select="backends_waking"/></td> + </tr> + </xsl:if> + </table> </td> </tr> <xsl:apply-templates/> @@ -139,11 +170,11 @@ <td class="info"/> <td class="info"> Address: </td> <td class="info"> - <input name="{../@name}/{@name}/hostname" type="text" + <input name="{../@name}/{@name}/hostname" type="text" class="info" id="{../@name}/{@name}/hostname" value="{server}" maxlength="255"/> : <input name="{../@name}/{@name}/port" type="text" value="{port}" - id="{../@name}/{@name}/port" size="7"/> + id="{../@name}/{@name}/port" size="7" class="info"/> <input type="button" class="info" value="Set" onclick="setaddress('{../@name}/{@name}');"/> </td> diff --git a/src/crossroads.h b/src/crossroads.h @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -153,6 +153,8 @@ typedef enum { /* Backend availability */ st_intermediate, /* .. bogus, for mark_activity() */ st_unknown /* .. no idea (terminator) */ } Backendavail; +#define NR_OF_STATES 6 /* Make sure this matches the above */ + /* possible states! */ typedef struct { /* Backend description */ char *name; /* .. back end identifier */ @@ -251,7 +253,7 @@ typedef struct { /* Service reporting (shmem) */ unsigned nclients; /* .. active clients */ int last_backend; /* .. last used back end */ Backendstate /* .. states of the back ends */ - backendstate[MAX_BACKEND]; + backendstate[1]; /* .. actual shmem array will be >1 */ } Servicereport; typedef enum { /* Stage of the program: */ diff --git a/src/crossroads/main.c b/src/crossroads/main.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/allocreporter.c b/src/lib/allocreporter.c @@ -1,10 +1,17 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ + #include "../crossroads.h" +/* Here's the calculation of the required shm block size. The Servicereport + * has already one Backendstate in it, so we need to add (n-1) blocks to + * make block->backendstate a linear array. */ +#define REPORTSIZE(s) \ + sizeof(Servicereport) + ((s)->nbackend - 1) * sizeof(Backendstate) + void alloc_reporter (Service *s, int first) { int shmid; struct shmid_ds shmbuf; @@ -15,8 +22,8 @@ void alloc_reporter (Service *s, int first) { s->name, s->shmkey); if (first) { - /* First time 'round. We're allocating for the first time here. */ - if ( (shmid = shmget (s->shmkey, sizeof(Servicereport), + /* First time 'round. We're allocating for the first time here.*/ + if ( (shmid = shmget (s->shmkey, REPORTSIZE(s), shmperm | IPC_CREAT) ) >= 0) msg ("Created new shm at id %d", shmid); else @@ -41,12 +48,10 @@ void alloc_reporter (Service *s, int first) { } else { /* Second time 'round. We're getting a handle on previously * created shared memory and semaphores. */ - if ( (shmid = shmget (s->shmkey, sizeof(Servicereport), - shmperm) ) >= 0) + if ( (shmid = shmget (s->shmkey, REPORTSIZE(s), shmperm) ) >= 0 ) msg ("Got existing shm at id %d", shmid); else - error ("Cannot get shared memory for service %s, " - "key %d: %s. " + error ("Cannot get shared memory for service %s, key %d: %s. " "Maybe crossroads isn't running, or the configuration " "has changed.", s->name, s->shmkey, strerror(errno)); diff --git a/src/lib/ansistamp.c b/src/lib/ansistamp.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/backendavailable.c b/src/lib/backendavailable.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/backendconnect.c b/src/lib/backendconnect.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/backendcount.c b/src/lib/backendcount.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/choosebackend.c b/src/lib/choosebackend.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -7,10 +7,10 @@ #include "../crossroads.h" void choose_backend () { - int backends[MAX_BACKEND], nbackends = 0, h, i, j, k, - target_set = 0, flat_weights = 1, weights[MAX_BACKEND], *sel_weights, + int *backends = 0, nbackends = 0, h, i, j, k, + target_set = 0, flat_weights = 1, *weights = 0, *sel_weights, tot_weights, lo_val, hi_val, done; - double values [MAX_BACKEND], nbest; + double *values = 0, nbest; unsigned nclients; char *exthandler; FILE *f; @@ -66,6 +66,7 @@ void choose_backend () { i, activeservice->backend[i].maxconnections, servicereport->backendstate[i].nclients, state_to_string(servicereport->backendstate[i].actual_avail)); + backends = xrealloc (backends, (nbackends + 1) * sizeof(int) ); backends[nbackends++] = i; } } @@ -84,6 +85,7 @@ void choose_backend () { servicereport->last_backend = current_backend; msg ("Service %s: only 1 backend to select (%d)", activeservice->name, current_backend); + free (backends); return; } @@ -102,14 +104,16 @@ void choose_backend () { servicereport->last_backend = current_backend; msg ("Service %s: next roundrobin back end is %d", activeservice->name, current_backend); + free (backends); return; } - /* None found.. try the first one (run to momma). */ + /* None found.. try the first one (run to momma). */ current_backend = backends[0]; servicereport->last_backend = current_backend; msg ("Service %s: " "chosen backend (roundrobin, without historical info): %d", activeservice->name, current_backend); + free (backends); return; case ds_random: @@ -125,6 +129,8 @@ void choose_backend () { # endif /* First of all let's see if all the weights are the same. */ + values = xmalloc (nbackends * sizeof(double)); + weights = xmalloc (nbackends * sizeof(int)); tot_weights = 0; for (i = 0; i < nbackends; i++) { values[i] = activeservice->backend[backends[i]].weight; @@ -207,6 +213,9 @@ void choose_backend () { msg ("Service %s: " "chosen backend (weighted random): %d at index %d", activeservice->name, current_backend, i); + free (backends); + free (values); + free (weights); return; } @@ -215,10 +224,13 @@ void choose_backend () { servicereport->last_backend = current_backend; msg ("Service %s: chosen backend (flat-weight random): %d", activeservice->name, current_backend); + free (backends); + free (values); return; case ds_bysize: /* Fill the values */ + values = xmalloc (nbackends * sizeof(double)); for (i = 0; i < nbackends; i++) { /* When dispatch over #-connections is in place, then we * compute using the averaged value. However if the averaged @@ -254,10 +266,13 @@ void choose_backend () { } msg ("Service %s: chosen backend (by size): %d", activeservice->name, current_backend); + free (backends); + free (values); return; case ds_byduration: /* Fill the values */ + values = xmalloc (nbackends * sizeof(double)); for (i = 0; i < nbackends; i++) { /* When dispatch over #-connections is in place, then we * compute using the averaged value. However if the averaged @@ -292,6 +307,8 @@ void choose_backend () { } msg ("Service %s: chosen backend (by duration): %d", activeservice->name, current_backend); + free (backends); + free (values); return; case ds_byorder: @@ -300,12 +317,14 @@ void choose_backend () { servicereport->last_backend = current_backend; msg ("Service %s: chosen backend (by order): %d", activeservice->name, current_backend); + free (backends); return; case ds_byconnections: case ds_byclientip: /* Note: this serves byconnections dispatching, plus byclientip * when the actual back end has gone down. */ + values = xmalloc (nbackends * sizeof(double)); for (i = 0; i < nbackends; i++) { values[i] = servicereport->backendstate[backends[i]].nclients * @@ -326,6 +345,8 @@ void choose_backend () { } msg ("Service %s: chosen backend (by connections): %d", activeservice->name, current_backend); + free (backends); + free (values); return; case ds_externalhandler: @@ -340,6 +361,7 @@ void choose_backend () { current_backend = backends[0]; servicereport->last_backend = current_backend; uid_restore(); + free (backends); return; } while (1) { @@ -360,6 +382,7 @@ void choose_backend () { servicereport->last_backend = current_backend; pclose (f); uid_restore(); + free (backends); return; } } @@ -367,6 +390,7 @@ void choose_backend () { "a selectable back end", activeservice->name); current_backend = backends[0]; servicereport->last_backend = current_backend; + free (backends); return; default: diff --git a/src/lib/configread.c b/src/lib/configread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/configtest.c b/src/lib/configtest.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/configwrite.c b/src/lib/configwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/copysockets.c b/src/lib/copysockets.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/createcommandlinespace.c b/src/lib/createcommandlinespace.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/data.c b/src/lib/data.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -18,11 +18,11 @@ int tcp_bufsz = DEFAULT_TCP_BUFSZ; StateStringMap statestringmap[] = { { st_available, "available" }, { st_available, "up" }, - { st_unavailable, "UNAVAILABLE" }, - { st_down, "DOWN" }, - { st_waking, "WAKING" }, - { st_intermediate, "INTERMEDIATE" }, - { st_unknown, "UNKNOWN" }, + { st_unavailable, "unavailable" }, + { st_down, "down" }, + { st_waking, "waking" }, + { st_intermediate, "intermediate" }, + { st_unknown, "unknown" }, { st_unknown, 0 } }; diff --git a/src/lib/deallocreporter.c b/src/lib/deallocreporter.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/decrclientcount.c b/src/lib/decrclientcount.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/dns.c b/src/lib/dns.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/error.c b/src/lib/error.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/forktcpservicer.c b/src/lib/forktcpservicer.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/hashpjw.c b/src/lib/hashpjw.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpcopy.c b/src/lib/httpcopy.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httperror.c b/src/lib/httperror.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderaddheader.c b/src/lib/httpheaderaddheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderappendheader.c b/src/lib/httpheaderappendheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderconnectiontype.c b/src/lib/httpheaderconnectiontype.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderfree.c b/src/lib/httpheaderfree.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderhascookie.c b/src/lib/httpheaderhascookie.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderhttpver.c b/src/lib/httpheaderhttpver.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheadernew.c b/src/lib/httpheadernew.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderread.c b/src/lib/httpheaderread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderremoveheader.c b/src/lib/httpheaderremoveheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheadersetheader.c b/src/lib/httpheadersetheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderval.c b/src/lib/httpheaderval.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderwrite.c b/src/lib/httpheaderwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpinsertheader.c b/src/lib/httpinsertheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpserve.c b/src/lib/httpserve.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpserversocket.c b/src/lib/httpserversocket.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpwrite.c b/src/lib/httpwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/incrclientcount.c b/src/lib/incrclientcount.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/initsockaddr.c b/src/lib/initsockaddr.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/interrupt.c b/src/lib/interrupt.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfaddallow.c b/src/lib/ipfaddallow.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfadddeny.c b/src/lib/ipfadddeny.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfallowed.c b/src/lib/ipfallowed.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfdenied.c b/src/lib/ipfdenied.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfloadfile.c b/src/lib/ipfloadfile.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfmatch.c b/src/lib/ipfmatch.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfparse.c b/src/lib/ipfparse.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ishexdigit.c b/src/lib/ishexdigit.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/isspace.c b/src/lib/isspace.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/lexer.c b/src/lib/lexer.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/lockreporter.c b/src/lib/lockreporter.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivityany.c b/src/lib/logactivityany.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivitycontinuation.c b/src/lib/logactivitycontinuation.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivityend.c b/src/lib/logactivityend.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivitystart.c b/src/lib/logactivitystart.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/makesocket.c b/src/lib/makesocket.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/markactivity.c b/src/lib/markactivity.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/msg.c b/src/lib/msg.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/msgdumpbuf.c b/src/lib/msgdumpbuf.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netbuffer.c b/src/lib/netbuffer.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netbufread.c b/src/lib/netbufread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netcopy.c b/src/lib/netcopy.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netread.c b/src/lib/netread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netwrite.c b/src/lib/netwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parser.c b/src/lib/parser.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserclose.c b/src/lib/parserclose.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserfilename.c b/src/lib/parserfilename.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserinput.c b/src/lib/parserinput.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parseropen.c b/src/lib/parseropen.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserrun.c b/src/lib/parserrun.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserskipchar.c b/src/lib/parserskipchar.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserskipline.c b/src/lib/parserskipline.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/restart.c b/src/lib/restart.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/runservice.c b/src/lib/runservice.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/serve.c b/src/lib/serve.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/setproctitle.c b/src/lib/setproctitle.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/showconfig.c b/src/lib/showconfig.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -17,8 +17,7 @@ void show_config () { "MAINTAINERNAME maintainer: %s\n" "MAINTAINEREMAIL e-mail of maintainer: %s\n" "DEFAULT_CONF default configuration file: %s\n" - "MAX_BACKEND max nr. of backends in service: %d\n" - "FQDN_LENGTH max length of a hostname %d\n" + "FQDN_LENGTH max length of a hostname: %d\n" "SLEEP_TIME service inactivy pause: %d\n" "DEF_MAX max nr of defines in a file %d\n" "DNS_CACHESIZE size of the DNS cache: %d\n" @@ -36,7 +35,7 @@ void show_config () { , VER, REVVER, YEARS, AUTHORNAME, MAINTAINERNAME, MAINTAINEREMAIL, - DEFAULT_CONF, MAX_BACKEND, FQDN_LENGTH, SLEEP_TIME, DEF_MAX, + DEFAULT_CONF, FQDN_LENGTH, SLEEP_TIME, DEF_MAX, DNS_CACHESIZE, DNS_CACHETTL, CONNECT_TIMEOUT, RETRY_WAIT, DEFAULT_TCP_BUFSZ, PREFIX, BINDIR, DEFAULT_SPT_BUFSIZE, SPT_BUFSIZE, diff --git a/src/lib/showservices.c b/src/lib/showservices.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/showstatus.c b/src/lib/showstatus.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -58,6 +58,7 @@ static char *bytestr (double nbytes) { int show_status (int ac, char **av) { int i, j, services_shown = 0; unsigned sec_ago; + int state_count[NR_OF_STATES]; if (xml_status) { printf ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); @@ -79,15 +80,27 @@ int show_status (int ac, char **av) { alloc_reporter (service + i, 0); msg ("Reporting service %s (pid = %d)", service[i].name, servicereport->pid); + + /* Count the back ends by their state. */ + for (j = 0; j < NR_OF_STATES; j++) + state_count[j] = 0; + for (j = 0; j < service[i].nbackend; j++) + state_count[servicereport->backendstate[j].actual_avail]++; + if (tabular_status) printf ("%s ", service[i].name); - else if (xml_status) + else if (xml_status) { printf (" <service id=\"%d\" name=\"%s\">\n" " <connections>%d</connections>\n" " <lastbackend>%d</lastbackend>\n", i, service[i].name, servicereport->nclients, servicereport->last_backend); - else + for (j = 0; j < NR_OF_STATES; j++) + printf (" <backends_%s>%d</backends_%s>\n", + state_to_string ( (Backendavail)j ), + state_count[j], + state_to_string ( (Backendavail)j )); + } else printf ("Service : %s, %d live connections, " "last backend %d\n", service[i].name, servicereport->nclients, diff --git a/src/lib/stagetostring.c b/src/lib/stagetostring.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/statetostring.c b/src/lib/statetostring.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -12,5 +12,5 @@ char *state_to_string (Backendavail avail) { for (i = 0; statestringmap[i].nm; i++) if (avail == statestringmap[i].av) return (statestringmap[i].nm); - return ("UNKNOWN-STATE"); + return ("UNKNOWN"); } diff --git a/src/lib/stopdaemon.c b/src/lib/stopdaemon.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strcasestr.c b/src/lib/strcasestr.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strexpandformat.c b/src/lib/strexpandformat.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/stringtostate.c b/src/lib/stringtostate.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strlcat.c b/src/lib/strlcat.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strprintf.c b/src/lib/strprintf.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strupr.c b/src/lib/strupr.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strvprintf.c b/src/lib/strvprintf.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtabend.c b/src/lib/symtabend.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtablookup.c b/src/lib/symtablookup.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtabset.c b/src/lib/symtabset.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtabstart.c b/src/lib/symtabstart.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/sysrun.c b/src/lib/sysrun.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/tcpserve.c b/src/lib/tcpserve.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/tellservice.c b/src/lib/tellservice.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/thruputlog.c b/src/lib/thruputlog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/trafficlog.c b/src/lib/trafficlog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/uidassume.c b/src/lib/uidassume.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/uidrestore.c b/src/lib/uidrestore.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/unlockreporter.c b/src/lib/unlockreporter.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/usage.c b/src/lib/usage.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/vsyslog.c b/src/lib/vsyslog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/wakeuphandler.c b/src/lib/wakeuphandler.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/warning.c b/src/lib/warning.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/writelog.c b/src/lib/writelog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xcalloc.c b/src/lib/xcalloc.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xmalloc.c b/src/lib/xmalloc.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xrealloc.c b/src/lib/xrealloc.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xstrcat.c b/src/lib/xstrcat.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xstrcatch.c b/src/lib/xstrcatch.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xstrdup.c b/src/lib/xstrdup.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.50, a load balancer and fail over + * This file is part of Crosroads 1.51, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/test/Makefile b/test/Makefile @@ -4,12 +4,13 @@ foo: @for f in t*.conf ; do \ echo "Testing $$f: should succeed" ; \ ../src/crossroads/crossroads -vc $$f services || exit 1 ; \ + echo "$$f succeeded, good." ; \ echo ; \ done @for f in bad*.conf ; do \ echo "Testing $$f: should fail" ; \ ../src/crossroads/crossroads -vc $$f services && exit 1 ; \ - true ; \ + echo "$$f failed, good." ; \ echo ; \ done @echo