Friday, May 27, 2011

LoadBalancing Windchill Cluster with Pen

This is my first technical topic. Through all my technical topics I am trying to concentrate on those technical issues related to Windchill for which you might not get a direct support. These topic are purely based on the experience I had. You, the reader may be surely having other observations and experience and I would welcome you to post a reply to the topic so that we share knowledge

Terms I am using LB – Load Balancer

In a Cluster most of the systems are configured to work with hardware LBs. But there are cases when we have to select a software LB. Most engineers turn towards Apache while doing it. When implementing Apache we had to do some extra work encountered some issues which shifted my mind from Apache. One of the things is when working on a Unix environment its not an easy job to share a partition over machines. This needs to be done since if Apache is the load balancer it needs the static files of the Application accessible locally. We need to spend extra space on pasting the files on LB. Secondly on Apache 2.2 setting the AJP worker to balance the load it does balance the load but it does it wrong. Every other page hit is sent to another slave. In short, it is unable to maintain the sticky sessions. This is a very critical issue.

So we went out to the open source market to check if there were any other options for load balancing through softwares. We discovered Pen. Pen is a load balancer which is pretty good at maintaining the sticky sessions. It also maintains a history of client for past 2048 hits to the server and redirects the client to same slave in case the client revisits. Hold on, don’t think about too much since can get rid of the history.

Pen does not take too much of space at all neither a lot memory. It load balances the HTTPS protocol unlike most of us when using Apache configure AJP workers to load balance that is in practice.

Where do you download Pen?

http://siag.nu/pen

Download the zip file , un-tar it and follow the below procedure to install

$export PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin

In the above line I have added sfw/bin and ccs/bin to include gcc and make in the path, make sure you have the respective path on your machine

$cd /usr/ptc/Windchill_9.1/

$./configure

$make

Once done, you will have pen install and you will be able to see all the necessary files.

Ok now there is nothing much to configure after we install. Below is pretty much the command you need your LB to kick off.

$ sudo ./pen lbhost:80 slave1:80 slave2:80

Examples

$sudo ./pen 146.123.123.1:80 146.123.123.2:80 146.123.123.3:80

$ sudo ./pen 146.123.123.1:443 146.123.123.2:443 146.123.123.3:443

This will get started your load balancer working.

As we discussed earlier that Pen maintains a history of past 2048 clients and redirects them to the slave by looking up in the history. If that is acceptable to you then it is fine since the clients are as it is equally distributed. In some case it might happen that clients that are mapped to one slave are high in number and that slave might get overloaded.

Also Pen keeps a watch on the slave to see if they are available. If not it will redirect the client to the live slave.

The solution to that is pretty straight forward. You reduce the table size down to any number between 1 to 5. By doing so the server will redirect the upcoming clients alternately. It won’t mess up the load balancing activity here since it also simultaneously monitors the hit ratio to the slaves.

To achieve this configuration you need to add the –c option in the startup command

$ sudo ./pen c 1 lbhost:80 slave1:80 slave2:80

Examples

$sudo ./pen c 1 146.123.123.1:80 146.123.123.2:80 146.123.123.3:80

$ sudo ./pen c 1 146.123.123.1:443 146.123.123.2:443 146.123.123.3:443

Now these are some basic configurations I have given that you will need. There are other options that you can check our on its website and use accordingly, which is best for your cluster.

1 comment: