Saturday, January 31, 2009

SAP - Configuring Load Balancing

In SAP if you have more than 1 application server, ex. central instance and dialog instance, load balancing can be applied. SAP has given this function using transaction code SMLG. Load balancing can be made by defined logon group. Logon group can be grouped based on user group. If you have several user groups (FI , HR, MM user groups, for example) you can arrange them so the FI and MM user will be assigned to application server A and the HR user will be assigned to application server B. This method will give a chance to tune your application server properly and will leave you free to make memory and buffer adjustment.

To get the more benefit from this setup, you have to do the buffer hit ratio analysis/DB table and index access analysis (per user group).

From application server side, below the steps you can follow to create a new logon group:
1. Run transaction code SMLG
2. Create a new assignment and specify the desire name of the logon group name. Enter the desired instance that belongs to this logon group.
3. Repeat the last step until you have entered the all instance that belongs to the logon group.
4. Save your changes.

From user side, you can follow below step to ensure that you can connect using load balancing:
1. Open file services under drive:\windows\system32\drivers\etc
2. Add new service in the last row with the format
sapms(SID) port_number (3299)/tcp
3. Activate the new service by enter this command in cmd
services restart
4. Open your SAP GUI and create new item. Select Group/Server connection in the connection type. Enter your message server name or the IP address and system ID.
5. In the Group/Server field select your logon group.
6. Save the changes and try to connect to your message server.

If your logon group does not appear or can not make a connection to the application server, you have to check your entered-service in the file services. If everything is ok, you can do some tricks as describe below:
1. Give enter after you enter the service name
2. If trick number 1 does not success, you can create a new file in same directory with sapgui.ini and name it as sapmsg.ini. You type this command in the file:
SID = host name on which your message server is running