Separating WebUI Hosting from Services
Separating WebUI Hosting from Services
When you install iDempiere on a single server, the application server supports two duties: (1) WebUI server and (2) Services server. The purpose of this section is to help you support growth beyond 100 concurrent users by separating these duties onto two or more different servers.
The WebUI is what you see when you use iDempiere's web client. Services includes the processes that are needed to support the behind-the-scenes iDempiere operations. The most recognizable service is the accounting engine.
As you approach or cross the 100 concurrent user threshold, the application becomes a significant single point of failure. You can minimize risk by spreading the WebUI load across multiple servers. Before you can create multiple WebUI servers, you must first isolate the services server.
The below instructions only apply to iDempiere. To isolate services to a single server, perform the following:
- Log in as System Administrator role
- Open the Schedule window
- Look for the field named "Run Only on IP". Add the IP of the machine that will be solely responsible for running services. If you are running in a AWS VPC or LAN, this IP will be your internal IP address.
- Reboot all your application servers.
Installation Script
When you install iDempiere with my installation script, you can also install a dedicated services instance using the -s option. A dedicated services instance is just another iDempiere server. The importing thing to note is that the database knows the IP of the services instance. Search the installation script for "if [[ $IS_SET_SERVICE_IP == "Y" ]]". This section tells you what statements get executed so that iDempiere knows what server to use for services.
Strategies for Modifying ADempiere's AdempiereServerMgr
This section only applies to ADempiere (not iDempiere).
The class you modify is AdempiereServerMgr.java. How you conditionally start (or not start) the services depends on your skill level. Here are some options:
- Add a System Configurator entry that specifies the IP of the server to run services. When AdempiereServerMgr.java goes to launch it checks if its IP is a match with System Configurator entry. If so, launch, else nothing.
- Add a new field in the database call ServicesIP. This field specifies the IP of the server to run the services. When AdempiereServerMgr.java goes to launch it checks if its IP is a match with ServiceIP. If so, launch, else nothing.
- You can add a specifically named text field or environment variable to the server. The AdempiereServerMgr.java looks for this text file/variable to see if it is OK to start services.
- Have two different versions of the code. One for the services server. One for the load balanced servers.
I would recommend you reach out to Deepak if you want someone to code this for you. If you do implement this change, please email me the class as a reference implementation for the class.