Best Practices For Implementing WebSphere Extended Deployment
Best Practices For Implementing WebSphere Extended Deployment
Deploy long-running
applications in WebSphere
Carla Sadtler
David Buchanan
Naveen Deshwal
Tomonori Iwashina
Edward McCarthy
Hendrik Van Run
ibm.com/redbooks
International Technical Support Organization
February 2007
SG24-7343-00
Note: Before using this information and the product it supports, read the information in
“Notices” on page xi.
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
The team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Become a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Contents v
5.4 Configure the long-running execution environment. . . . . . . . . . . . . . . . . 179
5.4.1 Create the node group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.4.2 Create the database for LREE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.4.3 Create the data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
5.4.4 Create the LREE dynamic cluster . . . . . . . . . . . . . . . . . . . . . . . . . . 181
5.4.5 Enable the startup beans service on LREE application servers . . . 182
5.4.6 Configure the default_host virtual host alias . . . . . . . . . . . . . . . . . . 182
5.4.7 Install the LREE application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5.4.8 Configure LREE using setupLongRunning.py script . . . . . . . . . . . . 184
5.4.9 Verify the LREE application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5.5 Verify the environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5.5.1 Install the compute-intensive sample application . . . . . . . . . . . . . . 185
5.5.2 Test the compute-intensive sample application . . . . . . . . . . . . . . . 186
Contents vii
8.4 Compute-intensive application syntax in xJCL . . . . . . . . . . . . . . . . . . . . 298
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Contents ix
x Best Practices for Implementing WebSphere Extended Deployment
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult
your local IBM representative for information on the products and services currently available in your area.
Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product, program, or service that
does not infringe any IBM intellectual property right may be used instead. However, it is the user's
responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document.
The furnishing of this document does not give you any license to these patents. You can send license
inquiries, in writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer
of express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may
make improvements and/or changes in the product(s) and/or the program(s) described in this publication at
any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any
manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the
materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm
the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on
the capabilities of non-IBM products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them
as completely as possible, the examples include the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating platform for which the
sample programs are written. These examples have not been thoroughly tested under all conditions. IBM,
therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its
affiliates.
EJB, Java, JDBC, JDK, JVM, J2EE, and all Java-based trademarks are trademarks of Sun Microsystems,
Inc. in the United States, other countries, or both.
Excel, Internet Explorer, Microsoft, Windows Server, Windows, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
This book focuses on process, design, and usage guidelines, complimenting the
“how to” information found in Using WebSphere Extended Deployment V6.0 To
Build an On Demand Production Environment, SG24-7153. In addition, the
business grid (batch and compute-intensive) capabilities are covered extensively
including how to and best practice information.
Carla Sadtler is a certified IT Specialist at the ITSO, Raleigh Center. She writes
extensively about the WebSphere and Patterns for e-business areas. Before
joining the ITSO in 1985, Carla worked in the Raleigh branch office as a Program
Support Representative. She holds a degree in mathematics from the University
of North Carolina at Greensboro.
Hendrik Van Run is a Senior IT Specialist within the pan-IOT Software Lab
Services team in Hursley. He holds a Masters degree in Physics from Utrecht
University in the Netherlands. Hendrik has extensive experience in designing,
architecting, and reviewing corporate J2EE™ infrastructure, usually based on
WebSphere technology. He advised many of the IBM enterprise customers on
issues such as high availability, performance, and queuing problems across the
WebSphere Application Server product families. Prior to joining the pan-IOT
Software Lab Services team, Hendrik worked for IBM Global Services in the
Netherlands. He has worked with WebSphere Application Server since Version
3.5 and is co-author of the redbook called IBM WebSphere V5.0 Performance,
Scalability, and High Availability, SG24-6198-00.
Suzanne Dewitt
IBM US
Ann Black
IBM US
Snehal Antani
IBM US
Billy Newport
IBM US
Christopher Vignola
IBM US
Aditya A Desai
IBM US
Brian K Martin
IBM US
Keith B Smith
IBM US
Sajan Sankaran
IBM US
Joshua Dettinger
IBM US
Gary Miller
IBM US
George Bonifant
IBM US
Preface xv
Figure 1 Authors (left to right): Edward McCarthy, Tomonori Iwashina, Carla Sadtler, Hendrik Van Run,
Naveen Deshwal. Not pictured: David Buchanan
Your efforts will help increase product acceptance and customer satisfaction. As
a bonus, you will develop a network of contacts in IBM development labs, and
increase your productivity and marketability.
Find out more about the residency program, browse the residency index, and
apply online at the following Web site:
ibm.com/redbooks/residencies.html
Preface xvii
xviii Best Practices for Implementing WebSphere Extended Deployment
Part 1
Part 1 Operations
optimization
WebSphere Extended Deployment provides features that can help simplify
management of complex environments while optimizing existing resources.
If any of the following apply to your situation, you should consider service level
optimization:
You have service level objectives but meeting them requires manual,
complex system management to be performed.
You need a better way to guarantee certain application performance
levels.
You have to deliver consistent response times to external applications to
ensure customer and business partner satisfaction.
You want to deliver the best possible response times to internal users but
without compromising the performance of critical externally facing
transactions.
Your applications must be highly available but you do not want to duplicate
everything.
You often need to deploy new applications and want help placing them on
servers for optimum performance.
However it is also not uncommon for a business area to over-estimate how much
their application is going to be used. The end result is that they double the
expected load they think they will get to ensure they get more than enough
capacity.
The more this happens, the more often the end result is a large server farm with
more capacity than is actually required to run the total business workload. This
results in the organization paying for much more expensive hardware and
software then it needs.
The characteristic of these static environments is that they are not making the
best use of the overall capacity and the configuration in terms of numbers of
servers. Additionally these environments cannot quickly respond to unexpected
changes in workload. For example if an application has a dramatic increase in
load, there may be insufficient capacity in the servers set aside for that
application to meet the demand. However, there may be sufficient capacity in
other servers running other applications that cannot be used.
This is what we mean when we say that WebSphere Extended Deployment can
be used to achieve service level optimization. The primary features that you will
see used are shown in Figure 1-1 on page 7.
App
Order_application
On-demand router App Server
HTTP://orderapp/.. Server App
Starts and stops servers Server
Inventory_application
according to load
It is this information that feeds into the technical process in terms of defining
workload policies that WebSphere Extended Deployment will use to manage the
workload.
Education
You are going to need to educate different areas with respect to the
implementation of WebSphere Extended Deployment such as the following:
Operation staff who look after WebSphere
Business areas
Environment layout
A first step is to obtain a diagram of the existing WebSphere cell configuration. At
a minimum, this diagram should show the following:
The physical servers that are used
The deployment manager and application servers’ locations
For each application, contact the business owner and determine the following:
Required hours of availability
Some relative importance indicator of this application to the organization as a
whole
A first cut of a service level required
Whether the application can be broken into components. For example, are
there some requests that should get higher priority then others.
Any special considerations the business owner believes exist
Whether they are willing to have their application dynamically managed by
WebSphere Extended Deployment
For each application, contact an area that can provide current performance
information, such as the following:
Typical daily profile of application usage
Typical daily response time breakdown
Typical weekly profile of usage
After you gather the above information, you are ready to start defining what
definitions you will set up for dynamic operations.
There could also be applications that are receiving poor response time due to
overloaded back-end systems, for example, when SQL queries cannot be
handled fast enough by a database server. If WebSphere Extended Deployment
was to start additional servers to try and provide more capacity for the
application, the result would be even more SQL requests being sent to the
already overloaded database. For applications in this situation, it is best to limit
what WebSphere Extended Deployment can do in terms of starting additional
servers when the response time goal is not being met.
Transaction classes
Transaction classes provide the link between applications and service policies.
They are defined in service policies.
Work classes
Work classes define a grouping of work intended for a service policy by mapping
all or a part of an application to a transaction class.
Having obtained information about the applications, the first step is to determine
what service policies are required.
When starting to consider what service policies to create, keep in mind that
service policies are really going to come into play when your system is under
load or when the mix of requests being processed by the system changes
significantly. When the system is running smoothly, there is likely to be little
queuing of requests in the ODR, and every request that arrives is immediately
dispatched to a server to run in. However when the mix of requests changes or
the load changes in some significant way, WebSphere Extended Deployment is
going to use the service policies you defined to make decisions about which
requests get dispatched to a server first from the ODR, and whether to stop or
start servers.
Another important point to note is that service policies are a goal. They are not
some form of super WebSphere option that can actually make application code
run faster.
To be sure that the service policy that ends up being used for the application
specifies an achievable goal, the following process should be followed for each
application:
Load test the application on a single server. This shows its response time
under load and identifies where its breaking point is. It also lets you determine
the characteristics of the application, for example, whether it uses a lot of
CPU or spends a lot of its time waiting for IO to complete.
The results of this testing should provide accurate information about how the
application really performs under load and what response time it can deliver.
With this information you can map the application to a realistic service policy.
Additionally you can go back to the business area and advise them of what is
realistic in terms of setting a service policy.
Each application should have at least one transaction class defined for it. You
can use the default transaction classes, but in an environment where you have a
number of applications, using the same the transaction class does not provide a
benefit.
By defining at least one transaction class specific to each application, you can
use WebSphere Extended Deployment to display information showing how each
application is performing.
It is possible to have more then one transaction class for an application. For
example an application may have two parts, one that does queries and one that
does purchases. In this case, you could define two transaction classes: one to
which the query requests are mapped and one to which the purchase requests
are mapped. The purchase transaction class can then be associated with a
service policy that has a higher relative importance. The result is that in times of
load, the ODR gives priority to the purchase requests over the query requests.
In most cases it is probably best to keep the number of transaction classes that
are defined for an application to a relatively small number, perhaps two-to-four.
In other words, avoid extremes. If, for example, your application had 100 distinct
URLs, do not define a transaction class for each one.
You cannot assign this same pattern to any new work class you create. By
default, the default work class is assigned to the default transaction class and
thus to the default service policy. This means that when you are planning for
work classes, you only need additional work classes if you plan to split an
application into multiple transaction classes so that they can be assigned to
different service policies. If there is only one transaction class for an application,
then you only need the default work class.
In most environments there will be some component that receives the requests
and sends them to the various WebSphere application servers. There are many
possible ways real WebSphere sites may control how work flows from end users
to WebSphere servers, and it is impossible to describe how to implement ODR
for each one. We will discuss implementing ODR for the following typical IBM
solutions:
IBM HTTP Server in conjunction with the WebSphere plug-in
IBM Tivoli® WebSEAL
IBM Caching Proxy, possibly in conjunction with Content Based Routing
The aim is to get this key piece of the WebSphere Extended Deployment solution
in place in your WebSphere environment and to build confidence in its use
before moving onto the next steps.
The net effect of implementing the ODR this way should be negligible. As you
have not yet defined other dynamic operation definitions that would allow
WebSphere Extended Deployment to use the ODR to dynamically manage the
environment, the workload is handled in much the same way as it was before the
ODR was implemented. Having the ODR implemented then allows you to start
implementing the service policies (and other items) that you determined from
your planning.
IBM P 9
Application A
HTTP l 0
Server u 8
g 0
i
n
9
Application B
0
8
1
A larger production environment may have several IHSs with a load balancer
spraying requests across them but, for purposes of simplicity, leaves that to one
side and just uses the simple case of a single IHS.
9
Application B
0
8
1
9 Application B
0
8
1
In this configuration, there is only one junction used by applications. This junction
is configured to send all requests to an IBM HTTP Server that has the standard
Web server plug-in. For these type of configurations, the ODR would be added in
the manner described in “IBM HTTP Server and plug-in” on page 16.
WebSEAL Junction: 9
Application A
appA 0
8
0
Junction:
appB
9
Application B
0
8
1
When adding the ODR to this type of configuration, consider the way the multiple
junctions are being used as this may well influence how you intergrate the ODR.
ODR 9 Application A
0
7
WebSEAL Junction: 0
8
allApps 8 0
0
9 Application B
0
8
1
ODR 9 Application A
0
7
WebSEAL Junction: 0
8
appA 8 0
0
Junction:
appB
9 Application B
0
8
1
Figure 1-9 All junctions sending to the one ODR proxy port
Another approach is to have multiple ODR servers between WebSEAL and the
WebSphere servers. An ODR could be set up for each WebSEAL junction.
However, this would then create a more complicated environment to maintain.
IBM C 9
Application A
Caching B 0
Proxy R 8
0
9
Application B
0
8
1
A larger production environment may have several caching proxies with a load
balancer spraying requests across them but, for purposes of simplicity, will leave
that to one side and just use the simple case of a single IBM Caching Proxy
installation.
The CBR would typically have several rules defined to control routing for the
various applications. However we now want the caching proxy to send all
requests to the ODR, as it will now be the role of the ODR to queue and route
Figure 1-11 shows the implementation of ODR with IBM Caching Proxy.
IBM C ODR 9
Application A
Caching B 0
Proxy R 8
0
9
Application B
0
8
1
You could consider removing the use of the CBR all together. However you may
want to retain the use of the CBR if you have other requests that you want to
handle in some special way. For example, you may want to route requests for
static pages to a set of HTTP servers.
Node groups
Node groups represent resource pools that workload can be spread over. The
resource pool consists of the WebSphere nodes.
However there are valid reasons why you may not be able to have just one node
group, such as the following:
Your applications use a product that is only available on specific nodes in the
cell.
A hardware feature, such as a crypto card, is only available on some nodes.
Political reasons, for example, a group may claim exclusive ownership of a
set of nodes and refuse to let them be used by other applications.
You need to understand if your environment has any of these or other constraints
and then plan what node groups you will need accordingly. When faced with
these types of constraints you may well need to think if there is a way to remove
them. For example where there is a group that will not let their nodes be shared,
perhaps you can point out that their application is being constrained at peak
times due to insufficient capacity. You can advise them that by agreeing to share
hardware with other groups, they gain access to additional resources during
peak time and improve the performance of their application.
Additionally it may be that you have a very large number of applications and
nodes. In such a circumstance it may make sense to split your nodes into a few
small groups and then spread the applications across these nodes. The reason it
may make sense to do this is that it may make it simpler in terms of managing
external resources used by the applications, for example, number of connections
to databases.
Sites that already have every application deployed to its own application server
can easily migrate their configuration to Extended Deployment with the greatest
level of flexibility in terms of dynamic operations.
Sites that have more than one application deployed to an application server need
to consider the reasons they are currently using that approach and whether they
want to split each application out into its own application server. This may not be
such a big decision if there are only two applications in the same server.
However where there is a much larger number of applications deployed to a
single server, sites need to consider whether they have the resources to split
each application into its own server. For example, suppose there are ten
applications in a server. Creating nine new servers can result in significantly
more memory being used since there is now the potential for ten JVMs to be up
and running simultaneously, where as before there was only one. Note that the
impact of this is reduced with WebSphere Application Server V6.1 because it
loads common Java™ classes into shared memory, which reduces the impact of
having multiple servers running.
If you have two applications deployed in the same server, both of which call EJBs
within their own and the other application, we recommend that you configure
WebSphere with the prefer local option for calling EJBs. If you were to split these
tightly coupled applications into separate servers, then the inter-application
EJB™ calls become a much more expensive operation than before. In such a
case it may make more sense to keep the applications in the same dynamic
cluster.
If you have a large number of applications in the environment it may be that you
have some key applications that either handle a large proportion of the workload
or are highly valued for some business reason. It makes sense to have these
sorts of applications in their own servers so they gain the maximum benefit from
WebSphere Extended Deployment. Where there are low-use applications or
those with a relatively low business value sharing a server, it may not be worth
the additional overhead of splitting them out into separate servers.
As with everything, look to find the appropriate balance in terms of deciding if you
will put every application into its own server or not.
One approach is the big bang approach. In this approach you define all the new
associated definitions, implement them, and then check the result. The end
result of the big bang approach could well be a big bang in your WebSphere
environment. Not so much due to a product failure but due to the introduction of
so many changes at once.
With AEM
AEM provides four methods of activating new versions of applications. These are
described in detail in the IBM Redbook Using WebSphere Extended Deployment
V6.0 To Build an On Demand Production Environment, SG24-7153.
Since you now have four ways of activating updated versions of applications, you
need to plan what approach you will use. You need to discuss these options with
the application developers and with the business areas that these new versions
affect. Some of the new options will allow test users to test the deployed version
of the new application before it is made generally available. This helps to prevent
your real end users from accessing a new version that is still in test.
Perhaps most importantly, you can let the WebSphere environment manage
itself in terms of processing the workload so that the service policies you defined
are met. This enables the WebSphere environment to respond much faster and
in the manner you require then would otherwise be possible if left to manual
human intervention. Additionally this reduces your support costs.
As a result, business areas can bring new initiatives to market much faster than
they could have done otherwise. Consider for example a business area that
decides to have a promotion they know will generate a temporary increase in
load on the system. Before the implementation of dynamic operations, the extra
load might have created the need to acquire a temporary server, even though
there was spare capacity on other existing servers. This process would typically
take considerable time, time which the business area might not be able to afford.
With dynamic operations, the existing environment could most likely absorb the
additional load by spreading it across existing servers, with no need to acquire
an additional server.
During the following sections, there are various displays showing response time
etc. We used a load generation tool to put load onto the environment so that the
various displays that show performance information have a semi-realistic look to
them.
SmallApp2 SmallApp2
Clusters
ITSOnode3 ITSOnode4
Server3Node3 Server3Node4
BigApp2 BigApp2
The current environment included one set of users on the east coast and another
set on the west coast. Daily reports showed that users of the BigApp1 application
were getting slow response time during part of the day. Technical support
determined that the servers running the BigApp1 application were getting
overloaded during parts of the day.
BigApp1 None
BigApp2 None
SmallApp1 None
SmallApp2 None
Avg Resp Req Avg Req Avg Resp Req Avg Resp Req
Time Rate Resp Rate Time Rate Time Rate
Time
14 13 55 44 34 78 11 99 7
15 15 66 48 48 105 7 112 2
16 17 60 66 66 65 4 77 4
17 25 44 56 132 89 2 86 2
18 16 23 47 76 46 1 91 3
Note the data in the above table is fictional and used only for demonstration
purposes. They may not necessarily line up with subsequent response time
pictures. Again the purpose here is to give a hypothetical example of the process
only.
Using this data, the service policies were determined. Table 1-4 on page 31
shows the service policies to be defined based on the observed average
response times and the relative importance of the applications.
The process followed was to perform the following steps on each node, one node
at a time:
Stop all WebSphere processes.
Install the product code.
Restart WebSphere processes.
After this process was completed, the administrative console was used to verify
that the new code was installed successfully to each node, as shown in
Figure 1-13 on page 33.
The process followed was to perform the following steps on each node, one node
at a time:
Stop all WebSphere processes.
From the product bin directory issue the xdaugment command passing in the
name of the profile to be augmented.
Restart WebSphere processes.
Example 1-1 on page 34 shows the command issued for the deployment
manager and the output produced. The augmentation process writes a log, in
this case to the following location:
C:\WebSphere\AppServer61\logs\manageprofiles\Dmgr01_augment.log
After the deployment manager was restarted, new options appeared in the
administrative console, including Runtime Operations and Operational Policies.
ODR placement
In this example there are no firewalls or DMZs. We decided to run the ODR on its
own server and that the ODR would be placed between the existing IBM HTTP
Server and the application servers.
For a full discussion of determining the topology to use for on demand routing
components, see the redbook Using WebSphere Extended Deployment V6.0 To
Build an On Demand Production Environment, SG24-7153.
The xdaugment command was run to augment the odr1 profile. The new ODR
node then appeared as shown in Figure 1-15.
To send requests to the ODR directly, you need to know which TCP/IP port the
ODR is listening on when it comes to the proxying of requests. To find this port,
select Servers → On Demand Routers → odr1 → Ports. This display shows all
the TCP/IP ports used by the ODR. A portion of this display is shown in
Figure 1-17 on page 38.
To test that the ODR was proxying standard HTTP requests, a request was sent
to the ODR server on port 80, and then to test SSL requests, to port 443. Note
the ODR server, since it is really a special form of the standard application
server, also has the standard Web container ports. These are not used for the
proxying of requests, so do not send requests to those ports.
In a real production environment, you may want to change the default ports
assigned to the proxy ports.
Example 1-2 on page 39 shows an extract of the ODR proxy log from our system.
The plug-in file can be generated at different scopes. Since the topology only had
one IHS, the scope was set to the cell level. When an ODR is first defined, the
scope defaults to none and no ODR plug-in is generated. Once the setting is
changed to a scope, whenever the ODR is restarted, an ODR-aware plug-in file
is generated. Any subsequent application deployments trigger the ODR plug-in
file to be regenerated.
Note: The ODR must be restarted whenever this scope setting is first set or
changed. No restart is required when applications are added or removed.
A user-written script or Windows .bat file can be created and run automatically to
copy the file from the ODR server to the IHS server whenever the ODR
re-generates the plug-in file to copy the file.
Note that the bat file runs on the machine where the ODR is running.
The IHS was restarted to make sure it picked up the new plug-in file. Tests were
run to ensure the applications could still be accessed successfully via IHS and
the ODR proxy logs were checked to verify that requests where being proxied by
the ODR.
All these tests were successful, meaning the ODR was implemented
successfully.
To remedy this, it was necessary to tell the ODR that the IHS is a trusted server.
After restarting the ODR, and sending some test requests, we verified that the
applications now obtained the TCP/IP address of the browser again.
1.3.11 Checkpoint 1
At this stage, Extended Deployment was installed and the ODR was
implemented in the existing environment. We wanted to explore how WebSphere
Extended Deployment was managing the WebSphere environment at this stage,
without having done any of the steps to move to dynamic operations.
Clicking on the service policy name will open a page that shows the transaction
class definitions, as shown in Figure 1-22.
The first display was a view that showed the real time CPU usage on each node
in the cell. We selected Runtime Operations → Runtime Topology, then
selected Node Group from the drop down box labelled Select a perspective.
This gave the display shown in Figure 1-24.
To view information about the application and the service policy it is now
associated with, select Runtime Operations → Runtime Topology. Figure 1-28
shows the Bronze service policy and the average response time for the
SmallApp1 application.
Click the Add data button, and select the Percentile Response Time metric to be
added to the graph (Figure 1-29).
With this metric you can see at a glance what percentage of requests are
meeting the service policy objective.
A new node group called ITSO-Area-305 was defined and the four nodes that
ran applications were added to it. Node groups can be defined by selecting
System Administration → Node groups and clicking New. Once the node
group has been added, members for the node group can be identified by
selecting Node group members under the Additional properties section.
Figure 1-32 shows the nodes that are now members of the new node group.
Any changes in the future that need to be made to the servers that run in the
dynamic cluster, should be made to this template. This ensures that they are
propagated by WebSphere to any servers in the dynamic cluster.
The operational mode was set to Supervised. This means that WebSphere
Extended Deployment will raise runtime task alerts when it detects that an action
related to the dynamic cluster should be done.
Additionally new servers are now defined for each node, as shown in
Figure 1-35.
Figure 1-36 Mapping the BigApp1 application to the new BigApp1 dynamic cluster
The reason a request fails is because there are no servers in the dynamic cluster
started. However, because we configured the dynamic cluster in the supervised
mode, WebSphere Extended Deployment detects that there are no running
servers to process requests and to raise a runtime task alert.
The task recommendation was accepted, a server was started, and the BigApp1
application became available.
BigApp2 BigApp2
BigApp1-ITSOnode1 BigApp1-ITSOnode2
BigApp1 BigApp1
Static
Clusters ITSOnode3 ITSOnode4
BigApp2-ITSOnode3 BigApp2-ITSOnode4
Dynamic
Clusters BigApp2 BigApp2
BigApp1-ITSOnode3 BigApp1-ITSOnode4
BigApp1 BigApp1
The business manager then happened to mention that she was planning to give
a demonstration of a specific part of the BigApp2 application to senior
management the next day. She was concerned that the demonstration might not
go smoothly since that was the same day as end-of-month processing, which
produced a high workload.
Plan approach
The BigApp2 application was currently mapped to the Silver service policy, which
has a response goal of 50 msec. One option was to just associate the required
subset of the BigApp2 application with the Gold service policy. However, it was
not known if that part of the BigApp2 application could deliver response times
that met the Gold service policy goal of 20 msec. Note that mapping requests to
a service policy with a lower response time goal does not make the application
run any faster inside the application server.
We decided to define a SilverPlus service policy, with the same goal as the
existing Silver service policy, but with a higher importance than the Gold service
policy. We used a new transaction class and work class so that the targeted
requests were mapped to the SilverPlus service policy.
The new work class was defined by going to the list of service policies for the
BigApp2 application, expanding the Work Classes for HTTP Requests section
and clicking New. Figure 1-40 on page 57 shows how the specific URL request
was selected.
A rule was added to the new work class by clicking the Add Rule button and then
clicking the Rule Builder button, which produced the display shown in
Figure 1-41.
The condition specifies that the rule will match if it finds the $WSRA HTTP
Header, which is added by the Web server plug-in, with a value of 9.44.168.45.
Clicking OK takes you back to the previous display, where the BigApp2-TC2
transaction class was selected (Figure 1-43).
Figure 1-43 Setting the transaction class for the new work class
A test was done prior to the meeting and the Runtime Topology view was used to
verify that the requests were being managed under the new SilverPlus service
policy as shown in Figure 1-44.
1.3.18 Summary
The ITSO-Area-305 company has now implemented WebSphere Extended
Deployment into an existing Network Deployment installation. The two key
applications of the business are now able to use the available capacity of all
nodes in the environment. The WebSphere technical team can use the Runtime
Topology view to see how the applications are performing against the service
levels that were defined. Additionally they can show this information to the
business area manager in an easy-to-understand format. WebSphere Extended
Deployment was also used to meet an unexpected business requirement by
categorizing parts of an application into a separate work class and a new service
policy.
Typically, these vary from business unit to business unit and from application to
application.
If you are going to implement chargeback, you need to know how much cost you
need to cover. This is likely to be the total cost of running your installation plus a
contingency or required profit.
Try to understand the reasons for objections. Are your users concerned about
loss of control? Plan to implement a level of usage reporting that gives your
business units the information they need to have confidence in your planned
infrastructure.
Agree on SLAs
Negotiate SLAs with your business units at the level of detail that they require
and that you know that you can deliver for the appropriate combinations of user,
application, and transaction.
Agree on chargeback
Consider whether chargeback is based on IT usage metrics or business value
metrics:
IT usage metrics reflect the cost of providing an IT infrastructure.
Business value metrics are based on measures of what that IT infrastructure
delivers to the business.
If you charge based on IT usage, you can use business value metrics to
demonstrate the business value of IT expenditure. Conversely, if you adopt
business value metrics as your basis for chargeback, you should still measure
usage metrics so you can reconcile chargeback against IT costs.
Best practices:
Keep your metrics simple. That way you and your business users can
understand them.
Favor business value metrics over IT usage metrics. Your end users will
prefer them. Also it gives IT an incentive to become more efficient.
Ensure that your charge out policy is compatible with the accounting
standards and procedures for your business.
Calculate your charge out rates based on expected usage patterns. (Build
a spreadsheet model or similar.)
Negotiate with your end users to agree the basis of re-charge rather than
try to dictate. But try to keep it simple, and make sure you can implement
anything you agree.
Perform risk analysis based on possible usage patterns.
Perform volume tests to stress test your system, and ensure that you get
expected charge out values.
Be on the lookout for unintended consequences. Implementing
chargeback could influence user behavior. Users may find ways of
reducing their costs while increasing yours!
If you can, run for a trial period generating statistics and reports before
using them as a way of automatically generating chargeback.
Transactional work
Use as few node groups as possible to maximize sharing and flexibility.
Best practice: Create a dynamic cluster for each business unit for each
transactional application.
In some circumstances, where fine-grained SLAs are not important and the
emphasis is on cost reduction through resource sharing, you could opt to run
several applications for an individual business unit within one dynamic cluster.
Batch work
The WebSphere Extended Deployment Information Center recommends having
each long running application in its own dynamic cluster. For application hosting
this implies that a separate dynamic cluster is required for each business unit for
each application. This could be excessive so unless you require very fine grained
optimization of your batch work, it is generally more convenient to have a
dynamic cluster for each business unit. Each dynamic cluster runs the
long-running execution environment (LREE) and all the long-running applications
for a business unit.
Best practice: For batch work create a dynamic cluster for each business
unit.
Important: It is poor practice to use the same dynamic cluster for both batch
and transactional work. To understand why read the following article:
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/topic/com.ibm.
websphere.xd.doc/info/scheduler/cxdbatchint.html
If you have relatively little batch work, it may be convenient to run it all within one
dynamic cluster; however, it may be difficult to separate out usage statistics for
your business units.
Extended Deployment also exposes, per server, a CPU utilization metric based
on operating system measurements. This statistic, called the % CPU Utilization,
is then multiplied by the node work potential to determine how much work, over
the interval, was actually completed by that server. This metric is called work
completed and is in Mcycles.
The work factor can then be used to calculate various aggregations. Following
are some examples:
The work completed for all requests for a particular TCM is calculated by
multiplying the work factor by the number of requests serviced.
The work completed for an application can then be computed by summing the
work completed for all TCMs associated with that application.
The logs are simple comma-separated-value (CSV) text files, and can be
processed with scripting languages such as Perl, or they can be imported into a
spreadsheet, data warehouse, or reporting tool. In particular, they can be
imported into ITUAM for charge back accounting.
DeploymentTargetStatsHistoricCache
This file contains limited information. It is documented in
“DeploymentTargetStatsHistoricCache” on page 342. It is not discussed further
in this chapter.
NodeStatsHistoricCache
This log contains historic information from the node statistics cache. Data
recorded includes the following:
CPU utilization
Memory usage
It records data for both transactional and batch processing. At the specified time
interval it creates a record for the deployment manager and every node agent in
the cell.
ServerStatsCache
This log file contains data from the server statistics cache. Data recorded
includes the following:
CPU utilization
Memory usage
Number of requests
Average database response time
Database throughput
It records data for both transactional and batch processing. At the specified time
interval it creates a record for every server in the cell including stopped servers
and Web servers. (The deployment manager and node agents are reported in
the NodeStatsHistoricCache log).
TCModuleInstanceStatsCache
This file contains detailed performance information gathered at the level of TCM
for servers. Data recorded includes the following:
Number of dispatched requests
Response time
Number of requests serviced
Number of requests with response times above their service class threshold
Work factor (see “Calculating compute power consumed” on page 67)
TierStatsCache
During our testing no data was ever observed in the log for this cache.
FineGrainedPowerConsumptionStatsCache
This log file contains fine grained power and work consumption data. Data
recorded includes the following:
Work factor
Number of requests serviced
Work completed
Power consumed
This log is produced only for transactional work. A record is written for every
TCM/server instance. This gives a record for every middleware application,
module, transaction class, and server instance that has had work routed through
an ODR. There are additional fields that hold relationship information such as the
cluster to which the server belongs, the node group with which the cluster is
associated, and the service policy with which the transaction class is associated.
Depending on how you intend to manage the log files, you probably want to
change the Maximum File Size and Maximum Number of Historical Files
parameters. After a log file reaches the maximum file size setting, its name is
extended with a time stamp and a new file is started. You can also change the
frequency of capture and thereby the amount of data logged.
Note: Because these are CSV files, they can be conveniently viewed with
Excel®. Simply change the file extension to .csv and double-click.
If you want to separate the time stamp into two or more fields you can do so with
a comma:
MM.dd.yyy, hh:mm:ss:SSS
yyyy.MMMMM.dd, hh:mm:ss
You can create the custom property from the administrative console by going to
System Administration → Cell → Custom Property.
Note: If the time stamp is changed while data is being logged, the change
takes place immediately. No new header is written until a new log file is
created.
Important: If you are going to process your files through ITUAM (see 2.4,
“Integration with ITUAM” on page 87) you need to restrict your date formats to
two-digit days, two-digit or three-character months, and 2 or four-digit years.
For time, use 2 digits for hours, minutes, and seconds.
Notice how the values for time stamp, begintm and endtm, were split into date
and time fields and formatted according to our custom property.
It can be clearly seen that this file can be used to calculate CPU consumed by an
application for a business unit over a period of time. It can therefore be used as a
basis for chargeback based on CPU.
ServerPowerConsumptionStatsCache
This file is a consolidation of the FineGrainedPowerConsumptionStatsCache at
the server level with some additional server data. Figure 2-4 on page 79 contains
a sample record from the ServerPowerConsumptionStatsCache log.
Although this record was collected some days after the one for the
FineGrainedPowerConsumptionStatsCache, the values recorded for nodepower:
nodeworkpotential, cellpower, and cellworkpotential are identical to the ones
recorded earlier.
The CPU field contains the average % CPU consumed by this server over the
time interval. The other two values are calculated as the following:
workcompleted = (cpu/100) x nodepower x time interval in seconds
powerconsumed = nodepower x cpu / 100.
This data can be aggregated to dynamic cluster level and used for chargeback
when the detail contained in the FineGrainedPowerConsumptionStatsCache is
not required. This has the advantage that less data needs to be processed.
Note: Due to the asynchronous nature of data capture, endtm does not
always line up with time stamp.
The Perl script in “Perl script to calculate CPU utilization” on page 352 calculates
CPU utilization for each cluster in a cell relative to the total utilization of the cell
using the following method.
To illustrate this technique we took sample log files from our system, processed
them through the Perl scripts, and input them into Excel.
Note: The Perl script depends on the time stamp being a single field, so this
will not work if you format the time stamp as two fields, as shown in 2.3.2,
“Formatting the time stamp” on page 75.
In Figure 2-8 on page 83 you can see a sample record taken from a
TCModuleStatsCache log and rendered in Excel. Notice that it was recorded at
approximately the same time as the FineGrainedPowerConsumptionStatsCache
shown in Figure 2-3 on page 77,
Figure 2-9 on page 84 shows some of the metrics for the same record as it was
written out every 15 seconds. You can see that all requests (arrivals) were
serviced. By dividing total response time by the number of requests processed,
you can obtain an average response time over each period. The abvgoal value of
zero shows that all transactions had a response time within the service class
threshold.
You can use this log to record numbers of transactions processed, and you can
record the number that failed to complete and the number that exceeded their
service class threshold.
If you have followed best practice, then your batch workload will run in a separate
dynamic cluster for each business unit, and you can calculate CPU usage from
the ServerPowerConsumptionStatsCache. If you wish to report on memory
usage then use the ServerStatsCache.
It is anticipated that WebSphere Extended Deployment V6.1 will generate per job
usage data for each cell, node, server, user, job name, and job ID. The data will
be stored in a relational database and can be off loaded to TUAM import format.
BusinessGridStatsCache
You can extract performance statistics from the BusinessGridStatsCache.
Figure 2-11 shows a sample of BusinessGridStatsCache data that was imported
into Excel.
You can see that the sample application, SimpleCI, was running on two nodes in
the LREE_DC dynamic cluster. On one node, nine requests were made and six
completed, while on the other, five out of eight were completed. Average
execution time is also shown.
At the time that these records were recorded, time stamp formatting through a
custom property (2.3.2, “Formatting the time stamp” on page 75) was not
implemented, and so updateTime is in exponential form. Timestamp was
formatted using a Perl script.
Through the use of ITUAM’s specialized data collectors and by other means,
ITUAM accumulates data from a wide variety of sources for storage in its
database. From this data, ITUAM can automatically generate invoices and usage
reports at a variety of levels.
ITUAM
Web ITUAM
Reporting database
ITUAM
Admin
1. The ITUAM database stores usage and accounting data plus ITUAM
administrative data. It can reside on DB2 (distributed or z/OS), Oracle®, or
Microsoft® database systems.
2. The ITUAM Administrator is a Windows-based application with a graphical
user interface.
3. The ITUAM processing engine (which has been implemented in both Java
and COM) gathers data through various collector modules and updates the
database. The collectors and other processes are typically run on a
scheduled basis.
4. ITUAM Web Reporting is the user interface to the system. It provides
controlled access to a wide range of reports. It is based on Microsoft Internet
Information Services and either of two reporting tools:
Full documentation on ITUAM can be obtained from the following Web sites:
IBM Tivoli Usage and Accounting Manager
http://www-306.ibm.com/software/tivoli/products/usage-accounting/
Tivoli Software Information Center
http://publib.boulder.ibm.com/tividd/td/IBMTivoliUsageandAccountingM
anager6.1.html
Installation
We set up our ITUAM test system on a single Windows workstation. We installed
the following:
1. Microsoft Internet Information Services (IIS) from Windows components
2. DB2 UDB Express v8.2
3. Crystal Enterprise 10
4. ITUAM base - Setup-ITUAM-6-1.exe
5. ITUAM collector base pack - setup1-6-1.exe
Configuration
We followed the instructions in the following:
Tivoli Usage and Accounting Manager Administrator’s Guide
http://publib.boulder.ibm.com/tividd/td/IBMTivoliUsageandAccountingM
anager6.1.html
Note: We had to put the user ASPNET into the DB2ADMNS group.
Further setup
The following further configuration steps were carried out using the ITUAM
administrator GUI. (Start → All Programs → ITUAM → ITUAM Administrator)
Rate code
We defined a single-rate code to calculate a notional monetary value from
powerconsumed in our Extended Deployment log file. This is done through the
Rate Codes Maintenance, Figure 2-17 on page 93. (Chargeback
Administration → Chargeback Table Maintenance → Rate Codes).
The fields in our log file are easily defined in the conversion builder (Figure 2-20
on page 96), but the range of date and time formats that this data collector can
accept is limited. So we had to redefine our time stamp format in Extended
Deployment as described previously in 2.3.2, “Formatting the time stamp” on
page 75. The format we defined is shown in Figure 2-21 on page 96.
The resources fields determine fields that represent resource usage. We chose
powerconsumed (Figure 2-23).
We then had our data converter. This was run successfully and directly from the
conversion builder. Figure 2-24 on page 98 shows a sample record from the CSR
file.
The CSR file layout is well described in the ITUAM Administrator’s Guide,
Appendix B File Layouts.
For further discussion on these topics, see WebSphere Application Server V6.1:
Planning and Design, SG24-7305.
Health policy targets can be any or all servers in a cell. A server can be
monitored by multiple health policies.
There are two types of action that can be chosen when the criteria for a policy
are matched to current conditions.
Take a JVM heap dump. This is only available for the IBM JDK™ and only for
request timeout and memory leak conditions.
Restart server. Note that recycling a server is not really a fix, but a temporary
means to keep things going until the problem gets fixed.
Note: It is best to run in supervise mode for a while before switching to the
automatic mode.
Note: As a best practice, apply your changes to the Runtime tab and test the
changes before committing them. Once you are comfortable with the new
settings, save to configuration.
Note: There are times when you would not want to restart the server
automatically, for example, during troubleshooting. Another example would
be during peak times when a recycle of the JVM would put extra load on
the other servers in the cluster, thus creating a domino effect.
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.xd.doc/info/odoe_task/rodhealthfail.html
The health management log messages are stored in the node agent log for the
node where the health management controller is running. To find these logs, you
first need to identify which node is hosting the health controller. You can identify
the node hosting the Health Management Controller by navigating to Runtime
Operations → Runtime Topology in the administrative console. Look for the
red cross icon on the Runtime Topology panel. In Figure 3-3 on page 112, it is
running on ITSOodr1Node01.
This view shows you the conditions that were detected and the actions taken as
a result of your health policies. If there are any actions waiting in supervise mode
you will see those here and can act on them.
You will need the SMTP server host name and port, a user ID and password for
authentication with the SMTP server, and the e-mail address(es) to which to
send the notification.
The policy condition properties we selected (Figure 3-6 on page 115) indicate
that action should be taken when more than 30% of the requests start to time
out. When this condition occurs, the health controller creates a task to take a
memory dump to use for diagnostic purposes and then restarts the server. The
reaction mode is set to supervise. This is a cautious approach that allows the
The policy is applied to the two servers in the node group where the application
runs.
The new policy can be seen in the administrative console (Figure 3-7).
The thread dump is taken and the server is recycled. Once the action is
complete, you will see that in the Runtime Task view. The operator sends the
thread dump to the application developers for debugging.
The health policy is changed again so that the action includes taking a thread
dump as well as restarting the server, and the reaction mode is set back to
supervise. This is kept in place for several days to make sure that the problem is
resolved.
Note: This is a high level overview of using IBM Tivoli Composite Application
Manager or ITCAM for WebSphere to complement the health management
features in a WebSphere Extended Deployment environment. For an in-depth
look at ITCAM for WebSphere, see IBM Tivoli Composite Application Manager
V6.0 Family: Installation, Configuration, and Basic Usage, SG24-7151.
Both products, when used together, complement one other. By using both we
can build solutions to increase productivity and customer satisfaction.
WebSphere Extended Deployment focuses on keeping the environment healthy.
ITCAM uncovers the source of application performance problems and lowers the
amount of time and effort needed to resolve them.
Here is brief comparison among the monitoring capabilities of both the products.
Administration
Account Management x x
Server Management x x
Managing Sever x
Availability metrics
Server x
Web server x x
Custom groups x
Enterprise x x
Problem Determination
Memory analysis x
Heap analysis x
Heap dump x x
Memory leak x x
SNMP alert x
Reports x
Application reports x x
Server reports x x
View reports x
Daily statistics x
Note: This assumes that you installed and configured the IBM Tivoli
Composite Application Manager for WebSphere V6.0 environment, including
the managing server.
During this project we used ITCAM for WebSphere V6.0, which did not
automatically support WebSphere Application Server V6.1 (the base for
2. After the installation was complete, we installed the following to the base data
collector installation.
– Fixpack4 - 6.0.0-TIV-ITCAMfWAS_MP-FP0004.tar
– IF002 - 6.0.0.4-TIV-ITCAMfWAS_MP-IF0002.tar
You can download the updates and updateinstaller from the ITCAM support
site:
http://www-1.ibm.com/support/docview.wss?rs=2344&context=SS3PGL&dc=D
400&uid=swg24013978&loc=en_US&cs=utf-8&lang=en
To install these updates, perform the following actions:
a. Expand Fixpack 4 (6.0.0-TIV-ITCAMfWAS_MP-FP0004.tar) and the
update installer (ITCAMfWAS_V6_UpdateInstaller.tar) to a temporary
directory.
b. Update the silentUpdate.properties file with required information. For
WebSphere Application Server 6.1 node, you need to update the correct
value of the was plug-in location:
wasPlugins.location=/WebSphere/AppServer61/plugins.
c. Run the silentUpdate command with -install option.
d. Repeat step 1 and step 3 to install IF002.
e. After the updates are installed, recycle the WebSphere processes on the
node, including nodeagent.
Troubleshooting
If you are not able to start the application server, check the am.dll file in the lib
directory of your data collector install location. If the file is not there, copy
am_was_6_ibm_15_windows.dll to am.dll.
Review the log files under log dir of the DC install location.
http://<servername:port>/am/console
For example:
http://localhost:9080/am/home
When you log on to the AM console, the first thing you see is the availability
display (Figure 3-11 on page 123).
The availability display shows all data collectors that you have access to with the
following level of detail:
Enterprise shows the overview of all server groups to which you have
access.
Group shows all servers within a particular server group.
Server shows the overview page of an application server.
Portal shows a portal server overview.
Web shows Web servers overview.
4. Select Configured Data Collectors from the menu to see the server in the
list of configured data collectors.
5. To verify the communication between the data collector and the managing
server, go to Administration → Managing Server → Self diagnosis. Look
for PPECONTROLLER and PPPROBE, which show you the data collector
server names and IPs.
You can see the Server Overview page by navigating to Availability → Systems
Overview → Server. Select a group and server to view. The view shows the
latest data collected along with a small history.
There are four sections on the page: Server information, Activity, Resources, and
Server statistics.
Server information
This area (Figure 3-16 on page 127) shows basic information about the
server, including the IP address, server start time, and the monitoring level.
Note that the default monitoring level for non-z/OS platforms is L2 (problem
determination). For z/OS platforms, the default level is L1 (production mode).
L2 may not be necessary unless you are addressing a problem.
Activity
This area (Figure 3-17) shows response time and throughput indicators.
Server statistics
This area (Figure 3-19 on page 129) shows CPU and memory utilization
information.
2. The administrator spot checks the Server Overview page for possible
problems during the day but cannot sit in front of the console all day. Support
has decided to let the agent collect the data during the hours when the
problem is most likely to occur. They use the performance analysis features
to analyze the data.
After they are sure the problem occurred, they create a report that
summarizes the data. The report is created by going to Performance
Analysis → Create Application Reports → Request/Transactions in the
AM console.
The report can be generated according to your specifications. They choose
the response time metric and specify that all request types be included. They
specify the time range for the data to use. They also specify the server where
they saw the problem occurring. The reporting facility also provides advanced
filtering and report comparison options.
3. In the resulting report (Figure 3-21 on page 131), it is clearly visible that some
of the requests are taking more time then others.
4. Click on a bar in the graph that represents a long response time to view the
decomposition report for that instance (Figure 3-22 on page 132).
The chart shows the response time for the transactions relative to the others.
This report makes it apparent that the /trade/scenario transaction is taking a
long time.
5. Click the link for /trade/scenario to see a detailed report of those transactions.
6. To see the details of a specific transaction, click the link for that transaction. In
this case, select one with the highest response time. The resulting report
shows the ten slowest components, as seen in Figure 3-24 on page 134.
In this same report, you can switch to a Flow view that might be helpful in
understanding the sequence of events and where things went wrong
(Figure 3-25 on page 135).
A typical batch application does large amounts of work based on repetitive tasks.
A batch application needs to provide the logic for a single unit of work, and the
container provides the support to run the job with transactions and the ability to
checkpoint and restart the application as required. For example, a typical batch
application would process a large number of records. Each record can represent
a unit of work. The application provides the logic to process a single record. The
environment manages the process of repeatedly invoking the application's task
for processing each record until complete and performs the appropriate
transaction when required.
Most of the batch workloads running today are written in COBOL and run on
z/OS. These workloads contain complex business logic such as interest
calculations and process very large amounts of data, such as credit card
postings and insurance claims. Customers have very tight windows to do these
operations.
Long-Running
Long-RunningScheduler
Scheduler Application
ApplicationServer
Server
LRS LREE
The LREE supports the two types of long-running workloads, batch and
compute-intensive. To support the two types of long-running workloads, within
the LREE.ear there are two types of long-running execution environments.
The compute-intensive execution environment supports long-running
applications that expect to consume large amounts of memory or CPU time.
This execution environment provides a relatively simple programming model
based on asynchronous beans.
The batch execution environment supports long-running, batch-oriented
applications. These applications are expected to repetitively perform record
processing units of work similar to more traditional J2EE applications but are
driven by batch inputs rather than by interactive users. This environment
builds on familiar J2EE constructs, such as entity beans, to provide batch
applications with a programming model that supports container-managed
restartable processing and the ability to pause and cancel executing jobs.
As with the dynamic operations function, the business grid has autonomic
management functions to dynamically adapt the long-running environment to
changing workloads.
The business grid provides the Long-running placement controller function. This
autonomic controller is analogous to the application placement controller (APC)
that starts and stops instances of transactional applications. This long-running
placement controller runs within the LRS and starts and stops instances of
long-running execution environments in response to the situations of the service
policies.
4.3.3 Balancer
Due to the nature of the long running work, co-locating it on the same system
with the transactional work may have a negative impact on the transactional work
being performed. When the dynamic cluster for the transactional work and the
dynamic cluster for the long running work are mapped to the same node group,
the balancer makes decisions about when and on which node the transactional
and long-running work should run, communicating with long running placement
controller and application placement controller as shown in Figure 4-2 on
page 146. These decisions are based on a number of factors including how well
the service policy goals for the two types of work are being met. If there is more
work than the system can handle, the balancer uses service policy importance
settings to determine which service policies it tries the hardest to achieve.
Web / Online XD
Transactional
Work ODR Web / Online XD
(Web/J2EE)
Web / Online XD
Application
Placement Web / Online XD
Controller
Web / Online XD
Balancer
Long Running
Placement Long Running XD
Controller
Long Running XD
Figure 4-2 Balancer coordinates the transactional work and the long running work
The balancer and application placement controller run in an instance that the HA
manager manages, while the long running placement controller runs within a
long-running scheduler. The scope of the components are at the cell level. The
runtime topology chart available in the administrative console shows the location
of the HA managed components and the type of work the node is assigned to, as
shown in Figure 4-3 on page 147.
The following interfaces to the LRS are available for submitting long-running
workloads or jobs (Figure 4-4 on page 148).
Command line (lrcmd.bat/sh)
Administrative console
EJB interfaces
Web service interfaces
EJB
Client
LRS LREE
HTTP Servlet
Client
Job status Job Status
Scheduling Info. Checkpoint Info.
xJCL Info. etc Return code etc
Requires additional
development effort
Command line
A command line interface to the long-running scheduler is provided to submit and
manipulate long running jobs. The command is called lrcmd.bat or lrcmd.sh,
and resides in the bin directory of WebSphere Extended Deployment.The lrcmd
command makes Web services calls to the long-running scheduler application,
and can be run from any machine with Extended Deployment installed and
network access to the long-running scheduler application servers.
For detailed information about lrcmd, see the following Web page:
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.xd.doc/info/scheduler/cbgcommd.html
Note: The lrcmd command line tool starts a separate JVM each time it is
launched and hence typically consumes quite a bit of resources. You might
want to explore more effective ways of submitting and checking the status of
jobs, such as the EJB and Web service interfaces.
Administrative console
From the administrative console, you can check the status or cancel a job. You
can find the job management page by navigating Runtime Operations → Job
Management as shown in Figure 4-5.
In Extended Deployment V6.0, these job management functions are limited, for
example, you cannot submit a job from the administrative console or get the
return code of a job.
EJB interface
The long-running scheduler provides an EJB interface for J2EE applications to
programmatically submit and manipulate long-running jobs. Suppose you need
to submit and manage a large number of jobs in the production environment. The
lrcmd command starts a JVM process each time you execute the command;
therefore, consuming resources. An alternative is to develop a Web application
using the JobScheduler remote interface for the long-running scheduler EJB to
submit and manage your jobs.
Example 4-1 Sample servlet code using EJB interface to submit a job
package com.ibm.itso.sample.batch.client;
import java.io.*;
import java.rmi.RemoteException;
import javax.naming.InitialContext;
import javax.servlet.*;
import javax.servlet.http.*;
import com.ibm.websphere.longrun.JobScheduler;
import com.ibm.websphere.longrun.JobSchedulerHome;
import com.ibm.websphere.longrun.SchedulerException;
import com.ibm.websphere.longrun.JCLException;
import com.ibm.websphere.longrun.JobSubmissionException;
try{
InitialContext ictx = new InitialContext();
JobSchedulerHome jsHome =
(JobSchedulerHome)ictx.lookup("cell/clusters/LRS_DC/"+jndiNameforScheduler);
js = jsHome.create();
}catch(javax.naming.NamingException ne){
System.out.println(" NamingException occurred. Failed to Lookup
JobSchedulerHome."+ne);
}catch(javax.ejb.CreateException ce){
System.out.println(" CreateException occurred. Failed to Create
JobScheduler. "+ce);
}catch(RemoteException re){
System.out.println(" RemoteException occured. Failed to Create JobScheduler.
"+re);
}
}
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/topic/com.ibm.web
sphere.xd.doc/info/reference/apidocs/com.ibm.websphere.longrun.JobSched
uler.html
xJCL
Every long-running job is defined using an XML-based file called xJCL (XML Job
Control Language). The xJCL has constructs for expressing all of the information
needed for both types of long-running workload (job) execution; although, some
elements of xJCL are only applicable to either compute-intensive or batch type
jobs.
Note: The xJCL definition of a job is not part of the actual long-running
application. It is constructed separately and submitted to the long-running
scheduler for execution. The long-running scheduler uses information in the
xJCL to determine where, when, and how the job should be run.
Before you submit jobs to the long-running scheduler, you need to prepare the
xJCL files to define the necessary information for job execution. For more
detailed information about xJCL, please refer to section 7.7, “Batch application
syntax in xJCL” on page 279 and section 8.4, “Compute-intensive application
syntax in xJCL” on page 298.
LRS LREE
1. The xJCL describing the information needed to run the long-running job is
prepared.
2. The xJCL is submitted to the LRS via the command line, EJB interface, Web
service interface, or the administrator console.
3. The LRS accepts the job submission and dispatches the job to an LREE.
a. If WebSphere security is active, the user is authorized against the
long-running scheduler security roles.
b. A job ID is assigned to the submitted xJCL request.
c. The xJCL passed in the request is validated and stored in the LRS
database.
d. The job is classified based on several factors including service policies
(priority level and max queuing time).
e. The job is queued (in memory) and is dispatched for execution to an LREE
via the Web service interface. The LRS endpoint selector uses several
factors to determine which LREE to dispatch to it. LRS can start a new
LREE instance if required (depending on the configuration, load, and so
forth).
4. The LREE executes the job as described in the xJCL. While processing the
job, the LREE persists and updates the information about the job, such as
Common state
Non-existent
Batch specific state
Some states such as Restartable and Suspended are specific to batch jobs.
Dispatch Completed
Submitted Executing Ended
Infrastructure or
application problem
Cancel Cancel
Execution
failed
Common state
CI specific state
For more information, see the following Web page in the WebSphere Extended
Deployment Information Center:
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.xd.doc/info/odoe_task/codhealthbgrid.html
The LREEs are also deployed in a dynamic cluster (LREE_DC in the figure). The
LRS dispatches jobs to the available LREE application server. The long running
placement controller in the LRS can start additional LREE instances on demand
if service policy goals are not satisfied.
You can set the maximum number of the jobs running concurrently on an LREE
instance by setting the com.ibm.websphere.longrun.EndPointCapacity custom
property for the dynamic cluster.
LRS_DC LREE_DC
LREE
LREE11
Long-Running
Long-Running
ODR Scheduler
ODR Scheduler11
lrcmd Dispatcher
Dispatcher
Submit a job LREE
LREE22
ODR
ODR Long-Running
Long-Running
Scheduler
Scheduler22
LREE
LREE33
3. In step 2, specify the goal and importance of this service policy. Here we
specify 1 Minutes as the goal value and Highest as the importance as shown
in Figure 4-11.
When the age-based condition occurs for a node in which jobs are running, the
long-running scheduler stops dispatching new jobs to that server. The health
controller continues to indicate the age-based condition periodically each time
the controller cycle comes. After the last job on the server completes, the
long-running scheduler allows the restart of the node the next time that the
age-based condition is called by the health controller.
Note: This chapter assumes that you already installed WebSphere Extended
Deployment on a WebSphere Application Server Network Deployment V6.1. If
you are using V6.0.x as a base, these instructions still apply, though you may
have some navigational differences.
Note: This illustrates a simple topology. The topology of your runtime may
vary, depending on business and application requirements. For example you
might choose to run the LREE dynamic cluster on more than just two nodes.
Cell: ITSO
Host:ITSODATA
Host:ITSODMGR
Node:ITSOdmgrnode Database for
DB2 V8.2 LREE and LRS
LRS_NG LREE_NG
LRS_DC LREE_DC
Host: ITSOLRS1 Host: ITSOLREE1
Application Server Application Server
Node: ITSOlrs1node (LRS_DC_ITSOlrs1node)
Node: ITSOlree1node
(LREE_DC_ITSOlree1node)
nodeagent LongRunningScheduler.ear nodeagent LREE.ear SimpleCI.ear
The sample consists of six physical machines running Windows Server® 2003.
All machines are connected to the same local area network. Five of the servers
run WebSphere Extended Deployment. The sixth, ITSODATA, is used as a
database server and runs DB2 Universal Database™ V8.2.
Two node groups exist with a dynamic cluster for each, as shown in Table 5-1 on
page 165. The LongRunningScheduler application and the LREE application
Table 5-1 Node groups, dynamic clusters and applications in the sample topology
Node Group Nodes Dynamic cluster Application (.ear)
The following sections go into more detail about how the sample runtime
environment is configured.
For the sample topology, we used WebSphere Extended Deployment V6.0.2 and
WebSphere Application Server Network Deployment V6.1.0.2.
On the server for the deployment manager, execute the following command to
start the Profile Creation Wizard:
<WAS_install_root>\bin\ProfileCreator\XD\pcatWindows.exe
In the sample topology, the deployment manager profile was created with the
values shown in Table 5-2.
Table 5-2 Values for the deployment manager profile in the sample topology
Property Name Value
When the profile creation process was complete, the deployment manager was
started with the following command:
<WAS_install_root>\bin\startManager.bat
To create each custom profile, enter the following command on the node where
the profile will reside, and complete the steps in the Profile Creation Wizard.
Once again, be sure to use the profile creation wizard that shipped with
Extended Deployment:
<WAS_install_root>\bin\ProfileCreator\XD\PcatWindows.exe
In the sample topology, we opted to have the custom profiles federated to the
ITSO cell as part of the profile creation process. After selecting this option in the
wizard, we were asked for the host name and SOAP port of the deployment
manager (Table 5-3 on page 167) so the federation could take place (the
deployment manager must be running).
Table 5-4 shows the steps to follow depending on the method you choose.
5.3.1, “Create the node group” on 5.3.1, “Create the node group” on
page 168 page 168
5.3.2, “Create the long-running scheduler 5.3.2, “Create the long-running scheduler
database” on page 169 database” on page 169
5.3.3, “Configure the JDBC provider and 5.3.3, “Configure the JDBC provider and
data source” on page 170 data source” on page 170
5.3.8, “Configure the long-running 5.3.4, “Create and configure the dynamic
scheduler using a script” on page 178 cluster” on page 173
Table 5-5 J2C Authentication Alias properties for LRS data source
Property Value
Alias ITSOLRS
User ID db2admin
Password ********
We chose to use a XA data source type so that we can use the same provider
for the LREE database, but this is not necessary for the LRS database.
Note: The LRS database can safely use a non-XA data source. In many
cases, so can the LREE database. The use of an XA data source is
recommended for the LREE database in case a batch application is
deployed that updates other XA resources in the same checkpoint. If you
only deploy applications that access the same transactional resource
manager, then 2PC is not required. Hence XA is not required.
5. Click Next.
6. Choose to select an existing JDBC provider. Pick the DB2 Universal JDBC
Driver Provider (XA) from the drop-down, and click Next.
7. Enter the database-specific properties (Table 5-8). Select the option for using
this data source in CMP, and click Next.
Driver type 4
8. Check the summary, and click Finish to create the data source.
9. Save your changes to the master configuration.
After configuring the data source, you should test it to ensure that it is working
properly.
1. Go to Resources → Data sources, and check the box to the left of the data
source.
2. Click Test connection. You should see a message that the test connection
operation was successful.
Note: If you plan to use the setupLongRunning.py script, skip to section 5.3.8,
“Configure the long-running scheduler using a script” on page 178.
Note: You can use a less generic host alias definition instead by defining two
host aliases for the port, each matching only the host name of the machine
hosting the LRS application server.
Note: If you choose to use a different schema name for the long-running
scheduler database tables, you need to configure it here and change the DDL
accordingly.
Note: Using the script is an alternative to the steps detailed in the following
sections:
5.3.4, “Create and configure the dynamic cluster” on page 173
5.3.5, “Enable the startup beans service” on page 174
5.3.6, “Configure default_host virtual host alias for the LRS” on page 175
5.3.7, “Configure and install the LongRunningScheduler application” on
page 176
Note: On first start we recommend that you monitor the SystemOut.log of the
application server in order to spot potential issues.
If you use setupLongRunning.py for the remaining steps, skip to section 5.4.8,
“Configure LREE using setupLongRunning.py script” on page 184 directly;
otherwise, follow the steps and skip that section.
3. In the DB2 command window, execute the following command to run the DDL
file.
DB2 -tvf CreateLRSCHEDTablesDB2.ddl
Table 5-9 J2C Authentication Alias properties for LREE data source
Property Value
Alias ITSOLREE
User ID db2admin
Password ********
Driver type 4
After configuring the data source, be sure to test it to make sure it is working.
Use the following steps to create a dynamic cluster to which LREE are mapped.
1. Select Servers → Dynamic Clusters, and click New.
2. At step 1, enter LREE_DC as the dynamic cluster name and map this cluster to
the LREE_NG node group. Accept the default for all other options, and click
Next.
3. At step 2, select defaultXD as the server template, and click Next.
4. At step 3, accept the defaults, and click Next to proceed.
Because we decided to allow only one LREE application server to run on
each node, we did not select the vertical stacking option. If your system is rich
in system resources and can afford to run multiple instances per node, you
can select Allow more than one instance to start on the same node, and
specify the number of instances to run.
5. Review the summary of actions, and click Finish.
Note: If you decide to add more nodes to the node group that is running the
LREE dynamic cluster, make sure you enable the startup beans service on
the new cluster members.
Note: Using the script is an alternative to the steps detailed in the following
sections:
5.4.4, “Create the LREE dynamic cluster” on page 181
5.4.5, “Enable the startup beans service on LREE application servers” on
page 182
5.4.7, “Install the LREE application” on page 182
Because this script is also used to set up the long-running scheduler, you need to
specify “lree” as the first option. Details for using this script reside in the
WebSphere Extended Deployment Information Center at the following Web
location:
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.xd.doc/info/scheduler/rbglrsched.html
The following commands invoke the script for our test environment:
cd C:\WebSphere\AppServer61\bin
Using the xJCL file allows us to change the application behavior without
changing the code.
If the job is submitted successfully, the following message is returned with the
assigned JOBID, as shown in Example 5-8.
When the sample application executes, it writes log entries to the SystemOut.log,
as shown in Example 5-9 as well as to the file you specified earlier on in the xJCL
file.
In our scenario, we chose to develop the long running applications using Rational
Application Developer V6.0.
Enable
Rational Application Developer V6.0 Startup Bean Service
http://www.ibm.com/developerworks/rational/library/06/0718_saracevic/
After completing the updates, the updater tool should look similar to Figure 6-2
on page 193.
http://www-1.ibm.com/support/docview.wss?uid=swg27008269
At the time of writing, FixPack 15 was the most recent maintenance available so
the first step in our test environment was to update it to 6.0.2.15.
http://www-1.ibm.com/support/docview.wss?rs=3023&uid=swg27005709
1. Copy the Refresh Pack to the updateinstaller maintenance directory:
<rad_install>\runtimes\base_v6\updateinstaller
2. Launch the Update Installer by running the update.exe in the updateinstaller
directory.
After we made and saved these changes, we started the server and logged on to
the administrative console:
1. In the Servers view, right-click the server, select Start, and wait until it starts.
You may switch to the Console view to look at the server’s logs.
2. In the Servers view, right-click the server, and select Run administrative
console. This starts the console in a browser in the workbench.
With the exception of setting up the WebSphere cell and dynamic clusters, the
process of configuring the runtime environment is very similar to that outlined in
Chapter 5, “Configuring a long-running runtime environment” on page 163.
There are some minor navigational differences in the administrative console
because our production environment was based on WebSphere Application
Server V6.1, and the development runtime is based on WebSphere Application
Server V6. The following sections summarize the setup.
Note: The runtime must have access to the JDBC drivers. In our case, we
used DB2, so we made the following libraries available, located in the
C:\SQLLIB\java library.
db2jcc.jar
db2jcc_license_cisuz.jar
Note: The LRS database can safely use a non-XA data source. In many
cases so can the LREE database. We recommend that you use an XA
data source for the LREE database in case a batch application is deployed
that updates other XA resources in the same checkpoint. If you only deploy
applications that access the same transactional resource manager, then
2PC is not required; therefore, XA is not required.
Note: If you do not see the JNDI name for your LRS database in the
drop-down for this option, make sure you defined the data source at the
cell scope.
c. Select the LRS J2C authentication alias from the drop-down box.
3. Save the changes to the master configuration.
For convenience, we start by defining two classpath variables for the business
grid Java binaries as shown in Table 6-1.
BATCH_RUNTIME C:\RAD60\runtimes\base_v6\lib\batchrunt
ime.jar
COMPUTE_INTENSE_RUNTIME C:\RAD60\runtimes\base_v6\lib\gridapis.j
ar
When you develop a new application, you can use these variables to add the
JAR files to the application classpath.
You will see how this is done in the next sections as we use the sample
long-running applications shipped with WebSphere Extended Deployment to test
our setup.
8. Click OK again.
Rational Application Developer will rebuild the SimpleCIEJB project and the
problems described earlier should disappear.
Note: Automatic build is enabled by default. If this is not the case, select
Project → Build Automatically to enable this.
Start by creating a directory on the file system to hold the xJCL files.
1. Create a directory C:\xJCL\SimpleCI.
2. Copy the SimpleCI xJCL sample file to this directory. This file resides in
<rad_install>\runtimes\base_v6\longRunning\SimpleCIxJCL.xml.
3. Click Finish.
The job name in the xJCL must match the name of the application. When
deploying the SimpleCI application using Rational Application Developer, the
name of the application is the same as the name of the project. In this case, the
name of the SimpleCI application is “SimpleCI”.
1. From the project SimpleCI_xJCL, expand the SimpleCI folder.
Deploy SimpleCI
Use the following steps to deploy the application:
1. Start the server.
2. Right-click the server and select Add and remove project.
3. Select SimpleCI from the list of available projects, and click Add.
4. Click Finish to start the deployment.
Submit a job
Now we are ready to submit a job using the xJCL XML file we just modified.
1. Open a command prompt.
Example 6-3 Command to submit a job to SimpleCI in the WebSphere Test Environment.
C:\RAD60\runtimes\base_v6\bin>lrcmd -cmd=submit
-xJCL=C:\xJCL\SimpleCI\SimpleCIxJCL.xml -host=localhost -port=9080
4. Monitor the server messages using the Console view. The output should look
similar to Figure 6-9.
9. Now we can generate the deploy code for the EJB module. Right-click
PostingsSampleEJBs and select Deploy. When finished, the
PostingsSample enterprise application is ready for deployment.
Note: Please note that this application has multiple job steps, so you need
to change the FILENAME property both in Step1 and Step2!
Submit a job
Now we are ready to submit a job using the xJCL file we just modified.
1. Open a command prompt.
2. Change the directory to <rad_install>\runtimes\base_v6\bin
3. Run following command to submit a job:
lrcmd -cmd=submit -xJCL=C:\xJCL\Postings\postingSampleXJCL.xml
-host=localhost -port=9080
Example 6-5 Command to submit a job to SimpleCI in the WebSphere Test Environment.
C:\RAD60\runtimes\base_v6\bin>lrcmd -cmd=submit
-xJCL=C:\xJCL\Postings\postingSampleXJCL.xml -host=localhost -port=9080
4. Monitor the server messages in the Console view. The output should look
similar to the output shown in Figure 6-14.
Each batch application can consist of multiple steps that need to be carried out.
A Batch Job Step bean is associated with each step of the batch job, as defined
in xJCL. These Batch Job Step beans are actually CMP entity beans that
implement the BatchJobStepInterface. The implementation of this interface
provides the business logic of the batch job step.
Each Batch Job Step bean can use zero or more batch data stream objects for
the input and output of data. A batch data stream object is a Plain Old Java
Object (POJO) that implements the BatchDataStream interface provided by
Extended Deployment. A sample implementation of a batch data stream is
described in 7.4, “Using JDBC in a batch data stream” on page 251.
Figure 7-1 on page 221 shows the relationship between the various components
of a batch application for Extended Deployment. Note that a batch application
can have more than one Batch Job Step bean; however, having just one greatly
simplifies the diagram.
Batch Controller Bean Batch Job Step Bean Batch Data Stream
Batch Data Stream
Custom component
Table 7-1 J2EE and Java components that come with Extended Deployment
Table 7-2 summarizes the J2EE and Java components that can be implemented
for an Extended Deployment batch application. Standard J2EE development
tools can be used to develop and package the batch application.
Table 7-2 J2EE and Java components that can be implemented for a batch application.
Note: When we talk about the LREE, we are referring to the LREE enterprise
application and the associated business grid runtime components.
4 createJobStep()
Initialize, open and position
2 submitJob() 3 each Batch Data Stream 5 processJobStep()
6 destroyJobStep()
Batch Job Controller Bean Batch Data Stream Batch Job Step Bean
One for each Batch Application BatchDataStream
Zero or more for each Job Step One for each step (stepID, jobID)
(SLSB) Zero or more for each Job Step
(POJO) (CMP entity bean)
BATCHAPP
Figure 7-2 Interaction of a batch application with the long-running execution environment
The Extended Deployment batch programming model uses a CMP entity bean
for the implementation of the Batch Job Step bean. This entity bean must
implement com.ibm.websphere.batch.BatchJobStepInterface, and this is where
the business logic needs to be implemented. Given these constraints, there are
two possible implementations:
Implementation in the actual bean class itself:
public abstract class SampleStep1Bean implements
javax.ejb.EntityBean, com.ibm.websphere.batch.BatchJobStepInterface
Implementation of the BatchJobStepInterface in a separate Java class, for
example com.ibm.sample.batch.SampleStep1. In this case, the actual bean
class extends this class:
public abstract class SampleStep1Bean extends
com.ibm.itso.sample.batch.SampleStep1 implements
javax.ejb.EntityBean
For this sample application, we opted for the second option, which provides a
way to implement the business logic outside of the Batch Job Step bean. Future
releases of Extended Deployment are likely to provide a batch programming
model that does not require implementation of CMP entity beans. Hence
choosing the second option would ease a potential future migration as well.
BatchSampleController Data
Data Source
Source
(jdbc/batchtest)
(jdbc/batchtest)
Entity Beans (Batch Job Step EJB)
Top-Down mapping
SampleStep1 Table.ddl
com.ibm.itso.sample.batch extends
SampleStep1 SampleStep1
implements
com.ibm.websphere.batch.BatchJobStepInterface
Below is an overview of the steps required to build and package this sample
batch application. The different components involved are shown in Figure 7-3.
Create an enterprise project and EJB project.
Create the Batch Job Controller bean.
Create the implementation class for the Batch Job Step bean.
Create a Batch Job Step bean.
Create the CMP mapping and database table.
Configure EJB deployment descriptor.
Implement sample business logic.
3. Click Finish.
4. Right-click the new EJB project and choose Properties.
5. In the Properties panel, select Java Build Path, and go to the Libraries tab.
Figure 7-5 Configuring the Java build path of the new EJB project
7. Choose OK to continue.
8. Right-click the EJB project and select New → Package to define a package
to hold the EJB classes.
9. Accept the default source folder and specify a package name as shown in
Figure 7-6 on page 228, for example:
com.ibm.itso.sample.batch.ejb
10.Click Finish.
4. Click Next.
5. Specify additional options for the bean, as shown in Figure 7-8 on page 230:
– For the transaction type, select Bean.
– Specify com.ibm.ws.batch.BatchJobControllerBean for the bean class.
– Ensure that Remote client view is checked.
– Specify com.ibm.ws.batch.BatchJobControllerHome for the remote
home interface class.
– Specify com.ibm.ws.batch.BatchJobController for the remote interface
class.
– Ensure that Local client view is not checked.
7.2.3 Create the implementation class for the Batch Job Step bean
Next, we create a simple Java class that implements BatchJobStepInterface.
This is the class that will implement the business logic of our batch application.
When we create our Batch Job Step bean, we will select this class as its
superclass. This approach separates our business logic from the enterprise bean
implementation. Hence we suggest creating this class in a separate Java
package.
Figure 7-9 Creating the implementation class for the Batch Job Step bean
4. Click Finish.
Note: A batch application can have multiple Batch Job Step beans, in which
case you need to repeat this step several times. Make sure to create a
separate implementation superclass for each new Batch Job Step bean.
Figure 7-11 Creating a CMP attribute for the SampleStep1 CMP entity bean
• Now enter stepID for the name of the second CMP attribute.
• Enter java.lang.String for the type.
• Check the Key field box and click Apply.
• Click Close.
The results should look like Figure 7-12 on page 235.
Figure 7-12 Specifying the interfaces and configuring CMP attributes for the entity bean
6. Click Next.
7. Enter com.ibm.itso.samples.batch.SampleStep1 for the super class of the
entity bean.
8. Click Finish to create the bean.
Note that we still need to configure a JNDI name space binding to jdbc/lree in the
EJB deployment descriptor. We will do this in 7.2.6, “Configure EJB deployment
descriptor” on page 238.
Note: The table for the CMP entity beans can be stored in a separate
database if desired. In this case we chose to use an existing database to
reduce complexity. We do not need to create an additional database and data
source.
Configure the JNDI name for the Batch Job Controller bean
Rational Application Developer V6.0 generates a default JNDI name for each
EJB based on the name of the home interface. The Batch Job Controller bean
home interface implementation is provided by Extended Deployment; therefore,
the following default JNDI name space binding is used for each batch
application:
ejb/com/ibm/ws/batch/BatchJobControllerHome
When deploying multiple batch applications, this results in JNDI name space
conflicts. Hence, it is a best practice to change the name space binding to
something that is unique, for example the name of the Batch Job Controller
bean.
1. In the Beans tab of the deployment descriptor, select the
BatchSampleController Batch Job Controller bean.
2. In the right panel, change the JNDI name under WebSphere Bindings to
ejb/com/ibm/itso/samples/batch/BatchSampleController, as shown in
Figure 7-14 on page 239.
Configure the JNDI name for the Batch Job Step bean
A similar story applies to the default JNDI name space binding for the Batch Job
Step bean, which is always the following:
ejb/com/ibm/websphere/batch/BatchJobStepLocalHomeInterface
Since multiple Batch Job Step beans can be defined—even in one batch
application—it is best practice to always configure each Batch Job Step bean
with its own, unique JNDI name space binding.
1. On the Beans tab of the deployment descriptor, select the SampleStep1
Batch Job Step bean.
2. In the right panel, change the JNDI name under WebSphere Bindings to
ejb/com/ibm/websphere/batch/SampleStep1, as shown in Figure 7-15.
Figure 7-15 Changing the default JNDI name space binding of the Batch Job Step bean
Note: When configuring xJCL for this batch application, we will use this
reference to point to the different job steps.
Note: This data source can be configured on each individual Batch Job Step
bean as well, as shown in Figure 7-15.
Figure 7-18 Configure the JDBC name space binding for the CMP entity bean
Configure the bean cache for the Batch Job Step beans
The Extended Deployment batch programming model requires that the Batch
Job Step beans persist only two fields into the database (jobID and stepID). The
actual bean might hold more state information, so we need to make sure that the
bean instance is not passivated by the EJB container. In order to ensure this, we
specify the EJB caching option A to be used for the Batch Job Step bean.
Note: More information about EJB caching in general can be found in the IBM
Redbook WebSphere Application Server V6.1: System Management and
Configuration, SG24-7304.
Figure 7-19 Configuring the bean cache for the Batch Job Step bean
Under Container Transactions you should now see that all methods on the
SampleStep1 bean require a transaction, as shown in Figure 7-20.
For a “Hello World!” style batch application, we chose to implement the code
shown in Example 7-1. Basically we only log a few lines to SystemOut.log and
the processJobStep() method returns the constant
BatchConstants.STEP_COMPLETE the first time it is called.
This is discussed in more detail in section 7.6.1, “Batch Job Step bean” on
page 269.
import java.util.Properties;
import com.ibm.websphere.batch.BatchJobStepInterface;
import com.ibm.websphere.batch.BatchConstants;
Obviously, this business logic is not realistic for a batch application. However, the
good news is that you can now start implementing business logic for your batch
application in the com.ibm.itso.samples.batch.SampleStep1 implementation
class. Subsequent steps might include any of the following:
Implement additional Batch Job Step beans.
Implement one or more batch data streams.
Implement your own checkpoint algorithm.
Implement your own results algorithm.
Please refer to section 7.6, “Batch application programming model” on page 269
for more details on the batch programming model and the interfaces you need to
implement. Also, if you want to use a relational database for your batch data
stream implementations, be sure to read section 7.4, “Using JDBC in a batch
data stream” on page 251.
Last, but not least, we want to show some xJCL that you could use to submit a
job to the sample batch application. The xJCL is shown in Example 7-2 on
page 247.
For more details on the actual xJCL syntax, please refer to section 7.7.5, “Batch
data streams” on page 285.
Example 7-3 Configuring batch data streams for a job step in xJCL.
<?xml version="1.0" encoding="UTF-8"?>
<job name="BatchSample"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
<job-step name="Step1">
...
<batch-data-streams>
<bds>
<logical-name>myinput</logical-name>
<impl-class>com.ibm.itso.batch.BatchInputStreamImpl</impl-class>
<props>
<prop name="FILENAME" value="c:\temp\input" />
</props>
</bds>
<bds>
<logical-name>myoutput</logical-name>
<impl-class>com.ibm.itso.batch.BatchOutputStreamImpl</impl-class>
<props>
<prop name="FILENAME" value="c:\temp\output" />
</props>
</bds>
</batch-data-streams
</job-step>
...
</job>
After associating the batch data stream with the job step through xJCL, the Batch
Job Step bean associated with this job step needs to obtain a handle to the batch
Note: It is very important to point out that the handle to the batch data stream
can only be obtained from within the Batch Job Step bean. This is because the
JobStepID can only be obtained using the jobID and stepID of the Batch Job
Step bean. The JobStepID is required when calling the BatchDataStreamMgr.
Example 7-4 Obtaining a batch data stream in createJobStep() method of the Batch Job Step bean
package com.ibm.itso.sample.batch.ejb;
import com.ibm.websphere.batch.BatchDataStreamMgr;
import com.ibm.websphere.batch.BatchContainerDataStreamException;
import com.ibm.websphere.batch.JobStepID;
import com.ibm.itso.sample.batch.BatchInputStreamImpl;
import com.ibm.itso.sample.batch.BatchOutputStreamImpl;
try{
inputBDS = (BatchInputStreamImpl)
BatchDataStreamMgr.getBatchDataStream(inputBDSLogicalName, id.getJobstepid());
outputBDS = (BatchOutputStreamImpl)
BatchDataStreamMgr.getBatchDataStream(outputBDSLogicalName, id.getJobstepid());
} catch(BatchContainerDataStreamException bcdse){
System.out.println(bcdse);
}
}
In order to make this work, the method used to obtain the handle to the batch
data stream in the SampleStep1 class needs to be overridden in the Batch Job
Step bean. This is demonstrated in Example 7-5, where the method
createJobStep() is overridden.
Example 7-5 Obtaining a batch data stream in createJobStep() method of the Batch Job Step bean
package com.ibm.itso.sample.batch.ejb;
import com.ibm.websphere.batch.BatchDataStreamMgr;
import com.ibm.websphere.batch.BatchContainerDataStreamException;
import com.ibm.websphere.batch.JobStepID;
import com.ibm.itso.sample.batch.BatchInputStreamImpl;
import com.ibm.itso.sample.batch.BatchOutputStreamImpl;
try{
inputBDS = (BatchInputStreamImpl)
BatchDataStreamMgr.getBatchDataStream(inputBDSLogicalName, id.getJobstepid());
outputBDS = (BatchOutputStreamImpl)
BatchDataStreamMgr.getBatchDataStream(outputBDSLogicalName, id.getJobstepid());
} catch(BatchContainerDataStreamException bcdse){
System.out.println(bcdse);
}
}
In order to use the batch data stream in the SampleStep1 implementation class,
we define a BatchDataStream object, inputBDS, in SampleStep1. This is shown
in Example 7-6 on page 251. Note that the createJobStep() method is empty
since we decided to override it. The createJobStep() method in the Batch Job
Step bean uses inputBDS to store the handle to the actual batch data stream.
import java.util.Properties;
import com.ibm.websphere.batch.BatchJobStepInterface;
import com.ibm.websphere.batch.BatchConstants;
import com.ibm.websphere.batch.BatchDataStream;
import com.ibm.itso.sample.batch.BatchInputStreamImpl;
import com.ibm.itso.sample.batch.BatchOutputStreamImpl;
7.4.1 Overview
Let us assume that our sample batch data stream reads records from a large
database table. In other words, we use it as input for our business logic
implemented in the processJobStep() method of our Batch Job Step bean.
7.4.3 Implementation
It makes sense to open the JDBC connection in the open() method of the
BatchDataStream implementation, and to close it again in the close() method.
We can perform a SQL query in the open method and use the ResultSet in the
getNextRecord() method to step through each of the records. However, the
problem is that we frequently commit global transactions in the batch loop. This
closes the ResultSet and breaks our batch data stream.
someConnection = someDataSource.getConnection();
someStatement = someConncetion.createStatement();
someResultSet = someStatement.execute(“SELECT * FROM ...”);
someResultSet.getRow(x);
While this is a perfectly viable solution, it is far from optimal. The number of SQL
statements that the database needs to execute will be tremendously higher
compared to when we can re-use the ResultSet on each processJobStep()
method call.
Note: When using the DB2 Universal Database Type IV JDBC Provider, the
cursor holdability can also be set through a custom property on the data
source. The name of this property is resultSetHoldability and the possible
values are the following:
HOLD_CURSORS_OVER_COMMIT
CLOSE_CURSORS_OVER_COMMIT (default)
Note: DB2 Universal Database V8.2 currently only supports cursor holdability
on non-XA resources. In other words, when using the DB2 Type IV JDBC
Provider, cursor holdability is only supported when using
com.ibm.db2.jcc.DB2ConnectionPoolDataSource as the implementation
class.
Last participant support (LPS) in WebSphere Application Server V6.0 and above
provides a solution to this problem. Applications in WebSphere can be
configured to allow a single one-phase commit capable resource to participate in
Figure 7-23 Configure the transaction service of the application server to support LPS
Note: Typically this includes your batch application and the LREE
application.
Note: This approach does not work if you are using multiple JDBC resources,
since last participant support only works with one non-XA resource.
For more details on how to implement a batch data stream, or how to obtain a
handle to a batch data stream in the Batch Job Step bean, please refer to section
7.3, “Using a batch data stream in a batch application” on page 247 and section
7.6.2, “Batch data stream interface” on page 273.
import java.util.Properties;
import com.ibm.websphere.batch.BatchContainerDataStreamException;
import com.ibm.websphere.batch.BatchDataStream;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.sql.*;
This forces each batch data stream to reposition itself to the position at the
last commit during the previous run of the job step.
6. The Batch Job Step bean is created, and the EJB container calls the
ejbCreate() method on the bean.
Note: The LREE calls the findByPrimaryKey() method on the local home
interface. If the jobID and stepID are not found in the database, the create()
method is called to create the Batch Job Step bean.
7. Calls setProperties() on the Batch Job Step bean to set any properties
configured in the xJCL.
8. Calls createJobStep() on the Batch Job Step bean. This method allows for
any resources required for the business logic to be looked up or initialized.
For example, this is where you should obtain a handle to the
BatchDataStreams used by the business logic that is implemented in
processJobStep().
Begin Transaction
1:initialize()
2:setProperties()
3:initialize()
4:open()
5:positionAtInitialCheckpoint()
6:ejbCreate()
7:setProperties()
8:createJobStep()
Commit Transaction
This batch job uses record-based checkpoint algorithms, with the checkpoint
being committed after every second record. The data this BDS accesses has
only three records.
1. Calls getRecommendedTimeOutValue() on the checkpoint algorithm. The
LREE uses this value as timeout for the global transactions it starts from now
on.
2. Calls startCheckpoint() on the checkpoint algorithm. This is to ensure that the
algorithm knows that a global transaction is about to begin.
3. Calls externalizeCheckpointInformation() on each batch data stream involved
in this job step. The LREE persists this information in the LREE database
upon the global transaction commit.
4. Calls stopCheckpoint() on the checkpoint algorithm. This is to ensure that the
algorithm knows that a global transaction was just committed.
Now this is where the LREE really enters the batch loop and will keep running
until processJobStep() returns BatchConstants.STEP_COMPLETE.
5. The LREE calls startCheckpoint() on the checkpoint algorithm. This is to
ensure that the algorithm knows that a global transaction is about to begin.
6. The LREE calls intermediateCheckpoint() on each batch data stream
involved in this job step.
7. The LREE calls processJobStep() on the Batch Job Step bean for the first
time and the method returns BatchConstants.STEP_CONTINUE. This
indicates to the LREE that it should continue running in the batch loop and
should call processJobStep() again.
8. Before calling processJobStep() again, the LREE needs to verify whether a
checkpoint needs to be executed (for example, should it commit the global
transaction and start a new one). It calls shouldCheckpointBeExecuted() on
the checkpoint algorithm. The algorithm returns false in this case, hence the
LREE can call processJobStep() again.
9. The LREE calls processJobStep() on the Batch Job Step bean again, which
again returns BatchConstants.STEP_CONTINUE.
10.The LREE calls shouldCheckpointBeExecuted() on the checkpoint algorithm.
This time it returns true, indicating that the LREE should execute a
checkpoint.
To execute a checkpoint, the LREE will now carry out these steps in order to
execute the checkpoint:
11.The LREE calls externalizeCheckpointInformation() on each batch data
stream. This method returns a java.lang.String, which is persisted in the
LREE database by the LREE.
12.After committing the global transaction, the LREE calls the method
stopCheckpoint() on the checkpoint algorithm.
13.The LREE is about to start another global transaction and calls
startCheckpoint() on the checkpoint algorithm.
14.The LREE calls getRecommendedTimeOutValue() on the checkpoint
algorithm and uses this value as a timeout on the global transaction that it is
about to start.
1:getRecommendedTimeOutValue()
2:startCheckpoint()
Begin Transaction
3:externalizeCheckpointInformation()
Commit Transaction
4:stopCheckpoint()
5:startCheckpoint()
Begin Transaction
6:intermediateCheckpoint ()
7:processJobStep()
STEP_CONTINUE
8.ShouldCheckpointBeExecuted()
false
9:processJobStep()
STEP_CONTINUE
10.ShouldCheckpointBeExecuted()
true
11:externalizeCheckpointInformation()
Commit Transaction
12:stopCheckpoint()
14:getRecommendedTimeOutValue()
Begin Transaction
15:intermediateCheckpoint ()
16:processJobStep()
STEP_COMPLETE
17:ShouldCheckpointBeExecuted()
false
18:externalizeCheckpointInformation()
Commit Transaction
19:stopCheckpoint()
20:startCheckpoint()
21:getRecommendedTimeOutValue()
Begin Transaction
22:intermediateCheckpoint ()
23:externalizeCheckpointInformation()
Commit Transaction
24:stopCheckpoint()
5. The LREE calls close() on each batch data stream involved in this job step.
6. The LREE calls initialize() on every results algorithm associated with this job
step in the xJCL.
Note: More than one results algorithm can be associated with a job step, more
details can be found in the Extended Deployment infocenter at the following
Web address:
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topi
c=/com.ibm.websphere.xd.doc/info/scheduler/cxdbatchres.html
This completes the execution of a single job step. Any subsequent job steps are
carried out in exactly the same way.
LREE Batch Data Stream Batch Job Step Checkpoint Algorithm Result Algorithm
1:startCheckpoint()
2:getReccomendedTimeOutValue()
Begin Transaction
3:intermediateCheckpoint ()
4:destroyJobStep()
5:close()
6:initialize()
7:fireResultsAlgorithms()
8:externalizeCheckpointInformation()
Commit Transaction
9:stopCheckpoint()
Extended Deployment comes with a key class implementation for the Batch Job
Step bean. This is necessary because the bean uses two CMP fields as primary
key: jobID and stepID. This key class, called
com.ibm.websphere.batch.BatchJobStepKey, can be found in batchruntime.jar.
Note: There is no strong rationale for using a CMP entity bean for the Batch
Job Step bean. However, the batch programming model for Extended
Deployment V6.0 mandates this. Extended Deployment V6.1 will most likely
provide a batch programming model that does not involve CMP entity beans.
The Batch Job Step bean is actually a local CMP entity bean: it can only be
called locally by the LREE. The interface that the bean needs to implement is
com.ibm.websphere.batch.BatchJobStepInterface. Since this interface cannot
be changed, the same holds true for the local interface and the local home
interface. These interfaces are provided by the Extended Deployment runtime
and are packaged in batchruntime.jar:
com.ibm.websphere.batch.BatchJobStepLocalHomeInterface
com.ibm.websphere.batch.BatchJobStepLocalInterface
The second option provides a way to implement the business logic outside of the
Batch Job Step CMP entity bean. Also, this option is likely to ease a migration to
a future batch programming model for Extended Deployment that does not use
CMP entity beans.
As mentioned previously, the data in jobID and stepID does not change during
the life cycle of the Batch Job Step bean. Since no other applications can update
these fields in the database either, it is very attractive to enable CMP caching.
However, there is another more compelling reason that requires us to enable
CMP caching. The jobID and stepID CMP fields do not contain all the state held
in the Batch Job Step bean. Hence, when the EJB container decides to passivate
a bean instance of the Batch Job Step bean, any information that is not
contained in jobID and stepID is lost. An example is a handle to a batch data
stream that you might have obtained in the createJobStep() method. In other
words, this would break the programming model.
In order to prevent this from happening, we need to make sure that the bean
instance is always kept in memory by the EJB container. Either CMP caching
option A or option B will accomplish this; however, since our application LREE
has exclusive access to the database we should opt for option A. This will only
read the data from the database once upon activation of the bean, instead of at
the start of every transaction. This significantly reduces the total number of reads
from the database, thus improving performance.
Note: Although theoretically, option B would work, it has not been tested and
the product documentation only recommends option A.
More information about EJB caching in general can be found in section 15.4.1
of the IBM Redbook WebSphere Application Server V6 System Management
& Configuration Handbook, SG24-6451.
Interface com.ibm.websphere.batch.BatchJobStepInterface
public void setProperties(Properties arg0)
This method is called by the LREE to pass in the properties that are
defined in the xJCL. This happens before createJobStep() is called.
You need to implement this method in order to be able to obtain any
properties you have set in the xJCL.
public Properties getProperties()
This method is not called by the LREE but is provided for consistency
reasons.
public void createJobStep()
This method is called by the LREE before it starts processing the
business logic of the batch job, for example, processJobStep().
Typically you would lookup any resources you need for your
business logic.
For example, you would obtain a handle to your batch data stream
here (as shown in Example 7-8 on page 272).
public int processJobStep()
This method is called by the LREE in the batch loop and contains the
actual business logic of this step of the batch job. Any resources
used by the business logic should have been obtained in
createJobStep() and should be released in destroyJobStep().
Note that this method is always called under the scope of a global
transaction. For transactional work, we recommend that you use the
same transaction. When calling EJBs for example, the transaction
attributes should be “required”, “supported” or “mandatory”.
STEP_CONTINUE_FORCE_CHECK No Always
POINT
The return code of this method is used by the LREE when it calls
fireResultsAlgorithms() on the results algorithms associated with
the job step.
Example 7-8 Obtaining a batch data stream in createJobStep() method of the Batch Job Step bean
package com.ibm.itso.sample.batch.ejb;
import com.ibm.websphere.batch.BatchDataStreamMgr;
import com.ibm.websphere.batch.BatchContainerDataStreamException;
import com.ibm.websphere.batch.JobStepID;
A typical batch job step might read records from one batch data stream, do
something with the data, and write (modified) data records to another batch data
stream. An important feature of these objects is that the LREE can position them.
Before the batch job step enters the batch loop, the LREE will position all
associated batch data streams to either their initial checkpoint or—in the case of
a restarted batch job step—to their last committed checkpoint.
Interface com.ibm.websphere.batch.BatchDataStream
public String externalizeCheckpointInformation()
This method is called by the LREE to obtain a checkpoint just before
the commit of a global transaction when executing the batch loop.
The LREE will persist the String to the LREE database at commit.
public void internalizeCheckpointInformation(String arg0)
This method is called by the LREE to pass the last executed
checkpoint information to the batch data stream. The LREE retrieves
this information from the LREE database and passes it in as a
String. This typically happens when a job is restarted. Note that this
does not position the batch data stream to the checkpoint, this
method will only pass the checkpoint information!
public void initialize(String arg0, String arg1) throws
BatchContainerDataStreamException
This method is called by the LREE during the initialization of the job
step, right after calling setProperties(). The initialize() method
is where you can first use the properties set on the batch data stream
in the xJCL.
arg0 - The logical name of the batch data stream, as defined in the
xJCL.
arg1 - String representation of the
com.ibm.websphere.batch.JobStepID, which is a pair of jobID and
stepID.
You can implement your own checkpoint algorithm, and we discuss this in detail
below. However, Extended Deployment also ships two checkpoint algorithms that
are ready to be used directly. Table 7-5 lists both checkpoint algorithms.
Time-based com.ibm.wsspi.batch.checkpointalgorithms.timebased
Record-based com.ibm.wsspi.batch.checkpointalgorithms.recordbased
Note: Make sure that the value for the TransactionTimeout always exceeds
the interval configured for the time-based checkpoint algorithm!
Example 7-9 Configuring the Extended Deployment time-based checkpoint algorithm in xJCL.
<?xml version="1.0" encoding="UTF-8"?>
<job name="BatchSample"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
<checkpoint-algorithm name="timebased">
<classname>com.ibm.wsspi.batch.checkpointalgorithms.timebased</classname>
<props>
<prop name="interval" value="15" />
<prop name="TransactionTimeout" value="30" />
</props>
</checkpoint-algorithm>
...
</job>
Note: Make sure that the value for the TransactionTimeout always exceeds
the time it takes for the job step to process recordcount records!
Example 7-10 Configuring the Extended Deployment record-based checkpoint algorithm in xJCL
<?xml version="1.0" encoding="UTF-8"?>
<job name="BatchSample"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
<checkpoint-algorithm name="recordbased">
<classname>com.ibm.wsspi.batch.checkpointalgorithms.recordbased</classname>
<props>
<prop name="recordcount" value="1000" />
<prop name="TransactionTimeout" value="60" />
</props>
</checkpoint-algorithm>
...
</job>
Interface com.ibm.wsspi.batch.CheckpointPolicyAlgorithm
public boolean initialize(CheckpointAlgorithm arg0)
This method is called by the LREE to allow the checkpoint algorithm
to retrieve associated properties defined in the xJCL. The argument
arg0 is a CheckpointAlgorithm object, which is described in more
detail in the next section. Note that any other initialization should be
implemented in this method as well.
public String getAlgorithmName()
This method returns the name of the algorithm. It is primarily used for
logging and debugging.
public boolean ShouldCheckpointBeExecuted()
The checkpoint algorithm returns true if a checkpoint should be
executed at this point. This method is called by the LREE after the
processJobStep() call on the Batch Job Step bean returns. This
Class com.ibm.wsspi.batch.xjcl.CheckpointAlgorithm
This class contains the following public fields to provide access to the data in the
xJCL.
public String classname
Name of the class as specified in the element <class>.
public String name
Name of the checkpoint algorithm as specified in the name attribute of
the <checkpoint-algorithm> element.
public int numofprops
Number of attributes specified under the <props> element.
public String[] propname
String array containing the names of the attributes specified under the
<props> element.
public String[] propvalue
String array containing the values of the attributes specified under the
<props> element.
Note: There are two types of return codes: the return code of an individual
batch step and the return code of the batch job to which the step belongs.
Results algorithms are declared in xJCL and then applied to batch steps in the
xJCL. More details can be found in section 7.7.4, “Results algorithm” on
page 284.
At the end of a batch step, the LREE checks the xJCL of the batch job to see
which results algorithms to invoke. For each results algorithm specified, the
LREE passes to the algorithm the return code of the batch step and the current
return code of the batch job in the LREE database. The results algorithm can
then take any action based upon the return codes passed in. The algorithm then
passes a return code for the batch job back to the LREE which is persisted to the
LREE database as the current return code of the batch job. This return code can
be the same as the return code that the LREE passed to the results algorithm in
the first place or it can be different depending on logic coded into the results
algorithm.
Interface com.ibm.wsspi.batch.ResultsAlgorithm
public boolean initialize(ResultsAlgorithm arg0)
This method is called by the LREE to allow the results algorithm to
retrieve associated properties defined in the xJCL. Note that any
other initialization should be implemented in this method as well. A
boolean return value of true indicates that the initialization was
successful. The argument arg0 is a ResultsAlgorithm object, which
is described in more detail in the next section.
Class com.ibm.wsspi.batch.xjcl.ResultsAlgorithm
This class contains the public fields listed below to provide access to the data in
the xJCL.
public String classname
Name of the class as specified in the element <class>.
public String name
Name of the results algorithm as specified in the name attribute of the
<results-algorithm> element.
public int numofprops
Number of attributes specified under the <props> element.
public String[] propname
String array containing the names of the attributes specified under the
<props> element.
public String[] propvalue
String array containing the values of the attributes specified under the
<props> element.
<batch-data-streams>Zero or more batch data streams for the job step can be
defined here. Refer to “Batch data streams” on page 285
for more details.
<props> Additional properties that are used by the job-step
implementation can be provided here. These properties
can be accessed through the method getProperties() of
the Batch Step Entity Bean.
<step-scheduling> Conditions on when to execute the job step can be
configured here. For details refer to “Scheduling criteria”
on page 282.
The sequential scheduling mode basically determines that each job step is
carried out sequentially. However, one can configure conditions whether a
certain step is executed or not. This is done using the sub-element
<step-scheduling> on a job step.
Example 7-12 on page 283 shows how to configure a batch job that only carries
out the second job step if certain conditions are met. In this example, job step
“Step2” is only executed if “Step1” returns 0 or 1 as a return code.
Note: The return code of a job step is the integer returned by the method
destroyJobStep() of the Batch Job Step bean associated with the job step.
Note: If you define multiple checkpoint algorithms, the name attribute for each
one has to be unique in the xJCL file.
Instead of writing your own checkpoint algorithm, you could use one of the two
checkpoint algorithms that come with Extended Deployment. Refer to 7.6.3,
“Checkpoint algorithm” on page 275 for more details. Example 7-13 on page 284
shows how to define a checkpoint algorithm called “timebased” using the
time-based checkpoint algorithm provided by Extended Deployment.
Note: If you define multiple checkpoint algorithms, the name attribute for each
one has to be unique in the xJCL file.
Example 7-15 Configuring batch data streams for a job step in xJCL
<?xml version="1.0" encoding="UTF-8"?>
<job name="BatchSample"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
<job-step name="Step1">
...
<batch-data-streams>
<bds>
<logical-name>myinput</logical-name>
<impl-class>com.ibm.itso.batch.BatchInputStreamImpl</impl-class>
<props>
<prop name="FILENAME" value="c:\temp\input" />
</props>
</bds>
<bds>
XD component
CI Controller Bean CI Work
CI Work Custom component
The code you need to develop for the compute-intensive application consists of
the CIWork classes that contain the business logic. As for the CIController bean,
you need only to declare it in the deployment descriptor and point to the
implementation class provided by Extended Deployment.
LongRunningScheduler
CI Controller Bean
One for each CI Application
1 Job arrives
xJCL 2 startJob()
WorkManager
Long Running Execution Environment
wm/default
3 instantiate
4 setProperties()
5 run()
CIWork
(POJO implements
com.ibm.websphere.ci.CIWork)
CISample.ear
CISample.ear
CISample.xml
CISample.xml
CISampleEJB.jar
CISampleEJB.jar BATCH_RUNTIME
job
COMPUTE_INTENSE_RUNTIME Name=CISample
STEP1
com.ibm.itso.sample.ci
CISampleController
SampleCIWork
The following is an overview of the steps needed to build and package a simple
compute-intensive application using Rational Application Developer.
Create an enterprise project and EJB project.
Create the controller bean.
Configure the EJB module.
Create and implement a CIWork class.
Create the xJCL.
ejb/com/ibm/ws/ci/CIControllerHome
import java.util.Map;
import com.ibm.websphere.ci.CIWork;
boolean _continue=true;
Map props;
while(_continue){
double startTime = System.currentTimeMillis();
double endTime = startTime + timeToExecute*1000;
int counter=0;
double currentTime;
while (((currentTime = System.currentTimeMillis()) < endTime) &&
_continue) {
try{
System.out.println("SampleCIWork: run " + counter++);
Thread.sleep(10000);
}catch(InterruptedException ie){
ie.printStackTrace();
}
}
}
}
}
Example 8-2 shows a sample of the xJCL file that can be used to submit a job to
the sample application.
com.ibm.ws.ci.CIWork
setProperties()
setProperties()
commonj.work.Work
release()
isDaemon()
java.lang.Runnable
run()
Interface com.ibm.ws.ci.CIWork
This interface defines the following methods:
public void setProperties(java.util.Map arg0)
This method is called by LREE before run() is called, and
it passes in the xJCL job properties in the java.util.Map
argument. You need to implement this method so that you
can use the job properties specified in xJCL.
public Map getProperties()
This is not called by the LREE but is provided for
consistency reasons.
Interface commonj.work.Work
This interface defines the following methods:
public void release()
This method is called when the job is cancelled. It is the
responsibility of the developer of the CI application to
implement for the logic in this method to cause the run()
Interface java.lang.Runnable
This interface defines the following method:
public void run() This method is called by LREE after setProperties is
called. In this method you need to implement the business
logic. It is strongly encouraged to implement the logic so
that this method returns as soon as practical after
release() is invoked.
The xJCL for a compute-intensive application consists of only one job step and
does not have any checkpoint algorithms or BDS. You need to simply specify the
controller bean and the CIWork class to be used and the properties to be passed
to the job step.
Example 8-3 shows the structure of the xJCL for a compute-intensive application.
Element:<job-step>
The <job-step> element has one attribute.
The name attribute defines the name of the job step. This name can be
specified arbitrarily.
Element: <props>
The <props> element has no attributes. It has the following sub-element:
<prop> This element can have 0 or more <prop> sub-elements.
Element: <prop>
This element has two attributes:
The name attribute defines the name of the property.
The value attribute defines the value of the property.
Part 3 Data-intensive
application
extenders
The WebSphere Extended Deployment ObjectGrid is a high performance
distributed transactional cache for storing Java objects that can greatly improve
application performance and scalability. ObjectGrid can be used in the following
ways:
To improve the interaction between application services and underlying data
sources for data-intensive applications.
To reliably manage short-living session data within the application tier,
removing the need to store the session data in a hardened data source.
To accelerate SOA calls by utilizing distributed caching to cache previous
SOA calls to back-ends.
In this chapter we discuss the use of the ObjectGrid to store HTTP session
objects and work through setting up a simple example. This chapter contains the
following topics:
Session objects
ObjectGrid session management
Example - Single server
XML file inter-relationship
Example: sharing session objects among applications
Example: ObjectGrid on separate server
Adding a replica
You may consider using ObjectGrid for session management for the following
reasons:
You already have an existing ObjectGrid environment and can make
further use of it for managing session objects.
You have a requirement to share session objects across applications.
You need session failover capabilities that use a reliable (think
guaranteed) session persistence mechanism.
Note: Before using ObjectGrid for HTTP session objects you should obtain
fixes for the following and install on all WebSphere Application Servers or
Mixed Server Environment installations that will be used:
APAR PK35502
APAR PK35551
APAR PK35503
build.xml
Contains the customization properties in XML format, and is used if you use
the ANT option to modify the web.xml file.
objectgrid.cluster.xml
This file is referred to as the ObjectGrid cluster file. It describes the
ObjectGrid cluster configuration, for example, what servers are in the
ObjectGrid.
objectgrid.maps.xml
This file is referred to as the ObjectGrid configuration file. The purpose of this
file is usually to describe how your application will use the ObjectGrid.
However in this case, it is not your application that is directly using the
ObjectGrid, but rather the Extended Deployment HTTP Session Manager that
is. As such, this sample file is configured to work with the Extended
Deployment HTTP Session Manager. For the purposes of setting up a simple
example, it does not need to be changed.
splicer.properties
This file contains configuration values that are stored in the web.xml file of the
application.
ogDemo2
Application
- Create session object
ObjectGrid
Server: server1
ObjectGrid
Session
client
object
For this example, we developed a small application that creates a session object
with a few attributes. This application is called xd-ObjectGrid. Later, when we
After pressing the Submit button in the application once, we obtained the display
shown in Figure 9-3.
Table 9-1 on page 310 describes the fields displayed by the application.
Installing the sample application as-is was done just to ensure that it worked
cleanly before we started bringing ObjectGrid into the picture.
We copied it from its default location to a new directory on the machine, which
was:
C:\ogSmSample\objectgrid.cluster.xml
to
objectGridClusterConfigFileName =
C:\\ogSmSample\\objectgrid.cluster.xml
To have the session objects for an application saved to the ObjectGrid requires
the application EAR or WAR file to be modified. A Web application is packaged in
a WAR file, which contains a file called web.xml. The web.xml file contains
information about the application such as URL to servlet mappings, resources,
and security.
The web.xml file must be modified so that session objects created by the
application are stored in the ObjectGrid.
C:\ogSmSample\xd-objGrid.ear
C:\ogSmSample\original-xd-objGrid.ear
Example 9-3 shows the command we issued to run the splicer and the output
produced.
Example 9-4 shows the additional XML added to the web.xml file as a result of
running the splicer.
<param-value>com.ibm.ws.httpsession.NoAffinityManager</param-value>
</context-param>
<context-param>
<param-name>objectGridClusterConfigFileName</param-name>
<param-value>C:\ogSmSample\objectgrid.cluster.xml</param-value>
</context-param>
<context-param>
<param-name>objectGridName</param-name>
<param-value>session</param-value>
</context-param>
<context-param>
<param-name>persistenceMechanism</param-name>
<param-value>ObjectGridStore</param-value>
</context-param>
<filter>
<description>Filter that provides for an ObjectGrid based
Session Manager.</description>
<display-name>HttpSessionFilter</display-name>
<filter-name>HttpSessionFilter</filter-name>
What the splicer did is to add every property from splicer.properties file to the
web.xml file. Note that the supplied sample has all possible properties specified,
most with the default values. If you are prepared to use the default values then
you could remove these from the splicer.properties file.
Table 9-2 on page 316 lists the Java properties to be added to the WebSphere
server definition. The settings were added by selecting Application servers →
area302-a → Process Definition → Java Virtual Machine in the administrative
console and entering the values in the field labeled Generic JVM arguments. A
space serves as the delimiter between arguments.
Tip: Instead of adding generic arguments, you could instead add Custom
Properties on this same panel by selecting Custom Properties → New. The
property name is the Java property name and the value you want to set it to.
We then recycled the server. Example 9-5 shows the messages written to the
SystemOut.log showing the startup of the ObjectGrid server.
To verify the ObjectGrid server was listening on the port that we specified, we
issued this a netstat -an command and saw the following results:
TCP 0.0.0.0:12572 0.0.0.0:0 LISTENING
Session trace
We then wanted to verify that the session object for the application was indeed
being written to the ObjectGrid server. To do this, we added these trace settings
to the server runtime configuration:
session=all: session.http=all
Example 9-6 shows a small extract of trace from running one request.
We then ran the original application which was not modified to use the
ObjectGrid, in the same server, and no trace messages were produced,
indicating it was not interacting with the ObjectGrid.
In the Tivoli Performance Viewer, there are two entries under Performance
Modules related to ObjectGrid:
objectGridModule
The objectGridModule data shows the average transaction time.
Figure 9-4 shows a portion of the Tivoli Performance Viewer display, showing the
datagrid.session.global.ids value.
web.xml
<param-name>objectGridClusterConfigFileName
<param-value>C:\ogSmSample\objectgrid.cluster.xml
<param-name>objectGridName</param-name>
<param-value>session
objectgrid.maps.xml
Application a1
<objectGrids>
<objectGrid name="session">
XD Session Manager a2 <backingMap name="datagrid.session.global.ids"
ObjectGrid client a3
ObjectGrid Server s1 s2
server1
objectgrid.cluster.xml
<objectgridBinding ref="session">
<mapSet name="myset" partitionSetRef="p1"
<map ref="datagrid.session.global.ids" />
</objectgridBinding>
s3
<partitionSet name="p1">
<partition name="1" replicationGroupRef="r1" />
s4
<replicationGroup name="r1" maxReplicas="2" minReplicas="0">
<replicationGroupMember serverRef="server1" priority="1" />
Why would you want to share a user’s session object across multiple
applications? If you have customers using your Web site accessing multiple
applications, allowing the session objects to be shared can create a better user
experience.
Cookies are tied to domain names. For example, if a user receives a cookie from
www.test.co, if they then access a site at www.sample.co, the cookie received
from www.test.co is not sent to www.sample.co.
The way the end users use their browser is also important. Take, for example, an
user who is accessing application A and application B from a Microsoft Internet
browser. The user clicks the Microsoft Internet browser icon to open a new
browser window and accesses application A, creating a new session object. The
user now wants to access application B. If the user opens a new window by
clicking the Microsoft Internet browser icon to access application B, a new
session object is created. This is because the two browser windows are not
sharing session objects that they create. The second browser window does not
know there is a cookie in the first browser window since the JSESSIONID cookie
is stored in memory only. If you plan to share session objects across
applications, then you need to train the end users not to use this approach. If
9.5.3 Topology
For this example we use the same topology we used in 9.3, “Example - Single
server” on page 308.
9.5.5 Testing
We first modified the web.xml file fro ogDemo2 and re-installed it to the
application. We then installed a copy of ogDemo2 on the area302-a server,
calling it ogDemo4 and setting the context root to ogDemo4. We stopped and
started the server.
To test the session object sharing, we first accessed ogDemo2 using the
following URL:
http://itsonode1:9088/ogDemo2/ObjGridSessionDemo
We clicked the submit button a few times, obtaining the display shown in
Figure 9-6 on page 325.
We then selected File → New Window and accessed ogDemo4 using the
following URL:
http://itsonode1:9088/ogDemo4/ObjGridSessionDemo
Note that the value for New session created is False, indicating that when the
second copy of our sample application was run, it used the existing session
object created by running the first copy of our sample application. Also the value
for count increased by 1 and not reset to 1, as would have been the case if the
session object was not shared.
ogDemo2
Application
- Create session object
ObjectGrid
Server: server1
ObjectGrid
Session client
object
To do this all that was required was to start a Java process, passing in the
ObjectGrid related properties, and making available the ObjectGrid product
companionate.
Installation
When running the ObjectGrid outside of a WebSphere cell, you need to install
the ObjectGrid feature that is shipped with the WebSphere Extended
Deployment Mixed Server Environment. You need version 6.0.1 or better of this
component as the ObjectGrid feature is not present in version 6.0.0.
The install process is straight forward. Be sure to install any applicable fixes (see
the Note box on page 306).
C:\>C:\zProducts\MixedServer\ObjectGrid\bin\startOgServer.bat server1
-objectgridFile C:\ogSmSample\objectgrid.maps.xml -clusterFile
C:\ogSmSample\objectgrid.cluster.xml
************ Start Display Current Environment ************
Host Operating System is Windows 2003, version 5.2
Java version = J2RE 1.4.2 IBM Windows 32 build cn142-20050609 (JIT
enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
was.install.root = null
user.install.root = null
Java Home = C:\IBMJava142\jre
ws.ext.dirs = null
Classpath =
C:\zProducts\MixedServer\ObjectGrid\lib\objectgrid.jar;C:\zProducts\
MixedServer\ObjectGrid\session\lib\sessionobjectgrid.jar;C:\zProducts\M
ixedServer\ObjectGrid\lib\asm.jar;C:\zProducts\MixedServer\ObjectGrid\l
ib\cglib.jar
Java Library path =
C:\IBMJava142\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Progra
m Files\Windows
ResourceKits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\
Wbem;C:\Program Files\ObjREXX;C:\Program
Files\ObjREXX\OODIALOG;C:\Tools;C:\IBMJava142\bin
Current trace specification = *=all=disabled
************* End Display Current Environment *************
[11/3/06 16:52:08:062 EST] 26f0003d ManagerAdmin I TRAS0017I: The
startup trace state is *=all=disabled.
[11/3/06 16:52:09:094 EST] 26f4003e Launcher I CWOBJ2501I:
Launching ObjectGrid server server1.
Note that when you want to stop this server, you use the following command:
C:\>c:\zProducts\MixedServer\ObjectGrid\bin\stopOgServer.bat server1
-bootstrap localhost:12572
to
<serverDefinition name="server1" host="ITSOnode2"
clientAccessPort="12572"
We ran the application a few times to verify that the session object stored in the
remote ObjectGrid server was being correctly updated.
In the ObjectGrid cluster file, partition sets are defined which are backed by the
servers in the replication group element. Any number of servers can be defined
in the replication group element, but only one runs as the primary server. Any
other servers run as replicas or standby servers. Updates that need to be done to
objects in the partition set backed by the replication group are applied to the
primary server.
More then one replica can be defined. For example, you may want to define
more then one replica if you have an application that makes a large number of
read-only calls for objects, as these calls can be sent to any server in the
replication group.
9.7.2 When does the replica get updated from the primary?
When the primary server is updated, this update needs to flow to all replicas.
Which leads to the question, when will this updating of the replicas occur? This
depends on whether you specified synchronous or asynchronous for the
replication setting.
If the object update is being done as a part of a synchronous call from the
ObjectGrid client, then control does not return to the caller until the update
occurs on the primary server and all replica servers in the replication group.
With regard to session objects, the setting that controls when the session objects
are written to the ObjectGrid servers is set in the web.xml using the following
setting:
<context-param>
<param-name>replicationType</param-name>
If set to synchronous, then a servlet waits for the session object to be written to
the primary server and any replica servers before completing.
Note: When using replicas the ObjectGrid servers must be of the same type,
meaning they must be all WebSphere application servers or all stand-alone
servers in the Mixed Server Environment (MSE).
Important: The primary server and at least one replica server must be active
before the ObjectGrid servers consider themselves to be completely
initialized.
ogDemo2
Application - Create session object
ObjectGrid client
ITSOnode4 ITSOnode2
ObjectGrid ObjectGrid
Server: server1-R Server: server1
<partitionSet name="p1">
<partition name="1" replicationGroupRef="r1" />
We then stopped and started the WebSphere server that runs the application,
namely Area302-a that runs on ITSOnode1 to pick up the change to the
ObjectGrid cluster file.
Part 4 Appendix
A sample Perl script is included to illustrate how to process logs using scripts:
Perl script to calculate CPU utilizations
BusinessGridStatsCache
DeploymentTargetStatsHistoricCache
The contents of these files are similar but not identical. The fields are ordered
differently and some fields appear only in one of the logs. Confusingly, some
fields in TCModuleInstanceStatsCache contain invalid values.
gwid Gateway ID
FineGrainedPowerConsumptionStatsCache
workfactor The estimated work factor from the work profiler for
the request type. See “Calculating compute power
consumed” on page 67.
ServerPowerConsumptionStatsCache
Important: This code sample is provided “as is” to illustrate a technique you
might choose to use. It has not been thoroughly tested. It assumes that there
are only dynamic clusters in the environment, and so it will not provide the
compute power metric for static clusters or singleton servers. Also, it assumes
that the time stamp is a single field. If you choose to use some of or all of this
sample, you are responsible for ensuring that it meets your requirements and
for testing.
Example: A-1 Sample Perl script for calculating CPU utilization by clusters
#!/usr/bin/perl
$|=1;
$ss_file = "ServerStatsCache.log";
$ns_file = "NodeStatsHistoricCache.log";
$ds_file = "DCStatsCache.log";
$done = 0;
$record_index = 0;
while (!$done)
{
undef @ss_record;
undef @ns_record;
$ss_timestamp = get_record("ss");
$junk = get_record("ns");
# parse ss lines
undef %data_cluster;
$size = $#{$data_cluster{$cluster_name}};
$data_cluster{$cluster_name}[$size+1] = $ss_record[$i];
}
else
{
}
}
for $i (0..$#{$data_cluster{$cluster}})
{
$weight = $fields[$ss_weight_idx];
}
}
# calculate utilization
$sum_numer = 0;
$sum_denom = 0;
undef %count_nodenames;
for $i (0..$#{$data_cluster{$cluster}})
{
@fields = split(/,/, $data_cluster{$cluster}[$i]);
$node = $fields[$ss_node_idx];
$count_nodenames{$node}++;
$cpu = $fields[$ss_cpu_idx];
$nodespeed = $data_node{$node};
$sum_numer += ($nodespeed * $cpu);
# if haven't already encountered this node, add it to the
sum
if ($count_nodenames{$node}<=1)
{
$record_index++;
}
close (SS);
close (NS);
sub get_record
{
my ($flag) = @_;
my $done = 0;
my $j=0;
my $ss_timestamp=0;
if ($flag eq "ss")
{
$j=0;
if (defined($ss_record[$j] = <SS>))
{
@fields = split(/,/, $ss_record[$j]);
$ss_timestamp = $fields[$ss_timestamp_idx];
$done=0;
while(!$done)
{
$temp = <SS>;
}
}
else {return -1;}
}
elsif ($flag eq "ns")
{
$j=0;
if (defined($ns_record[$j] = <NS>))
{
@fields = split(/,/, $ns_record[$j]);
$ns_timestamp = $fields[$ns_timestamp_idx];
$done=0;
while(!$done)
{
$temp = <NS>;
@fields = split(/,/, $temp);
$ns_timestamp_temp = $fields[$ns_timestamp_idx];
if ($ns_timestamp_temp eq $ns_timestamp)
{
$j++;
$ns_record[$j] = $temp;
}
else
{
$done=1;
}
}
}
else {return -1;}
}
else
{
return $ss_timestamp;
}
sub get_header_index
{
my ($label, $header) = @_;
my $index = -1;
my $i = 0;
The publications listed in this section are considered particularly suitable for a
more detailed discussion of the topics covered in this redbook.
IBM Redbooks
For information about ordering these publications, see “How to get IBM
Redbooks” on page 360. Note that some of the documents referenced here may
be available in softcopy only.
Using WebSphere Extended Deployment V6.0 To Build an On Demand
Production Environment, SG24-7153
WebSphere Application Server V6 System Management & Configuration
Handbook, SG24-6451
WebSphere Application Server V6.1: System Management and
Configuration, SG24-7304
Online resources
The following Web sites are also relevant as further information sources:
ObjectGrid Programming Guide
http://www-1.ibm.com/support/docview.wss?uid=swg2700632
WebSphere Extended Deployment Information Center
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp
WebSphere Application Server Information Center V6.1
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp
WebSphere Application Server Information Center V6.0
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp
Solving Business Problems with WebSphere Extended Deployment
http://www-128.ibm.com/developerworks/websphere/library/techarticles
/0606_antani/0606_antani.html
IBM Tivoli Usage and Accounting Manager
http://www-306.ibm.com/software/tivoli/products/usage-accounting/
Index 363
getAlgorithmName() 276, 279 identifier fields 97
getName() 274 IIOP pattern 160
getProperties() 271, 274 importance 13, 29–30, 55–56, 158–159
getRecommendedTimeOutValue() 263–264, 267, importance. 13
277 in-flight request search 118
getRemoteAddr() 40 initialize() 261–262, 273–274, 276, 278
global transaction 223, 244, 253–256, 263–265, installation 32
267–268, 275, 277 Integrated Development Environment 192
global transaction boundaries 254 integrated test environment 191
global transaction, 265 integrated test server 191
goal 42, 47, 55, 104, 158–159 Interim Fix 192
gridapis.jar 204, 291 interMediateCheckpoint() 253
gridendpointselector.jar 191, 195 intermediateCheckpoint() 264–265, 267, 274
gwid 345, 347, 349 internalizeCheckPointInformation() 274
internalizeCheckpointInformation() 262, 273
interval 275
H isDaemon() 295
HA manager 146
isDBNode 343
health condition 111, 114
IT usage metric 65
health controller 106–107, 110, 162
IT usage metrics 64
health controller runtime tasks 112
ITCAM for WebSphere 117, 119
health controller settings 110
ITUAM 67, 73, 76, 87–88
health management 102, 105, 107
ITUAM Administrator 88
health management log 111
ITUAM Universal Data Collector 94
health management subsystem 107
ITUAM Web Reporting 88, 99
health monitoring
enable 110
health policies 107–109, 113, 161 J
health policy 114, 116 J2C authentication alias 170, 180, 199
health policy violation 109 J2EE skill 141–142
heap analysis 118 j2eemodname 340, 346–347
heap dump 109, 118 Java Build Path 226
heap size 108 Java build path 204, 206, 211, 291
high availability 142, 156 Java SDK 192
highMemMark 342, 344 Java Virtual Machine (JVM) 141
HTTP matching pattern 14 java.lang.Runnable 298
HTTP request 38 java.sql.Connection 254
HTTP Session Manager 307 JDBC provider 170, 179–180, 199
HTTP Session Manager facade 306, 318 job 140, 145, 154, 157–158, 187, 209, 216, 289
HTTP Web container transport 175, 182 job dispatcher
HttpSessionRequestWrapper class 318 145
hung JVM 114, 129 Job Management view 149
hung server 109 job name 208
job scheduler 143
job state 154–156
I job steps 152
IBM Caching Proxy 15, 21–22
jobID 243, 249, 262, 269–270
IBM HTTP Server 15–16, 18, 35
jobs 69
IBM Tivoli Usage and Accounting Manager 61–62
JobScheduler interface 151
IBM Tivoli WebSEAL 15, 17
Index 365
nodeName 342–343 ODR proxy port 20
nodepower 78–79, 350–351 OLTP 142
nodeSpeed 343 on demand router 6–8
NodeStatsHistoricCache 68–69, 72, 74, 80, 85–86, one-phase commit 255
343 online transaction processing (OLTP) 141
NodeStatsHistoricCache log 69 open() 262, 274
NodeStatsHistoricCacheLog 344 operational mode 51
nodeworkpotential 78–79, 350–351 operational policies 157
non-functional requirements 104 Operational Policies console option 34
notification 105, 115
num_completed 340
num_dispatched 340
P
partition map 322
num_errors 341
partition set 332
num_failed 341
partitionSet 322
num_queued 340
pcatWindows.exe 166
num_requested 340
pending state 111
Number of dispatched requests 70
Percentile Response Time 47
number of dispatched requests 70
performance 102
number of requests 69, 72, 83
performance analysis 130
Number of requests dropped 70
performance goal 11
Number of requests serviced 70
performance metrics 68
number of requests serviced 70
performance monitoring 102
numserviced 78, 350
Performance Monitoring Infrastructure 319
performance statistics 67
O Perl 68, 73
Object Request Broker (ORB) 157 plug-in 39
ObjectGrid 303, 305–306, 308–309 plugin-cfg.xml 39
ObjectGrid client 330, 332 PMI 318
ObjectGrid client code 322 policy condition 114
ObjectGrid cluster file 307, 310, 312, 316, port 322
321–322, 329–330, 332, 334 positionAtCurrentCheckpoint() 262, 274
ObjectGrid configuration file 307, 311, 316, positionAtInitialCheckPoint() 262
321–322 positionAtInitialCheckpoint() 274
ObjectGrid server 306, 315, 317, 322, 327, PostingsSample 211, 215
332–333, 335 PostingsSampleEJB 211–213
ObjectGrid trace and log files 329 power consumed 70–72, 87
objectgrid.cluster.xml 307, 311, 321 power statistic 67
objectgrid.maps.xml 307, 321 powerconsumed 78–79, 92, 97, 350–351
objectgridBinding 322 PPECONTROLLER 125
objectGridClusterConfigFileName 315 PPPROBE 125
objectGridModule 319 prefer local 24
odeworkpotential 78 primary server 332–333
ODR 6, 12–13, 15, 18–19, 21–22, 35, 38–39, 68, priority level 153
70, 157, 161, 345–346 problem detection and avoidance 103
odr 349 problem determination 129
ODR ports 37 processJobStep() 223, 245, 251, 254, 263–265,
ODR proxy log 38 271, 276
ODR proxy plug-in 39 profile 32–33
R S
schedule() 261
Rate code 92
scheduling mode 282
Rational Application Developer 104, 190–191
SCHEMA 169
Rational Product Updater 192
schema 183, 202, 213, 236
RDB 236
scname 340, 346–347
reaction mode 106, 110, 114, 116
security 142, 153
recent activity display 118
sequence of events 134
record-based checkpoint algorithm 275–276
sequential scheduling mode 282
recordcount 276
server 340, 347, 349
Redbooks Web site 360
server activity display 118
Contact us xvii
server age 109
Refresh Pack 194, 196
server information 126
relative importance 11
server reports 118
release() 295
server restart 109, 111, 114, 116
replica 332–333
server start time 126
replication 304–305
server statistics 69, 128
replication setting 332
server statistics overview 118
report 99
server template 173, 181
request rate 30
server work volume 109
request timeout 109, 114
ServerPowerConsumptionStatsCache 68, 71–72,
request.getRemoteAddr() 40
75, 78, 80, 85, 87, 351
residentMemory 344
ServersStatsCache 80
resource authorization 183
ServerStatsCache 68–69, 72, 74, 80, 85, 344
resource reference 239–240, 252, 261
service class threshold 70
resource utilization 67
service level 5, 9
resources 128
service level agreement 4
Response time 70
service level goals 8
response time 12–13, 29–30, 62, 64, 70, 83, 106,
service level optimization 4, 6, 8
109, 114, 127
service polices 15, 30
response time metric 130
service policies 7–8, 10–12, 15, 25, 27, 30, 43–44,
resptm 346, 348
145, 153, 158
restart timeout 111
service policy 12–13, 24, 45, 48, 55–56, 70, 106,
Restartable job state 155–156
158–160
results algorithm 221–222, 224, 246, 278, 281
Index 367
Service Policy Topology 44 systems resource comparison 118
serviced 347–348
servicepolicy 349
servicetm 346, 348
T
task alert 51–52
session object 304
TCM 70
session object sharing 324
tcmodname 97, 345, 347, 349
session pooling 142
TCModuleInstanceStatsCache 68, 70, 72, 75, 82,
session replication 304
84, 345, 347
setProperties() 262, 271, 273–274, 289
TCModuleStatsCache 68, 70, 72, 75–76, 82, 345
setupLongRunning.py 167–168, 173, 178–179,
tcname 340, 346–347, 349
181, 184
test environment 104
SeverStatsCache 80
thread dump 110, 115–116, 129
shared infrastructure 63
throughput 106, 127
shareSessionsAcrossWebApps 324
TierStatsCache 68, 70
sharing scope 241, 252
time-based checkpoint algorithm 275–276, 283
ShouldCheckpointBeExecuted() 276
timeStamp 340, 342–345, 347, 349, 351
shouldCheckpointBeExecuted() 264–265
timestamp 75–76, 79–80
SimpeCI 205
Tivoli Performance Viewer 318–319
SimpleCI 86, 160, 185, 207–209
totalMemory 344
SimpleCIEar 186
totalMethodCalls 344
SimpleCIEJB 185
totalRequests 344
SimpleDateFormat class 75
traffic 106
SLA 4, 27, 62, 64, 66
transaction boundary 224
SMTP 113
transaction class 8, 11, 13, 15, 25, 31, 41–44, 48,
SNMP 104
55, 70, 78, 159–160, 345
SNMP Alert 118
transaction class application module 82
speedReq 342
transaction class module 67, 345
splicer 312–313, 315
transaction class module name 345, 349
splicer.properties 307, 312
transaction support 142
spreadsheet 68
transactional 104
SSL 38
TransactionTimeout 275
startCheckpoint() 263–264, 277
trap and alert management 118
startJob() 289
trends analysis 118
startManager.bat 166
troubleshooting 121, 129
startup bean service 191
trusted server 40
startup beans service 174–175, 178, 182, 200
two-phase commit 256
stepID 243, 249, 262, 269–270
type 4 driver 171
stopCheckpoint() 263–265, 268, 277
storm drain detection 109
stress test 65 U
submitJob() 223, 261 units of work 144
Submitted job state 155–156 UNIVERSAL_JDBC_DRIVER_PATH 199
superclass 232 updateTime 340, 344
supervise mode 105–106, 109–110, 113–114, 116, uptime 344
158, 174 usedMemory 343–344
supervised mode 51–52
Suspended job state 155
V
Sysplex Distributor 6 variable 199
system health 102
W
waittm 346, 348
wasBackground 343
WC_defaulthost 175, 182, 210
Web container 161
Web server plug-in 16, 18
Web service Interface 151
Web service interface 153–154, 157, 175
Web services 142
web.xml 312–313, 315, 324, 332
WebSEAL 21
weight 344
WLM 6
wm/BatchWorkManager 241–242, 261
wm/CIWorkManager 293
work class 11, 14–15, 25, 31, 41, 48, 55–56, 160
work completed 67–68, 70–72
Work factor 70
work factor 67–68, 70, 72
work manager 293
work profiler 68
workcompleted 78–79, 350–351
workfactor 78, 350
workFactors 347–348
workload 6
workload condition 161
WorkManager 241, 261
X
XA data source 171, 199
XA recovery 200
xdaugment 33, 36
xJCL 148, 150, 152–153, 186, 206–208, 214–216,
220, 223, 239, 246, 248, 262, 273–274, 279, 283,
288–290, 296, 298
Index 369
370 Best Practices for Implementing WebSphere Extended Deployment
Best Practices for Implementing WebSphere Extended
(0.5” spine)
0.475”<->0.875”
250 <-> 459 pages
Back cover ®