
SAP offers its SAP Web Dispatcher as an out-of-the-box solution for HTTP/HTTPS load balancing in SAP NetWeaver Application Server landscapes. Configuring the Web Dispatcher is very easy, as the configuration information can be retrieved from the system.
In order to enable automatic and dynamic configuration also with third party (hardware) load balancing solutions, this documentation reveals the detailed specification of an SAP web service providing the application server list which is also used by the Web dispatcher.
Caution
Note that certain aspects of the complex SAP request routing logic such as the between URLs and SAP Logon Groups cannot be simply mapped onto a standard web switch configuration.
Therefore, this documentation will focus on the basic load balancing of HTTP requests. This load balancing can be performed for stateless requests as well as for the first request of a stateful session. All subsequent request belonging to this session have to be directed to the same application server.
This document does not cover concepts how the stickiness of a request is enabled.
Note
Knowledge of the NetWeaver application server architecture as well as concepts and basic settings of the SAP Web Dispatcher helps to understand this documentation. You find a reference to the documentation at the end of this document.
In order to perform load balancing, the SAP Web Dispatcher periodically fetches a list of all active application servers of an SAP system from its message server. This list includes the host names as well as a static value indicating the capacity of each server (see below). This capacity is separated by stacks, i.e. a dual-stack instance has an ABAP capacity and a Java capacity.
Servers will be dynamically added and removed from the list whenever the SAP message server detects a new server starting up or a running server shutting down (or crashing), respectively. However, since a load balancer would only update the list periodically (e.g. every several minutes), it is recommended that a load-balancing device removes crashed servers from the list immediately.
The application server list is fetched via HTTP from the message server, which is the one central component of each SAP System that routes internal messages among application servers and is thus informed about the current status of each server.
The specification is valid for all SAP products based application server release 6.20 upwards with SAP kernel 6.40 upwards
The capacity value is an estimate of the servers' strength. Currently, the heuristic used by the SAP system determines the static capacity values as follows:
AS ABAP: number of dialog processes of the instance.
AS Java: number of Java server processes.
Caution
This heuristic may be changed by SAP without further notice.
The network host name and HTTP port of the message server is configured via SAP configuration parameters rdisp/mshost in the default profile and ms/http_port in the profile of the message server.
For simplicity and performance, a plain text format is used in the HTTP message body to describe the server list as a set of server description records (separated by empty lines) as follows (CRLF denotes the Control/LineFeed as end-of-line indicator).
Load balancing for a single-stack system (ABAP only or Java only) is much easier than for a dual-stack system, as the request type is clear. If you want to do load balancing for a dual-stack system, the following prerequisites must be met:
The system is homogeneous, i.e. all instances contain AS ABAP and AS Java.
Note
In case that two message servers are configured (one for ABAP, one for Java), the information has to be retrieved from the ABAP message server.
Before a request is dispatched to a server, the load balancer checks that both stacks are available in the application server list.
The body of the HTTP response message is structured according to the following syntax.
Syntax
<server-list> = "version" <major>"."<minor> CRLF
<sap-server-name> CRLF
<protocol-type> <host> <port> <description> CRLF
...
<protocol-type> <host> <port> <description> CRLF
CRLF
<sap-server-name> CRLF
<protocol-type> <host> <port> <description> CRLF
...
<protocol-type> <host> <port> <description> CRLF
CRLF stands for “carriage return line feed” (new line).
The following table explains the possible values for the variables. Examples are given below.
Caution
The following explanations refer to version 1.2.
You get the application server list version 1.2 from the message server (release 6.40 onwards) with the following HTTP request:
http://<msg_server_host>:<msg_server_port>/msgserver/text/logon?version=1.2
In the first line of the response you see the version number.
Note
You can also use HTTPS to retrieve the data from the message server. To do this, the message server has to be configured for HTTPS. See the documentation links at the end of the document for further information.
Variable |
Value |
Description |
|
|---|---|---|---|
<major>.<minor> |
two numbers separated by a period |
Typical version description: the first number denotes the major version, the second number the minor version. We use version 1.2 in the following. |
|
<sap-server-name> |
character string |
Instance name.
Don't use these strings to get information about the server, the information is contained in the lines below. The instance name can be an opaque sting, if hash-encryption is configured with the profile parameter is/instname_encoding in the system profile DEFAULT.PFL. In the default setting, the parameter has the value none which means instance names are transferred in clear text. End of the note. |
|
<protocol-type> |
AS ABAP |
HTTP |
Server has an HTTP port configured in the ICM. |
HTTPS |
Server has an HTTPS port configured in the ICM. |
||
DIAG |
Server has dialog work processes; this line contains the LB capacity of the AS ABAP. |
||
... |
Other values may be listed here: RFC, RFCS, SMTP among others. These protocols are not relevant for load balancing. |
||
AS Java |
J2EE |
AS Java is active and HTTP port is configured. |
|
J2EES |
AS Java is active and SSL-anabled. HTTPS port is configured. |
||
... |
Other values may be listed here: P4, P4S, IIOP, IIOPS among others. These protocols are not relevant for load balancing. |
||
<host> |
character string |
host name |
|
<port> |
number |
port number |
|
<description> |
character string |
The following strings are possible:
|
|
The following example shows the application server list of a Java-only system with two instances.
Syntax
version 1.2
J2EE187834720
J2EE ld8060.wdf.sap.corp 51800 LB=2
J2EES ld8060.wdf.sap.corp 51801 LB=2
P4 ld8060.wdf.sap.corp 51804 LB=2
P4S ld8060.wdf.sap.corp 51805 LB=2
IIOP ld8060.wdf.sap.corp 51806 LB=2
IIOPS ld8060.wdf.sap.corp 51807 LB=2
TELNET ld8060.wdf.sap.corp 51808 LB=2
J2EE507834720
J2EE ld8060.wdf.sap.corp 55000 LB=1
P4 ld8060.wdf.sap.corp 55004 LB=1
IIOP ld8060.wdf.sap.corp 55007 LB=1
TELNET ld8060.wdf.sap.corp 55008 LB=1
Here, two AS Java instances are configured on one physical host. One of them is SSL-enabled and offers ports for all protocols. The instance J2EE187834720 has double capacity (two Java server processes active) and thus gets twice as many requests (as far as the requests are stateless) from the Web Dispatcher as the other instance J2EE507834720.
Syntax
version 1.2
WDFD00146517A_BIN_53
DIAG WDFD00146517A 3253 LB=3
RFC WDFD00146517A 3353
HTTP WDFD00146517A 1080
SMTP WDFD00146517A 8025
HTTP WDFD00146517A 1080 VHOST=0
SMTP WDFD00146517A 8025 VHOST=0
ld8060_BIN_12
DIAG ld8060.wdf.sap.corp 3212 LB=7
RFC ld8060.wdf.sap.corp 3312
HTTP ld8060.wdf.sap.corp 8888
SMTP ld8060.wdf.sap.corp 2500
HTTP ld8060.wdf.sap.corp 8888 VHOST=0
SMTP ld8060.wdf.sap.corp 2500 VHOST=0
pwdf2310_BIN_53
DIAG pwdf2310.wdf.sap.corp 3253 LB=10
DIAGS pwdf2310.wdf.sap.corp 3253 p/secude:CN=BIN, O=SAP-AG, C=DE
RFC pwdf2310.wdf.sap.corp 3353
RFCS pwdf2310.wdf.sap.corp 4853 p/secude:CN=BIN, O=SAP-AG, C=DE
HTTP pwdf2310.wdf.sap.corp 8080
HTTPS pwdf2310.wdf.sap.corp 8443
SMTP pwdf2310.wdf.sap.corp 25053
HTTP pwdf2310.wdf.sap.corp 8080 VHOST=0
HTTPS pwdf2310.wdf.sap.corp 8443 VHOST=0
SMTP pwdf2310.wdf.sap.corp 25053 VHOST=0
Here, three AS ABAP instances are configured on different hosts. They have different capacities and protocols.
The information needed for a load balancer is the capacity in the first line and the ports for HTTP and HTTPS..
Syntax
version 1.2
us4251_BCO_27
DIAG us4251 3227 LB=8
RFC us4251 3327
HTTP us4251.wdf.sap.corp 50027
HTTPS us4251.wdf.sap.corp 44327
SMTP us4251.wdf.sap.corp 25027
J2EE us4251.wdf.sap.corp 50027 LB=1
J2EES us4251.wdf.sap.corp 44327 LB=1
P4 us4251.wdf.sap.corp 52704 LB=1
IIOP us4251.wdf.sap.corp 52707 LB=1
TELNET us4251.wdf.sap.corp 52708 LB=1
HTTP us4251.wdf.sap.corp 52700 VHOST=0
HTTPS us4251.wdf.sap.corp 44327 VHOST=0
SMTP us4251.wdf.sap.corp 25027 VHOST=0
bcomain_BCO_27
DIAG bcomain 3227 LB=20
RFC bcomain 3327
HTTP bcomain.wdf.sap.corp 52700
HTTPS bcomain.wdf.sap.corp 44327
SMTP bcomain.wdf.sap.corp 25027
J2EE bcomain.wdf.sap.corp 52700 LB=2
J2EES bcomain.wdf.sap.corp 44327 LB=2
P4 bcomain.wdf.sap.corp 52704 LB=2
P4S bcomain.wdf.sap.corp 52705 LB=2
IIOP bcomain.wdf.sap.corp 52707 LB=2
TELNET bcomain.wdf.sap.corp 52708 LB=2
HTTP bcomain.wdf.sap.corp 52700 VHOST=0
HTTPS bcomain.wdf.sap.corp 44327 VHOST=0
SMTP bcomain.wdf.sap.corp 25027 VHOST=0
This system has two instances providing ABAP and Java. The first one has ABAP capacity 8, Java capacity 1, whereas the second has 20 and 2. If you do load balancing for a dual-stack system, you can take one of the values as capacity or do a calculation.
SAP Web Dispatcher documentation on the Help Portal: http://help.sap.com/saphelp_nwce711/helpdata/en/42/5cfd3b0e59774ee10000000a114084/frameset.htm
Architecture of SAP NetWeaver Application Server 7.1: http://help.sap.com/saphelp_nwpi71/helpdata/en/84/54953fc405330ee10000000a114084/frameset.htm