Configure the Apache server for proxy load balancing
- Last Updated: August 18, 2021
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
Configuring an Apache HTTP Server to implement load balancing involves updating the
apache_install_dir/conf/httpd.conf file
to:
- Specify the proxy modules to load
- Reference the PAS for OpenEdge instances
- Enable or disable sticky sessions
Loading proxy modules
Proxy modules set up the Apache web server as a proxy to handle requests to
multiple PAS for OpenEdge instances. The modules are loaded by un-commenting LoadModule directives in the httpd.conf file of the Apache web server. The LoadModule directives include:
LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_connect_module modules/mod_proxy_connect.soLoadModule proxy_http_module modules/mod_proxy_http.soLoadModule slotmem_shm_module modules/mod_slotmem_shm.soLoadModule bmethod_byrequests_module modules/mod_lbmethod_byrequests.so
Referencing instances and configuring session types
Update Apache’s httpd.conf file to include a load balancer section that lists the PAS for OpenEdge instances in the load balancing group. This can be configured two different ways:
- Session free — any request can be sent to any PAS for OpenEdge instance.
- Sticky session — once a session is started all requests return to the same PAS for OpenEdge instance until the session is terminated.
If there is no need for client requests to return the the same PAS for OpenEdge
instance (i.e. maintaining server-side context is not required), your entries in
httpd.conf should resemble the following example:
|
Notice that, in the example above, the instances where Apache can refer requests are
grouped as //mylbgroup and the URL of these instances (the
BalancerMember properties) are specified.
If it is necessary for sequential requests to go to the same instance, as they
are for the APSV transport, you enable sticky sessions by adding a route property to BalancerMember and by enabling JSESSIONID cookies. For example:
|
In the example above notice that:
- The
routeproperty must match thejvmroutevalue in the server.xml file of the instance. - The
stickysessionproperty enables the JSESSIONID cookie, which is the mechanism used to identify the session.Note: Sticky sessions are required for the APSV transport, but not for WEB, REST, or SOAP.
httpd.conf file, see the Apache web site (http://httpd.apache.org/) for documentation on your version of the Apache server.