Beruflich Dokumente
Kultur Dokumente
Activity Guide
D61529GC20
Edition 2.0
January 2011
D69372
Disclaimer
This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.
The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.
Restricted Rights Notice
If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS
The U.S. Governments rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted
by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.
Trademark Notice
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.
Author
Shankar Raman
Technical Contributors and Reviewers
Bala Kothandaraman, Matthew Slingsby, Serge Moiseev, Nagavalli Pataballa, Werner Bauer,
TJ Palazzolo, Nicole Haba, Madhavi Siddireddy, Pete Daly, Sebastian Colas
This book was published using:
Oracle Tutor
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Copyright 2010, 2011 Oracle and/or its affiliates. All rights reserved.
Oracle WebLogic Server 11g: Monitor and Tune Performance Table of Contents
i
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Table of Contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 1
Chapter 1 - Page 1
Practices Overview
Lab Familiarity
The lab uses a Linux machine. The instructor will give you the operating system usernames and
password to be used by your team.
The key tasks you perform in this practice are:
Path
Database
(ORACLE_HOME)
/u01/app/oracle/Database/11.2.0/orcl
<Middleware_HOME>
<MW_HOME>
/u01/app/oracle/Middleware/11.1.1
<WL_HOME>
<MW_HOME>/wlserver_10.3
<STUDENT>
/home/oracle/wls11g_tune
<CURRENT_LAB>
<STUDENT>/labs/labXX_YY,
/u01/app/work
<DOMAIN_HOME>
<LAB_WORK>/domains/MedRecDomain
/ptcourse
/
<GRINDER_HOME>
/u01/app/opensource/grinder-3.2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
1.
2.
Make sure that your machine is powered on. Log in as the oracle user with the password
provided by your instructor.
After you have logged in to the desktop, you may want to get familiar with the desktop
interface.
a. You will notice four palettes at the bottom right of your remote machine. Each of them
represents a desktop on the remote machine.
b. For your convenience, you can invoke different applications to full screen on each
desktop appropriately.
1) You can invoke a gnome-terminal on the first desktop by using the Terminal icon
on the desktop.
2) Invoke a Web browser on the second desktop by using the icon on the menu bar.
3)
3.
Invoke a file browser in the third desktop by using Applications > System Tools >
File Browser.
Oracle Database 11g and Oracle WebLogic Server 11g are already installed and
configured in your machine. Using the File Browser, navigate through the installation and
configuration directories.
a. Using the File Browser, navigate the File System tree to the
/u01/app/oracle/Database/11.2.0/orcl folder. This folder is the
ORACLE_HOME folder for the database. The executables and main configurations for
database are in this folder.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4.
Using the gnome-terminal session, perform the following steps to get familiar with the
scripts that you will use in the practices.
a. The wls11g_tune/bin folder contains the scripts and tools to start and stop the
database and the WebLogic server instances that you will use in the practices for this
course.
b. Navigate to the wls11g_tune/bin subfolder in your $HOME folder (/home/oracle) and
list the files in this folder:
$> cd /home/oracle/wls11g_tune/bin
$> ls
c.
Execute the ps command to check whether the database is running. If it is not running,
use the start_db.sh script to start the database.
$> ps ef | grep pmon
Note: If the preceding command does not return the ora_pmon_orcl row, you must start
the database using the start_db.sh script.
$> start_db.sh
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 2
Chapter 2 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Skills Learned
At the end of this practice, you should be able to:
You see a window titled MedRecDomain open that has the Admin Server start up.
Similarly, you see another window open with title MedRec Server1. When prompted, enter
the username weblogic. Then enter the password Welcome1.
The process will complete in about five minutes.
c. When you see that the MedRec Server 1 is in the RUNNING state in the window titled
MedRec Server 1, verify that you can use the Medical Records application in your Web
browser by accessing the following URL:
http://localhost:7021/medrec/index.action
d. Log in as the patient fred@golf.com with the password weblogic.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practice 2-1: Setting Up and Using The Grinder for Load Testing
Configure the TCP proxy for The Grinder and start it to enable you to record test scripts.
a. Close all the Firefox windows in your system.
b. In a shell window, navigate to the Firefox configuration subfolder in the
/home/oracle/.mozilla/firefox folder (such as
/home/oracle/.mozilla/firefox/gc102iya.default), and copy prefs.js
to prefs.js_BAK.
$> cd /home/oracle/.mozilla/firefox/gc102iya.default
$> cp prefs.js prefs.js_BAK
c.
d.
3.
Invoke Firefox and navigate to the Network tab by using Edit > Preferences >
Advanced > Network.
Click the Settings button and edit the following values. Then click OK and finally click
Close.
Field
Value
HTTP Proxy
localhost
Port
8001
No Proxy For
<empty>
e.
f.
Restart Firefox. You receive an error because the proxy server is not yet running.
Invoke another gnome-terminal window and run the following command:
$> source set_course_env.sh
g.
Start the TCP proxy for The Grinder to begin recording the test script. Navigate to the
/home/oracle/wls11g_tune/labs/lab02_01/grinder folder and execute the
following:
$> source ./setEnv.sh
$> java net.grinder.TCPProxy -console -http >
viewrecords-updateprofile.py
h.
i.
Access the application and perform test tasks to record the test scripts.
a. Invoke Firefox and access the following URL:
http://localhost:7021/medrec/index.action
b.
c.
d.
e.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2.
4.
In The Grinder Console, set the following: (Note that the console may show Collect
samples forever. It will change to Stop after ... when you enter the value 1000.)
Sample Interval
1000 ms
Ignore
0 Samples
Stop after
1000 samples
c.
d.
e.
f.
Confirm that your agent started successfully and that it discovered your console:
(agent): connected to console at localhost/127.0.0.1:6372
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f.
g.
h.
i.
j.
5.
d.
e.
f.
g.
On the Results tab of The Grinder Console, locate the Successful Tests column.
When most of the rows are within the range after about 35 minutes, click Stop
Collecting and, if necessary, select Stop processes on the task menu.
Return to the gnome-terminal in which you initiated The Grinder agent, and verify that
the test script completed:
11/5/09 2:36:04 PM (agent): finished
Record the following values found in the Total row of results table of the console:
Number of
Successful Tests
6.
Number of Errors
Mean Response
Time (ms):
Mean TPS
h. Close The Grinder console (using File > Exit on the menu).
Modify the server heap settings and perform the test again so that you can compare the
results.
a. Stop the managed server by using the stop_mr1.sh script. Enter the username and
password when prompted.
$> stop_mr1.sh
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Within the same terminal, ensure that you use Sun as the JAVA_VENDOR, set the
memory options, and start MedRecSvr1 using the following:
$>export JAVA_VENDOR=Sun
$> USER_MEM_ARGS="-Xms512m Xmx512m XX:MaxPermSize=256m"
$> export USER_MEM_ARGS
$> cd /u01/app/work/domains/MedRecDomain/bin/
$> ./startManagedWebLogic.sh MedRecSvr1 t3://localhost:7020
c.
7.
Inspect the servers output to verify that the new heap settings are in tune with the
USER_MEM_ARGS parameter.
Repeat step 4 (Start The Grinder Console) and step 5 (Run the test case and record the
performance metrics). Re-enable data collection in The Grinder Console.
a. Compare the performance (Mean Response Time and Mean TPS).
b.
This practice was developed and tested using a machine with one CPU and 4 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 2 - Page 8
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 3
Chapter 3 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Overview
The performance of the WebLogic Server instances can be tuned by tuning the underlying
JRockit JVM. The tools provided by the JVM will come in handy while monitoring the JVM. The
WebLogic Server runs out of memory for any number of reasons. Memory leaks present in the
application code deployed on the WebLogic Server can also cause the server to perform poorly
and eventually run out of memory.
This practice uses a sample Web application that triggers some data allocation onto the Java
heap. The JVM heap size is configured iteratively to best address performance needs.
User credentials
Username
Password
weblogic
Welcome1
Domain configuration
Type
Name
Address
Port
Admin Server
adminserver
localhost
7001
Managed Server
mainserver
localhost
7003
The JRockit Management Console is used to manage and monitor the JRockit JVM. You can
monitor memory, CPU, heap, and GC information.
1. Set up the practice domain (ptcourse) and deploy the practice application.
a. Launch gnome-terminal and run the following command:
$> source set_course_env.sh
Start the Administration Server, for the ptcourse domain. Then set the Xmanagement
option and start the main server (the managed server in the ptcourse domain). Then
using the Administration Console, deploy it using the JRockit JVM with the -Xmanagement
option turned ON.
a. In the gnome-terminal, run the start_ptadm.sh script from the exercise subfolder.
$> cd ~/wls11g_tune/labs/lab03_01/exercise
$> gnome-terminal e ./start_ptadm.sh
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Set the JAVA_VENDOR and JAVA_OPTIONS environment variables using the following
commands:
$> export JAVA_VENDOR="Oracle"
$> export JAVA_OPTIONS="$JAVA_OPTIONS -Xmanagement"
d.
3.
Run the course environment setup script and then start Oracle JRockit Mission Control
using the following commands:
$> source set_course_env.sh
$> $MW_HOME/jrockit_160_17_R28.0.0-679/bin/jrmc
c.
In the JVM browser of Oracle JRockit Mission Control running, right-click the instance
with the process number that is running mainserver, and click Start Console.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
4.
On the Runtime page, click the Memory tab and note the Garbage Collection strategy
currently being used.
Run a stress test by invoking The Grinder by using the following command:
java net.grinder.Grinder grinder.properties
Note: You are not using The Grinder Console because you are only simulating some load
on the server and not looking at the response time or throughput for now.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
5.
An application has just been developed and you have the task to deploy it and do performance
testing before it goes live.
To be able to test your application, you have developed a simple driver that will simulate the
market and the client. The goal is to be able to handle 100,000 messages per second with a
good response time.
You performed the tests by using the JFR, and recorded the performance metrics. All
associated JFR recordings are located in the JFR_RECORDINGS subfolder and named with
the corresponding number of the section they are associated with.
1. Without much tuning information, you had started up the server with the parameters in the
development environment. The results are in the JFR_RECORDINGS folder as 1.jfr. Try
to analyze the results and discuss them in the classroom.
a. Invoke jrmc. Using File > Open files, bring up the File Open window.
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
Navigate to the CPU/Threads page and notice that the CPU usage is generally well
over 90%.
e.
Navigate to the Memory page and notice the memory allocation, heap usage, and
garbage collection statistics
1) What are the values for initial and maximum allocations? (256 MB)
2) How many garbage collections have been completed in about 1 minute? (401)
3) What is the average pause time for garbage collection? (66.929 ms)
4) What is the total time spent in pause due to garbage collection? (401 * 66.929 ms
~ 27 sec)
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
2.
c.
d.
e.
In your Mission Control session, close all other views and load 2.JFR from the
wls11g_tune/labs/JFR_RECORDINGS folder.
Navigate to the CPU/Threads page and notice that the CPU usage is generally well
under 30%.
Navigate to the Memory page and notice the memory allocation, heap usage, and
garbage collection statistics.
1) What are the values for initial and maximum allocations? (2 GB)
2) How many garbage collections have been completed in about 1 minute? (86)
3) What is the average pause time for garbage collection? (86.794 ms)
4) What is the total time spent in pause due to garbage collection? (~7 sec)
5) Navigate to the GC Graph tab on the Memory page and note which generation is
affected mostly in garbage collection. (Old Generation)
Navigate to the Overview page and notice the average value of heap fragmentation
(30.31%) and average pause time for garbage collection (86.794 ms).
You want to reduce the heap fragmentation as well as pause time in garbage
collection. What configuration change should help reduce the heap fragmentation?
1) Change from a single GC to a generational GC. (For this application, the best
choice is to switch to a generational GC. Using a nursery results in an
indirect compaction because short-lived objects are never copied to the old
space reducing the risk of short-lived and long-lived objects residing next to
each other.)
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f.
f.
Increase the compaction ratio. (In several cases, increasing compaction will help
reduce fragmentation. The JFR shows that JRockit is compacting 128 MB each
GC. However, for this application, the allocation pattern is so mixed that this is not
enough. Increasing the area would reduce the fragmentation, but for this
application, it would not be enough).
3) Reduce the compaction ratio. (Compaction is how JRockit can reduce
fragmentation on the heap. Reducing the ratio would have the effect of further
increasing fragmentation.)
Now analyze the results by using 3.JFR from the
wls11g_tune/labs/JFR_RECORDINGS folder.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 4
Chapter 4 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Design
Overview
This practice uses a sample Web application that triggers some data allocation onto the Java
heap. The challenge of this practice is to monitor and tune the performance of the HotSpot JVM
so that the application performance is improved.
Specifications
User credentials
Username
Password
weblogic
Welcome1
Domain configuration
Type
Name
Address
Port
Admin Server
adminserver
localhost
7001
Managed Server
mainserver
localhost
7003
JMS resources
Type
Name
Target
JMS Server
PTJMSServer
mainserver
JMS Module
PTJMSModule
mainserver
Type
Name
JNDI Name
JMS ConnectionFactory
PTConnectionFactory
jms.PTConnectionFactory
JMS Queue
PTQueue
jms.PTQueue
Performance statistics
Settings
Successful
Tests
Errors
Mean Time
(ms)
Xms64m Xmx256m
Xms256m Xmx512m
Transactions
Per Second
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: If you have not already performed Part A in Practice 3, ensure that you have performed
steps 1 and 2 in Part A of Practice 3 before beginning this practice.
1. Stop all the servers in ptcourse domain.
a. Launch the gnome-terminal and run the course environment setup script.
$> source set_course_env.sh
b.
2.
Set the JAVA_VENDOR environment variable to Sun. Start the Administration Server for
ptcourse. Set the JAVA_OPTIONS as indicated in the following table and then start the
managed server.
Variable
a.
Value
JAVA_VENDOR
Sun
USER_MEM_ARGS
JAVA_OPTIONS
-Dcom.sun.management.jmxremote
b.
3.
Start Java VisualVM and monitor the performance of the mainserver JVM.
a. Start Java VisualVM by invoking the following command in a gnome-terminal: (Note:
When you start the Java VisualVM for the first time, you may get the Calibration will be
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4.
b.
Determine the pid for the mainserver by executing the following command in the
gnome-terminal window:
$> ps ef | grep java | grep mainserver
c.
Double-click weblogic.Server with the pid for mainserver to open the monitoring
page for mainserver.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
5.
Access the Monitor tab and notice the graphs relating to CPU and memory (heap)
usage.
Run a stress test by using The Grinder, and monitor the CPU and memory usage graphs in
Java VisualVM.
a. At the prompt, change the working directory to:
$HOME/wls11g_tune/labs/lab04_01/grinder
$> cd $HOME/wls11g_tune/labs/lab04_01/grinder
b.
c.
d.
Run a stress test by invoking The Grinder using the following command:
java net.grinder.Grinder grinder.properties
Note: You are not using The Grinder Console because you are just simulating some load
on the server and not looking at the response time or throughput for now.
$> java net.grinder.Grinder grinder.properties
e.
You can also use Java VisualVM to visualize the CPU and memory usage. Notice
that the CPU usage is at near 100% at times, while the used heap space reaches
100% most of the time. Also you may get occasional "Out of memory" errors in the PT
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
f.
b.
c.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Main window.
d.
Navigate to the grinder subfolder under lab04_01 and run the test again.
$> java net.grinder.Grinder grinder.properties
e.
Connect to the new managed server instance in JVisualVM and verify the CPU and
Memory usage now. Notice that the CPU usage is rarely at 100%, and also the used
heap size is generally well below the maximum.
f.
7.
c.
Navigate to the grinder subfolder under lab04_01, and run the test again.
$> java net.grinder.Grinder grinder.properties
d.
Now monitor the mainserver JVM by using JVisualVM and notice that the CPU usage
is mostly well below 50% and the heap usage is also never at 100%.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
By analyzing the test results noted for the different memory settings, specify which
setting will be optimal for better response time and throughput.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 4 - Page 10
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 5
Chapter 5 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Design
Overview
Mission-critical applications need a higher priority than other applications deployed on the same
server. The WebLogic Server allows you to configure how your application prioritizes the
execution of its work by using rules that you define and by monitoring the actual run-time
performance. You define the rules and constraints for your application by defining a Work
Manager and applying it either globally to a WebLogic Server domain or to a specific application
component.
In this practice, you use two Web applications: BrowseMarketApp and BrowseStoreApp.
You assign to BrowseMarketApp a low priority Work Manager having a low fair share, and to
BrowseStoreApp a high priority Work Manager having a high fair share.
During a period of sufficient demand when the number of requests for each application exceeds
the number of threads, the WebLogic Server allocates a higher thread-usage time to
applications (BrowseStoreApp) with a higher priority.
mainserver
Domain: ptcourse
Port: 7003
BrowseMarketApp
adminserver
Port: 7001
BrowseStoreApp
User credentials
Username
Password
weblogic
Welcome1
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Type
Name
Address
Port
Admin Server
adminserver
localhost
7001
Managed Server
mainserver
localhost
7003
Mean Test
Time (ms)
BrowseMarketApp
391.48
4500
BrowseStoreApp
462.97
4500
496.92
4500
273.70
4500
1.
Reset the ptcourse domain and then start adminserver and mainserver.
a.
b.
c.
d.
e.
f.
Verify and test the applications by opening a Web browser and navigating to
http://localhost:7003/BrowseStoreApp/ and
http://localhost:7003/BrowseMarketApp/.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Domain configuration
Run a stress test using by The Grinder. At this point, there is no Work Manager assigned to
either of the applications. Therefore, they use the default Work Manager. In this section, it
would be useful to run The Grinder for both applications simultaneously.
a. Invoke two new gnome-terminal windows. In one gnome-terminal, change the working
directory to ~/wls11g_tune/labs/lab05_01/grinder/HP. In the other, change
the working directory to wls11g_tune/labs/lab05_01/grinder/LP.
In both sessions, set up the course environment and The Grinder environment.
$> source set_course_env.sh
$> source ../setEnv.sh
c.
In both sessions, run the stress test by invoking The Grinder using the following
command:
$> java net.grinder.Grinder grinder.properties
Note: You are not using The Grinder Console because you are just simulating some load
on the server and not looking at the response time or throughput for now.
d. Watch the agent windows while the threads start running. When both Grinder agents
have finished running all threads, two new directories called WM_HP_Results and
WM_LP_Results are created in the /u01/app/work directory.
e.
3.
4.
b.
c.
d.
e.
f.
g.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2.
e.
6.
Assign the lowFairShare request class and the maxThreads constraint to the
lowPriority Work Manager.
a. In Domain Structure, navigate to ptcourse > Environment > Work Managers.
b. Click lowPriority.
c.
7.
e.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
5.
c.
d.
Open the deployment descriptor, weblogic.xml, by using a text editor. Insert the
following line to reference the lowPriority Work Manager, and then save and
close the file:
<wl-dispatch-policy>lowPriority</wl-dispatch-policy>
c.
9.
In the Administration Console, click Lock & Edit in Change Center. Then navigate to
ptcourse > Deployments in the domain structure.
d. In Summary of Deployments, select the BrowseMarketApp check box and click
Update.
e. Accept the defaults and click Finish.
f. Activate the changes in the Change Center.
g. Open a Web browser and navigate to http://localhost:7003/BrowseMarketApp/.
Browse to make sure that the application is running.
Create and assign an application-level Work Manager named highPriority for the
BrowseStoreApp application.
a. In Admin Console Domain Structure, navigate to ptcourse > Deployments. Then click
the BrowseStoreApp link in the table.
b. Navigate to Configuration > Workload and notice that there are no application-scoped
work managers.
c. Click Lock & Edit in the Change Center. Then click New in the Application Scoped
Work Managers table.
d. In the Create a New Work Manager Component wizard, enter highPriority as the
name and click Finish.
e. The Save Deployment Plan Assistant appears. In the Path field, enter
/home/oracle/wls11g_tune/labs/lab05_01/exercise/applications/HP_
Plan.xml. Then click OK. You will receive a message indicating deployment plan has
been created.
f. Now you can assign the previously created highFairShare class to highPriority
work manager. Click highPriority link in Application Scoped Work Managers.
g.
In the Settings for highPriority, select highFairShare as the Request Class. Also
select maxThreads as the Maximum Threads Constraint. Then click Save. A
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
8.
h.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 6
Chapter 6 - Page 1
Practices Overview
There is no practice for Lesson 6.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 7
Chapter 7 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Design
Overview
A Web application with several JavaServer Pages (JSPs) seems to be running slow. Web
pages take time to load on a browser when the user clicks a link or a button.
Whenever a request is made for a JSP, the WebLogic Sever translates the JSP into a servlet,
compiles the servlet code, and then serves the request. Performance of JSPs can be improved
by precompiling the JSPs, thereby avoiding the overhead for the server to compile.
In addition, the WebLogic Server can be tuned not to check to see if the JSPs have changed.
Domain configuration used in this practice:
mainserver
Domain: ptcourse
Port: 7003
adminserver
Port: 7001
StockWatcherzApp
User credentials
Username
Password
weblogic
Welcome1
Domain configuration
Type
Name
Address
Port
Admin Server
adminserver
localhost
7001
Managed Server
mainserver
localhost
7003
StockWatcherzApp 1241.26
28000
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Metric
StockWatcherzApp 1153.17
28000
StockWatcherzApp 1023.43
1.
Set up the practice domain (ptcourse) and deploy the practice application.
a. Launch the gnome-terminal and run the following command:
$> source set_course_env.sh
b.
2.
28000
Start the Administration Server and mainserver in ptcourse. Then deploy StockApp.
a.
b.
c.
3.
c.
d.
Open the out_<system>.log file that is in the newly created directory, and scroll
down to record the following results in the Performance statistics: preconfiguration
table:
1) Mean Test Time (ms)
2) Total tests successfully executed
3) Errors (if any)
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Navigate to
home/oracle/wls11g_tune/labs/lab07_01/exercise/applications folder
and execute the following command to compile the application:
$> java
weblogic.appc
-output ./compiledApp
./StockWatcherzApp/
c.
d.
5.
6.
7.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4.
Edit weblogic.xml with a text editor and disable page check seconds by changing
the value to -1 as shown. Save and close the file.
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<jsp-descriptor>
<page-check-seconds>-1</page-check-seconds>
</jsp-descriptor>
</weblogic-web-app>
c.
d.
8.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 8
Chapter 8 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Overview
A Web application with a lot of database interaction seems to be running slow. The WebLogic
Server creates connections as and when required. Every JDBC query that is executed is
compiled and then executed.
Whenever a new connection is needed, the WebLogic Server creates a new connection by
going to the database. This takes some time, which can vary based on the database. In
production environments, this can be avoided by creating all these connections at startup. In
addition, JDBC queries can be cached to save precious compile time. Pinned-To-Thread is an
option that can improve performance by enabling execute threads to keep a pooled database
connection even after the application closes the logical connection.
Domain configuration used in this practice:
Domain: ptcourse
MedRecSvr1
Port: 7021
Oracle
Database:
orcl
DataSource:
MedRecDS
Schema
medrec
MedRecAdmSvr
Port: 7020
medrec
application
User credentials
Username
Password
weblogic
Welcome1
Domain configuration
Type
Name
Address
Port
Admin Server
MedRecAdmSvr
Localhost
7020
Managed Server
MedRecSvr1
Localhost
7021
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Metric
Successful Tests
Errors
medrec application
Connections in pool: Initial = 15 and Maximum = 15
Metric
Successful Tests
Errors
Successful Tests
Errors
medrec application
Performance statistics: Statement caching
Metric
medrec application
Statement cache: Type = LRU, Size = 10 and Pinned-to-Thread, enabled
Metric
Successful Tests
Errors
medrec application
Statement cache: Type = LRU, Size = 35 and Pinned-to-Thread, enabled
Metric
Successful Tests
Errors
medrec application
1.
2.
Set up the medrec domain and deploy the practice application. Then start up the
administration server and one managed server.
a. Launch the gnome-terminal and set up the course environment variables by running
the following command:
$> source set_course_env.sh
b.
c.
When the MedRecSvr1 server starts up, enter the username (weblogic) and
password (Welcome1).
d.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3.
Click Connection Pool. Verify that the initial capacity is 5 and the maximum capacity is
15.
Run the stress test by using The Grinder.
a. In the gnome-terminal, navigate to the ~/wls11g_tune/labs/lab08_01/grinder
folder and set up the environment variables for The Grinder.
$> cd ~/wls11g_tune/labs/lab08_01/grinder
$> source ./setEnv.sh
b.
c.
Watch the agent window while the threads start running. When The Grinder agent has
finished running all threads, the DS_Test_Logs folder containing the files of stress
test is created in the /u01/app/work folder.
d.
4.
5.
Open the out_<system>.log file from the newly created directory and scroll down to
record the following results in the Performance statistics table (Connections in Pool:
Initial = 5 and Maximum = 15).
1) Mean Test Time (ms)
2) Total tests successfully executed
3) Errors (if any)
Change the connection pools Initial and Maximum Capacity.
a. Access the Administration Console for Medrec domain
(http://localhost:7020/console).
b. In the Change Center, click Lock & Edit. In Domain Structure, navigate to
MedRecDomain> Services >JDBC > Data Sources.
c. Click MedRecGlobalDataSourceXA.
d. Click Connection Pool. Change the number of physical connections in the pool to:
Parameter
Value
Initial Capacity
15
Maximum Capacity
15
c.
6.
Repeat step 3 and record the new results in the Performance statistics table
(Connections in Pool: Initial = 15 and Maximum = 15).
Change the statement cache size to 10 and enable Pinned-to-Thread.
a. In Domain Structure, navigate to MedRecDomain > Services >JDBC > Data Sources.
b. Click MedRecGlobalDataSourceXA.
c. Click Connection Pool. Change the number of physical connections in the pool back to:
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
Value
Initial Capacity
Maximum Capacity
15
Value
LRU
Size
10
e.
f.
7.
Click Save.
Click Advanced to change advanced parameters, and select the Pinned-to-Thread
check box.
Note: The Pinned-to-Thread option can improve performance by enabling execute
threads to keep a pooled database connection even after the application closes the
logical connection.
g. Click Save.
Run the stress test again by using The Grinder, and record the new results in the
Performance statistics table (Statement Cache: Type = LRU, Size = 10 and Pinned-toThread, enabled).
a. Stop MedRec Server1 by using the stop_mr1.sh script.
$> stop_mr1.sh
b.
c.
8.
Repeat step 3 (to run the stress test) and record the new results in the Performance
statistics table (Statement Cache: Type = LRU, Size = 10 and Pinned-to-Thread,
enabled).
Increase the statement cache size to 35 and run the stress test again by using The Grinder.
Record the new results in the performance statistics table (Statement Cache: Type=LRU,
Size = 35 and Pinned-to-Thread, enabled).
a. Using step 6 as a guide, change the statement cache size to 35.
b. Repeat step 3 and record the new results in the Performance statistics table
(Statement Cache: Type = LRU, Size = 35 and Pinned-to-Thread, enabled).
c. Review and compare the results collected in all the Performance statistics tables.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
Property
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 9
Chapter 9 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you change the size of the initial-beans-in-free-pool to improve the
initial response time of the stateless session EJBs.
Overview
You are provided with a sample enterprise application involving a Web application that invokes
a stateless session and an EJB to get a quote. Initial benchmarking revealed that the application
is performing slowly.
Stateless session beans provide nonconversational services. They do not maintain state on
behalf of clients and are synchronous. They are maintained in memory by the EJB container. A
container can pool stateless session EJBs that different clients can reuse. You can improve
performance by tuning the size of the stateless session EJB pool.
mainserver
Domain: ptcourse
Port: 7003
adminserver
InsuranceApp
Port: 7001
InsuranceEJB
User credentials
Username
Password
weblogic
Welcome1
Domain configuration
Type
Name
Address
Port
Admin Server
adminserver
localhost
7001
Managed Server
mainserver
localhost
7003
InsuranceApp
Performance statistics: Initial Beans in Free Pool = 15 (or any custom value)
Metric
InsuranceApp
1.
Set up the practice domain (ptcourse) and deploy the practice application.
a. Launch the gnome-terminal and run the following command:
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
2.
b.
c.
3.
4.
Verify and test the application by opening a Web browser and navigating to
http://localhost:7003/EJBClient
Verify the configuration for the Initial Beans in the Pool count.
a. Open a Web browser and navigate to http://localhost:7001/console. Log in
as weblogic/Welcome1.
b. In Domain Structure, navigate to ptcourse > Deployments. In the deployments table,
click InsuranceApp.
c. In Modules and Components, click Insurance.
d. Click the Monitoring tab and verify that the value for the Pooled Beans Current Count =
1.
Run a stress test by using The Grinder.
a. In the gnome-terminal, navigate to the ~/wls11g_tune/labs/lab09_01/grinder
folder and set up the environment variables for The Grinder.
$> cd ~/wls11g_tune/labs/lab09_01/grinder
$> source ./setEnv.sh
b.
c.
Watch the agent window while the threads start running. When The Grinder agent has
finished running all threads, the EJB_Results folder containing the files of the stress
test is created in the /u01/app/work folder.
d.
5.
Open the out_<system>.log file from the newly created directory and scroll down to
record the following results in the Performance statistics table.
1) Mean Test Time (ms)
2) Total tests successfully executed
3) Errors (if any)
Redeploy the InsuranceApp application with a deployment plan that sets the initialbeans-in-free-pool to 15.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a.
b.
c.
d.
In the Update Application Assistant wizard step, click Change Path in the Deployment
plan path field.
e.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: The value of 15 is not a benchmark value. You can achieve a performance increase
by increasing the initial bean size to a value higher than 1.
f.
6.
7.
In the next step, ensure that Redeploy this application using the following deployment
files is selected and then click Finish.
g. In the Change Center, click Activate Changes.
Verify the Initial Beans in the Free Pool count.
a. In Domain Structure of the Administration Console, navigate to ptcourse >
Deployments.
b. Click InsuranceApp.
c. In Modules and Components, click Insurance.
d. Click the Monitoring tab and verify that the value for the Pooled Beans Current Count =
15.
e. Open a Web browser and navigate to http://localhost:7003/EJBClient.
Browse to make sure that the application is running.
Repeat the stress test by using The Grinder.
a. Repeat step 4 and record the new results in the Performance statistics: Initial Beans in
Free Pool = 15 table.
b. Review and compare the results collected in all the Performance statistics tables.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 10
Chapter 10 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Understand the various disk write policies for writing to a file store
Overview
Addressing the performance of a messaging system in a very generic manner on the WebLogic
Server is very difficult. Moreover, the JMS framework itself is optimized on a self-tuning
WebLogic Server. However, it is possible to see the cost differentials of using various options,
thus setting a level of expectation for the general behavior of JMS. Because you cannot test all
possible combinations, you limit yourself to a subset of options by using a simple messaging
application.
Persisting messages on the server will improve reliability, but at the cost of performance. In
several real-world scenarios, reliability takes precedence.
The WebLogic Server has seen a lot of improvement in the disk write capabilities. This, in
particular, improves JMS persistence by using a file store.
There are three disk write policies available:
Cache Flush
Direct Write
Disabled
This practice explores the cost differentials of using these three policies.
mainserver
Domain: ptcourse
Port: 7003
File Store:
Cache Flush
Direct Write
adminserver
Disabled
MessagingApp
Port: 7001
User credentials
Username
Password
weblogic
Welcome1
Domain configuration
Type
Name
Address
Port
Admin Server
adminserver
localhost
7001
Managed Server
mainserver
localhost
7003
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Type
Name
Target
JMS Server
PTJMSServer
mainserver
JMS Module
PTJMSModule
mainserver
JMS ConnectionFactory
PTConnectionFactory
jms.PTConnectionFactory
JMS Queue
PTQueue
jms.PTQueue
File Store
FileStore_CacheFlush
N/A
File Store
FileStore_DirectWrite N/A
File Store
FileStore_Disabled
N/A
Successful
Tests
Errors
Successful
Tests
Errors
Successful
Tests
Errors
Performance statistics
Metric
MessagingApp
FileStore_CacheFlush
Metric
MessagingApp
FileStore_DirectWrite
Metric
MessagingApp
FileStore_Disabled
1.
Set up the practice domain (ptcourse) and deploy the practice application.
a. Launch the gnome-terminal and run the following command:
$> source set_course_env.sh
b.
2.
Start the Administration Server, and mainserver in ptcourse. Then deploy the
MessagingApp application.
a.
b.
Create the necessary JMS resources and deploy the MessagingApp application.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
JMS resources
cd exercise/WLSTScripts
./createStores.sh
java weblogic.WLST create_jms_resources.py
java weblogic.WLST deploy.py
java weblogic.WLST createFileStore.py
c.
3.
4.
Verify and test the application by opening a Web browser and navigating to
http://localhost:7003/ message-producer.
Change the persistent store type to FileStore_CacheFlush.
a. Open a Web browser and navigate to http://localhost:7001/console/. Log in as
weblogic/Welcome1.
b. In the Change Center, click Lock & Edit to initiate configuration changes.
c. In Domain Structure, navigate to ptcourse > Services > Messaging > JMS Servers.
d. Click PTJMSServer. PTJMSServer was configured in the ptcourse domain.
e. On the General tab, change the persistent store to FileStore_CacheFlush.
f. Click Save. Then click Activate Changes in the Change Center.
Restart the mainserver for the changes to take effect.
a.
Stop the mainserver by using the following script. You may need to enter the
username (weblogic) and password (Welcome1) in the ensuing windows.
$> stop_ptmain.sh
b.
5.
c.
Watch the agent window while the threads start running. When The Grinder agent has
finished running all threads, the JMS_Test_Logs folder containing the files of the stress
test is created in the /u01/app/work folder.
d.
Open the out_<system>.log file from the newly created directory and scroll down to
record the following results in the Performance statistics table.
1) Mean Test Time (ms)
2) Total tests successfully executed
3) Errors (if any)
Stop and start mainserver.
e.
$> stop_ptmain.sh
$> start_ptmain.sh
6.
7.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
$>
$>
$>
$>
$>
8.
9.
Repeat step 5 and record the new results in the Performance statistics table
(Persistent store: FileStore_DirectWrite).
Change the persistent store type to FileStore_Disabled.
a. Repeat step 4, this time changing the persistent store type to FileStore_Disabled.
Run the stress test again using The Grinder.
a. Repeat step 5 and record the new results in the Performance statistics table
(Persistent store: FileStore_Disabled).
b. Review and compare the results collected in all the Performance statistics tables.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
a.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 11
Chapter 11 - Page 1
Practices Overview
This practice was developed and tested using a machine with one CPU and 2 GB of RAM. The
results shown and discussed may vary depending on the resources in the environment that you
are using.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you compare the performance between in-memory and file replication
strategies.
Overview
A WebLogic Server cluster consists of multiple WebLogic Server instances running
simultaneously and working together to provide increased scalability and reliability. With many
servers in the cluster, client sessions (HttpSession) need to be replicated so that server
failure does not result in loss of data. But this degrades performance due to the overhead of
replication (persistence).
The WebLogic Server provides three ways of replicating sessions:
JDBC
File
In-memory
In this practice, you focus on file replication and in-memory replication strategies.
Specifications
The domain configuration for this practice:
Domain: ptcourse
Cluster: storecluster
UDP Address: 239.192.0.0: 7001
adminserver
ShoppingCartApp
Port: 7001
File directory:
serverA
/tmp/WLSTemp
Port: 7005
serverB
Port: 7007
ProxyApp
serverC
proxyserver
Port: 7009
Port: 7011
User credentials
Username
Password
weblogic
Welcome1
Domain configuration
Type
Name
Address
Port
Admin Server
adminserver
localhost
7001
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
storecluster
239.192.0.0 7001
localhost
7005
localhost
7007
serverC
localhost
7009
proxyserver
localhost
7011
Managed Server
ShoppingCartApp
Performance statistics: In-memory persistent store
Metric
InsuranceApp
1.
Set up the practice domain (ptcourse) and deploy the practice application.
a. Launch the gnome-terminal and run the following command:
$> source set_course_env.sh
b.
2.
Start the Administration Server. Set up the managed servers ServerA, ServerB,
ServerC, and proxyserver. Then create the cluster and deploy the ShoppingCartApp
application to the cluster and proxyApp to proxyserver.
a.
b.
c.
d.
e.
To enable easy startup of all the managed servers, copy boot.properties from the
Administration Server configuration location to individual managed servers. You can
run the copy_boot.sh shell script.
$> ./copy_boot.sh
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Cluster
Start the managed servers: proxyserver, ServerA, ServerB, and ServerC. You
can use the start_clust.sh script.
$> ./start_clust.sh
g.
Ensure that the servers are running, and then deploy the ShoppingCartApp and
proxyApp applications by using the deploy.py WLST script.
$> java weblogic.WLST deploy.py
h.
3.
Log out of the Administration Console, and using the same browser window, verify and
test the application by navigating to
http://localhost:7011/ShoppingCartApp/.
c.
Verify that the persistent store type is file and that the temporary directory is
/tmp/WLSTemp.
<?xml version='1.0' encoding='UTF-8'?><weblogic-web-app
...
<session-descriptor>
<persistent-store-type> file </persistent-store-type>
<persistent-store-dir>
/tmp/WLSTemp
</persistent-store-dir>
</session-descriptor>
</weblogic-web-app>
4.
c.
Watch the agent window while the threads start running. When The Grinder agent has
finished running all threads, the Cluster_Test folder containing the files of the stress
test is created in the /u01/app/work folder.
d.
5.
Open the out_<system>.log file from the newly created directory and scroll down to
record the following results in the Performance statistics table.
1) Mean Test Time (ms)
2) Total tests successfully executed
3) Errors (if any)
Change the persistent store type from file to memory.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f.
c.
Change the persistent store type from file to replicated as shown. Save and
close the file.
<?xml version='1.0' encoding='UTF-8'?><weblogic-web-app
...
<session-descriptor>
<persistent-store-type>
replicated
</persistent-store-type>
</session-descriptor>
</weblogic-web-app>
6.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Then, right-click the process and select Kill Process to terminate the Java process.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 11 - Page 8
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 12
Chapter 12 - Page 1
Practices Overview
There is no practice for Lesson 12.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED