• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Enterprise JavaBeans™ (EJB™) Architecture Scalability/Load Test
 

Enterprise JavaBeans™ (EJB™) Architecture Scalability/Load Test

on

  • 1,040 views

 

Statistics

Views

Total Views
1,040
Views on SlideShare
1,037
Embed Views
3

Actions

Likes
0
Downloads
16
Comments
0

1 Embed 3

http://www.slideshare.net 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Goal: Analyze performance testing strategies and techniques for EJB applications Assumtions: There is a requirement to performance test EJB middleware Automated test is preferred to manual test (see cost/benefit handout)
  • Given those assumptions, how do we go about: Load testing EJBs? Automating that testing? The majority of load tools on the market are: Based on GUI-oriented capture/playback Designed for later in the development life cycle (i.e. system test)
  • 4 EJB's comprise a simple order entry system: Customer entity bean Vendor entity bean Product entity bean OrderEntry session bean Deployed on WebLogic 5.1.0 Use Cloudscape database for persistence Our session bean simply manipulates the three entity beans to process an order Suppose that you find that this EJB application as a whole doesn't meet performance requirements. What next? What would you have to do in order to test / diagnose?

Enterprise JavaBeans™ (EJB™) Architecture Scalability/Load Test Enterprise JavaBeans™ (EJB™) Architecture Scalability/Load Test Presentation Transcript

  • Enterprise JavaBeans ™ (EJB ™ ) Architecture Scalability/Load Test Ted Osborne [email_address] RSW Software, Inc. www.rswsoftware.com
  • Agenda
    • The Current Landscape: Performance Testing & EJBs
    • Example Case Study using EJB-test
    • Survey EJB Performance Test Strategies & Techniques
  • Performance Testing & EJBs Presentation tier Data tier Middle tier : web client : web client : client : EJB server : web client : web server : database server : client : client : EJB : EJB : Internet
  • Our &quot;OrderEntry&quot; Example WebLogic 5.1.0 : EJB server Cloudscape : database server <<requests>> <<responses>> orderentry.jar : Session EJB product.jar : Entity EJB vendor.jar : Entity EJB customer.jar : Entity EJB
  • EJB-test
    • Strategy:
      • Create Java driver &quot;client&quot; for EJB under test
        • Goal: time method requests on EJB's interface (business methods)
        • Automate code generation through Java Reflection API & EJB code patterns
      • Simulate load using that client
        • Run the client in multithreaded load generator
        • Map in data from tables (or use generated data)
      • Aggregate log data
        • Response times
        • Exceptions
        • Data: actual vs. expected
  • Select the EJB to be tested from the Jars in your classpath
  • EJB-test automatically generates a Java Test Client specific to the selected EJB and optimized for WebLogic or WebSphere
  • The automatically generated Java Test Client times the method calls to the selected EJB
  • Define the load to execute and run the test.
  • Select the results to view
  • Select the response time data to view
  • Compare 2 test executions
  • OEVendor vs. OELoad
    • A simple response time comparison reveals which bean is the bottleneck
    • Potential sources of bottleneck:
      • Design
      • Deployment
      • Environment
  • Comparing EJB Deployments OEProduct ejb-jar.xml:37 <trans-attribute> Supports OEVendor ejb-jar.xml:37 <trans-attribute> Required weblogic-cmp-rdbms-jar.xml:29 <transaction-isolation> TRANSACTION_SERIALIZABLE
  • Strategies & Techniques
    • Load Testing
    • Data-driven Load Testing
    • Multithreaded & Multi-JVM Loads
    • Distributed Load Testing
    • Scenario (Multi-bean) Testing
    • Other Interesting EJB Tests
  • EJB Load Testing
    • Objective
      • Measure EJB's ability to server increasing number of client requests
      • Most Common Metrics
        • Transactions per Second (TPS)—throughput
        • Response time—client-side
      • Other Interesting Metrics
        • Error rate (exceptions)
        • Correctness (expected vs. actual values)
        • Method-level response times
  • Data-driven EJB Load Testing
    • Objective
      • Test EJBs with realistic data sets
    • Approach
      • Particular data combinations often comprise a &quot;use-case&quot;
      • Data set triggers business rules or call graphs of interest
      • Automation Leverage: Data from CSV &quot;maps&quot; into a static client driver
    • Hurdles
      • Marrying clients to data sets
  • EJB Load Testing System Topology : client host B : test client Data tier Middle tier : EJB server A : EJB : database server Test client threads each time their calls to the EJB's methods B : client thread B : EJB
  • Multithreaded & Multi-JVM Load Generation
    • Objective
      • Better simulation of load
    • Approach
      • Multithreaded load generation simulates a multi-client load (concurrent requests)
      • Dividing load across JVMs creates multiple socket connections to server
    • Hurdles
      • Thread safety & execution coordination
  • Distributed Load Testing
    • Objective
      • Generate a load simulation that is large enough
    • Approach
      • Distribute client JVMs across multiple machines
    • Hurdles
      • Still have thread safety and client coordination
      • Aggregating result logs
      • Client execution environment
  • Distributed Load Testing Nirvana : EJB-test server EJB Servers : EJB server : EJB : EJB Client Hosts : client host : test client : test client : test client : client host : test client : test client : test client : client host : test client : test client : test client : EJB server : EJB : EJB EJB-test Servlet engine AutoGen ™ code generator SyncLoad ™ Desktops : NT host : browser : Solaris host : browser : NT host : browser
  • Other Interesting EJB Tests
    • Stress Testing
    • Mixed/Randomized Loads
    • Scenario Testing
    • Security Testing
    • Configuration Testing
  • Anatomy of an EJB Test Client Driver 2 Lookup Home Interface in JNDI Tree java.lang.Object homeObject = jndi.lookup (&quot;OECustomer&quot;); com.testmybeans.customer.CustomerHome home = (com.testmybeans.customer.CustomerHome) javax.rmi.PortableRemoteObject.narrow ((org.omg.CORBA.Object) homeObject, com.testmybeans.customer.CustomerHome.class); 1 Get JNDI InitialContext //[WebSphere302 getInitialContext] public static Context getInitialContext(String urlName) throws javax.naming.NamingException { Hashtable env = new Hashtable(); env.put(Context.PROVIDER_URL, &quot; iiop:// &quot; + urlName); env.put(&quot;java.naming.factory.initial&quot;, &quot; com.ibm.ejs.ns.jndi.CNInitialContextFactory &quot;); env.put(&quot;javax.naming.Context.INITIAL_CONTEXT_FACTORY&quot;, &quot;com.ibm.ejs.ns.jndi.CNInitialContextFactory&quot;); InitialContext ctx = new InitialContext (env); return ctx; }
  • Anatomy of an EJB Test Client Driver 3 Get a Bean Instance if (m_ds.getRule().equals(&quot;Data table&quot;)) h = home. findByPrimaryKey (pkey0); else h = home. create (arg0); 5 Log Results timer.start (m_cSetters, &quot;setCustomerAddress&quot;, sValue); h.setCustomerAddress(sValue); timer.stopAndLog(); 4 timer.start(m_cSetters, &quot;setCustomerAddress&quot;, sValue); h.setCustomerAddress(sValue); timer.stopAndLog(); Exercise Bean's Business Methods
  •