Problems When Using the Message Server for HTTP Load Balancing From the Portal
I want to use this blog to highlight a configuration issue which has caused quite a number of support messages to reach us on the Enterprise Portal team. That is the use of the Message Server to load-balance requests to ABAP-based web applications (BSPs, WebDynpros, IACS) accessed via the Portal.
When you create a system object in the Portal, it’s common to select the template ‘SAP system with load balancing’ to do so. This template exposes the ‘Message Server’ property under the ‘Connector’ properties set, instead of the ‘Application Server’ property which is used for the ‘SAP system using dedicated application server’ template. However, the Message Server should only be used to load-balance RFC and DIAG (SAPGUI) requests in a portal scenario. The difficulties arise when the Message Server host and HTTP/HTTPS port are entered in the ‘Web AS Host Name’ or ‘ITS Host Name’ properties of the system object, and the Message Server is then used also for accessing web applications. The problems which could occur as a result include:
- Sessions not being closed on the backend and locking of records
- ‘Session timeout’ or ‘session not existing’ error messages
Another set of issues stem from an issue with the way in which the Message Server may (depending on its version and configuration) redirect requests to specific application servers. Specifically, the Message Server redirects the requests using a HTTP 301 (Moved Permanently) response, and as a result the browser issues a GET request to the target URL. If the original request to the Message Server was a POST request, all POST parameters are consequently lost from the GET request. As this issue results in the loss of all the application parameters which should be used to launch the application, the consequences for end users can be severe and wide-ranging. I’ve encountered symptoms such as the following:
- Transaction iviews launch on the easy access menu (or whatever the system logon transaction is) instead of the transaction specified in the iView properties
- ABAP WebDynpro applications produce a dump due to missing parameters
- BW Report iviews load ’empty’ (there is a BW-specific note on this: Note 972514 ‘Empty BEx Web Analyzer instead of BEx Broadcaster’)
- The application is rendered without the portal theme
The solution to the loss of POST parameters in the course of the 301 redirect is described in Note 1055324 ‘POST parameters lost during redirect’ and Note 857596 ‘Message server: Status code for redirect requests’ – basically set parameter ms/redirect_version to 1, so that 302 or 307 redirects are used instead. However, in the portal scenario, instead of (or as well as) applying Note 1055324 to address these second group of issues, it’s recommended to use the Web Dispatcher instead of the Message Server to load-balance the HTTP/HTTPS requests – so that you don’t run up against the first set of issues instead. Simply put, use of the Message Server is not recommended for portal scenarios – instead, you are recommended to use the SAP Web Dispatcher, which is SAP’s fully featured HTTP load balancer solution.
You can refer to Note 1040325 ‘HTTP load balancing: Message Server or Web Dispatcher’ for a very clear statement on the use of the Message Server in load balancing:
‘However, the following restrictions apply in the case of HTTP load balancing with the message server: […] This option is not possible if you use stateful applications from within the portal.’
These restrictions are also mentioned in the Help Topic ‘HTTP Load Distribution Using SAP Message Server’:
‘Caution: You can use HTTP load balancing on the SAP Message Server for stateless applications only. For stateful Web applications with a state in the back end (such as BSP applications), you require the Web Dispatcher.
Caution: You can only use the SAP message server for HTTP load distribution if the browser is the direct client of the message server. If another component lies between the client (browser) and the message server, (for example, the portal), you cannot use the message server to distribute the load.’
In brief, to avoid the issues described earlier in the blog, we recommend that you set up the Web Dispatcher to balance the HTTP load to your backend system and update your Portal system object accordingly (specifically, the ‘Web AS Host Name’ and ‘ITS Host Name’ parameters should point to the host:port of your Web Dispatcher, not your Message Server).
As is clear from my references, this blog covers a topic which is already documented in SAP Help and SAP Notes. But, the existence of many support messages around this topic suggests that there is still scope for confusion around this configuration, so I hope this blog can prevent someone else from ‘coming a cropper’ on it.