Performance Tuning of the BW Engine

1.  Using variables in XPath to reduce the scanning depth everytime

In the example where we are calculating the Shipping Costs(shipping_costs), we know that Shipping Costs(shipping_costs) depends upon 2 factors. It depends on the Total Order Price(total_order_price) & Destination(destination) to where the shipping is done.

We need to write the XPath statement at the end activity in order to calculate the shipping_costs. But for that, every time the total_order_price is taken from the start activity and so as the value of destination. In this example, we have only two such entities, but we may have many entities and their depth in the XML structure can vary. In order to improve the performance of the BW Engine, we can create the variables which store the value in the activity input only and can be reused at will. This will improve the performance of the BW Engine.

So how do we do that? We need to select the ‘+’ sign which is located in the Activity Input side and near to the ‘X’ sign. Select the + sign as shown in the figure.

When we click the ‘+’ sign, the below screen appears.

Select variable as Statement Type as shown below. Give the appropriate variable name and press OK

In this case, we use two variables, var & var2 which should be mapped to the destination & total_order_price. This is shown as below

Now use these variables in the XPath statement of shipping_costs. This is shown as below.

2.  Checkpoints

Checkpoints can be stored on the disk in the files or in the database. When the checkpoint storage is in the files, it would be found in the ‘jdb’ directory. We can configure the checkpoints in the database through the TIBCO Administrator. It is recommended that the checkpoints should be stored in the database. But when using the database, there is an overhead of database calls.

In order to improve the performance of the checkpoints while using the database, you can go for an option of an in-memory database such as an Oracle TimesTen database and reduce the overhead of the database calls.

3.  Use XSLT statements instead of using groups

XSLT statements give you a better performance over using the groups.

4.  Using the non-blocking activities instead of the blocking activities

There are two types of activities in BusinessWorks. They can either be blocking or non- blocking activities. This is determined based on how the activity functions with the thread. Blocking activities are activities that are executed using the engine thread. This type of activity may affect the engine's performance because if this activity is waiting for an event then the engine thread will also be waiting for the activity to resume from its waiting state. Non-blocking activities are activities that are executed using a private thread. This kind of activity does not affect the engine's performance because when the activity is processing, it switches to its own private thread. When it is done with its process, it will be fetched by the engine thread that is currently running.

5.  Selecting between HTTP & JMS as the preferred web service transport

When we select HTTP as a transport, we can improve its performance by using the persistent connection manager (PCM) pool. Now, what do you mean by a PCM. HTTP, by default, is a stateless protocol. So, when a HTTP connection is requested by a user, the user uses the connection for certain duration and then would release the connection. Even if the same user would want the same connection, there is no way that the connection is persisted. A new connection is given to the user. Creating a connection for every user is an overhead. The solution would be to persist some HTTP connections, so that once a user would request for a connection, it is readily available and it would not have to be created every time and hence reduces an overhead. These connections are stored in the PCM pool.

TO BE CONTINUED