SlideShare a Scribd company logo
1 of 47
Download to read offline
Daryl Maier (IBM Canada Lab), Anil Kumar (Intel Corporation)
1st October, 2012




Java Application Design Practices to Avoid
When Dealing with Sub-100 ms SLAs




                                                               © 2012 IBM Corporation
Important Disclaimers



    THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY.
    WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION
    CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS-IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESSED
    OR IMPLIED.
    ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED
    ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE, OR
    INFRASTRUCTURE DIFFERENCES.
    ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE.
    IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT
    PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE.
    IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE
    USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.
    NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
      – CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR
        SUPPLIERS AND/OR LICENSORS




2                                                                                       © 2012 IBM Corporation
Introduction to the speakers


    Daryl Maier

       – 12 years experience developing and deploying Java SDKs at IBM Canada Lab

       – Recent work focus:
          • X86 Java just-in-time compiler development and performance
          • Java benchmarking

       – Contact: maier@ca.ibm.com


    Anil Kumar

       – 10 years experience in server Java performance ensuring best customer
         experience on all Intel Architecture based platforms

       – Contact: anil.kumar@intel.com




3                                                                                © 2012 IBM Corporation
Credits



The contents of this presentation were jointly produced with




                         Elena Sayapina. Java Performance / Intel




           Intel and IBM collaborate to ensure the best user experience
                    across all Intel Architecture based platforms.




4                                                                         © 2012 IBM Corporation
What this talk is about…



    Learn what contributes to higher transactional response times within a Java application


    How to measure response time


    Java application design practices that lead to lower response times


    How to tune the environment in which your application runs for better response time


    How to determine if you can achieve an even better response time


    Lots of practical examples



5                                                                                    © 2012 IBM Corporation
Service Level Agreements



    SLA == Service Level Agreement
     – A commitment to provide a service that meets a prescribed level of performance
     – Can be informal or contractually obligated



                              CPU                                       Response
                                                                          Time
                                              Availability
       Storage



                              Concurrent                            ?
                                Users



6                                                                                 © 2012 IBM Corporation
Response time



    Measure of time needed to complete a transaction in response to a request to do work


    Lower response times generally have positive effects


    Different perceptions of response time: user interface, real time event, service level
    commitments, …


    Isn’t improving response time simply a matter of increasing throughput? Not necessarily…




7                                                                                       © 2012 IBM Corporation
How do you measure response time?



     Be sure what you’re measuring is the response time you’re interested in


                                                 Transaction A



    Requests                                                                                 Responses
                                                 Transaction B



               Request     Transaction                                         Response
                                                 Transaction C                  Queue
                Queue        Queue


                                                Executor Thread Pool




8                                                                                   © 2012 IBM Corporation
How do you measure response time?



     Be sure what you’re measuring is the response time you’re interested in


                                                    Transaction A



    Requests                                                                                        Responses
                                                    Transaction B



               Request       Transaction                                           Response
                                                    Transaction C                   Queue
                Queue          Queue


                                                   Executor Thread Pool


                         Measuring response time from request made to response received?


9                                                                                          © 2012 IBM Corporation
How do you measure response time?



     Be sure what you’re measuring is the response time you’re interested in


                                                    Transaction A



 Requests                                                                                           Responses
                                                    Transaction B



             Request       Transaction                                             Response
                                                    Transaction C                   Queue
              Queue          Queue


                                                  Executor Thread Pool


                          Measuring response time from transaction submitted to response received?


10                                                                                         © 2012 IBM Corporation
How do you measure response time?



     Be sure what you’re measuring is the response time you’re interested in


                                                  Transaction A



 Requests                                                                                          Responses
                                                  Transaction B



             Request       Transaction                                               Response
                                                  Transaction C                       Queue
              Queue          Queue


                                                 Executor Thread Pool


                                         Measure time to complete the transaction?


11                                                                                        © 2012 IBM Corporation
How do you measure response time?



     Make sure your timing measurement isn’t part of the response time!


     Be aware of accuracy and precision of Java timing methods
      – System.nanotime()
      – System.currentTimeMillis()
      – …and don’t use too many timers!


     Beware of clock skew in virtual environments
      – May need to keep time on an external system




12                                                                        © 2012 IBM Corporation
How do you measure response time?




                             Sample of transaction response times
                             for an IR of 3000 ops/sec. Most long
                             transactions above 95th percentile.




13                                                             © 2012 IBM Corporation
Influences on response time are not localized




         Application

         Framework
                                      You must design and tune the entire
                                      stack in order to achieve your
          Java VM                     response time targets


      Operating System

         Hardware



14                                                                © 2012 IBM Corporation
SPECjbb2012



     Next generation Java business logic benchmark from SPEC


     Business model is a supermarket supply chain: headquarters, supermarkets, suppliers


     Scalable, self-injecting workload with multiple supported configurations


     Customer relevant technologies: security, XML, JDK 7 features


     Metrics: max-jOPs (throughput) and critical-jOPs (response time)


     Will be used for case studies in this presentation



15                                                                                 © 2012 IBM Corporation
Application design influences response time




                                  • design for scalability
            Application
                                  • eliminate serial bottlenecks
                                  • use appropriate JCL packages
        Framework
                                  • avoid needless synchronization
                                  • avoid excessive object allocations
         Java VM
                                  • cache data locally
                                  • use non-blocking I/O
     Operating System
                                  • be careful with logging and tracing

         Hardware



16                                                                   © 2012 IBM Corporation
Design for scalability



     Scalability : the ability to increase throughput as more resources are applied


     Prepare your application to run on modern multi-core architectures


     Create more parallelism in your application and eliminate serial bottlenecks
      – Change algorithms


     Organize your application into parallel tasks
      – Leverage TaskExecutor framework for high-level tasks
      – Consider ForkJoin in Java 7 for fine-grained task decomposition




17                                                                                    © 2012 IBM Corporation
Use the java/util/concurrent package



     j/u/c introduced in Java 5, additional features in Java 6/7


     Contains building blocks for developing scalable applications
      – Uses state-of-the-art concurrency algorithms using non-blocking sync algorithms
      – More variety in locking operations (Lock interface, multiple Conditions)
      – Atomic variables (atomic math ops such as increment, test-and-set)
      – Concurrent collections
      – Coarse and fine-grained task management


     Use j/u/c classes as base classes for new data structures


     Optimized by modern JVMs




18                                                                                  © 2012 IBM Corporation
Avoid unnecessary Java synchronization



     Required for correctness so it can’t always be done
     Built-in Java synchronization is coarse grained and can inhibit scalability
      – Useful when true mutual exclusion is the goal
      – JVMs can help
     Strongly consider using j/u/c for finer-grained locking
       – Building blocks for scalable locking
     Eliminate contended locks
     Use volatile fields when appropriate
      – No locking
      – May be suitable for single writer, multiple-reader (e.g., time stamps)




19                                                                                 © 2012 IBM Corporation
Avoid excessive object allocations



     Understand the effect of object creation on the heap and the strain on garbage collection


     Consider hoisting allocations from loops


     Consider using weak/soft references when appropriate
      – Useful for caches, object metadata, or easily rematerializable data


     Be aware of immutable classes that implicitly return new objects
      – e.g., BigDecimal, Integer




20                                                                                    © 2012 IBM Corporation
Case study: SPECjbb2012
     Example of design choices around receipt storage in the benchmark




                                                              • Some impact on
                                                                throughput
                                                              • No impact on median
                                                                response time



                                                              • Significant impact on
                                                                99th-percentile
                                                                response time




21                                                                            © 2012 IBM Corporation
Case study: SPECjbb2012
     Example of design choices where background tasks become more heavy
      – Increase in background task of Data Mining (DM)



                                                           • Some impact on
                                                             throughput
                                                           • No impact on median
                                                             response time



                                                           • Significant impact on
                                                             99th-percentile
                                                             response time




22                                                                         © 2012 IBM Corporation
Reduce data access latency



     Often a problem in client/server systems


     Cache data locally to avoid remote communication
      – Particularly effective with data unlikely to change


     Pitfall : Tradeoff between caching too much to improve remote access latency and
     accumulating too much that strains garbage collection
       – an example of where local benefits to throughput have broader negative effects


     Use Java NIO (Java SE 1.4) and NIO2 (Java SE 7)
      – Can leverage high performance features


     Carefully consider non-blocking, unbounded data structures (e.g., ConcurrentLinkedQueue)



23                                                                                   © 2012 IBM Corporation
Case study: SPECjbb2012

Performance effects of caching supermarket data over not caching it




                                                             • Throughput reduces
                                                               by half
                                                             • Minor impact on
                                                               median response time



                                                             • Some impact on
                                                               99th-percentile
                                                               response time




24                                                                         © 2012 IBM Corporation
Application frameworks




        Application

                         • application containers (e.g., application
            Framework    servers, Eclipse)
                         • 3rd party packages (e.g., Apache
         Java VM         commons), Grizzly
                         • understand thread management and local
                         caching policies
     Operating System

        Hardware



25                                                            © 2012 IBM Corporation
Java virtual machine tuning




         Application

         Framework

                              • garbage collection
              Java VM
                              • heap tuning
                              • 64-bit addressing
      Operating System

         Hardware



26                                                   © 2012 IBM Corporation
Java virtual machine architecture

     User Code               Debugger                Profilers                     Java Application Code


     Java API                          JVMTI                          JSE6         JSE6       Harmony         User
     e.g. Java6/Java7                                                Classes      Classes     Classes        Natives


                                  GC / JIT / Class Lib. Natives                    Java Native Interface (JNI)
                                               Core VM (Interpreter, Verifier, Stack Walker)
     Java Runtime
                                                          Trace & Dump Engines
     Environment
     e.g. J9 R26
                                                  Port Library (Files, Sockets, Memory)
                                                                 Thread Library



     Operating              AIX                           Linux                             Windows          z/OS
     Systems /             PPC-32          x86-32         PPC-32          zArch-31          x86-32         zArch-31
     Architecture          PPC-64          x86-64         PPC-64          zArch-64          x86-64         zArch-64
     = User Code

     = Java Platform API
     = VM-aware
     = Core VM


27                                                                                                          © 2012 IBM Corporation
Garbage collection



     Determine the best garbage collection policy to use for your application
      – Often a response time vs. throughput tradeoff


     Most GC policies involve a “stop-the-world” phase that works against response times
      – “throughput” policies tend to incur longer pauses but fewer interruptions
      – “concurrent” policies lower average pause times by completing some tasks concurrently
      – “balanced” policies carve heap into regions to improve parallelism and reduce pauses


     Tune your heap parameters


     -verbose:gc to correlate GC events with application events




28                                                                                 © 2012 IBM Corporation
Case study: SPECjbb2012

     Example showing the effect of different GC policies and heap tunings




                                                                • Small throughput
                                                                  reduction from
                                                                  ConMarkSweep
                                                                •

                                                                • No impact on median
                                                                  response time



                                                                • ConMarkSweep
                                                                  99th-percentile
                                                                  response time higher
                                                                  but consistent


29                                                                             © 2012 IBM Corporation
64-bit addressing



     Heap addressability beyond 32-bits (> 3.5GB)
      – Common for applications with large in-memory working set (e.g., databases, object
        caches)


     64-bit addressing is a less efficient representation than 32-bit
       – Cache & TLB effects stress hardware


     Solution: build a 64-bit JVM with near 32-bit efficiency
      – Use 32-bit values (offsets) to represent object fields
      – With scaling, between 4 GB and 32 GB can be addressed


     Enable with –XX:+UseCompressedOops or -Xcompressedrefs




30                                                                                  © 2012 IBM Corporation
Operating system tuning




        Application

        Framework

         Java VM
                            • large pages
         Operating System   • thread scheduling

        Hardware



31                                                © 2012 IBM Corporation
Large data and code pages



     OS paging architecture requires memory addresses to be mapped to more granular “pages”
     that are mapped to physical memory
       – Translation Lookaside Buffers (TLBs)
       – Using larger page sizes increases TLB effectiveness


     Large pages must be enabled by the OS
       – BUT require enough physical pages to be allocated together to be most effective


     Modern JVMs place both heap and compiled code in large pages


     -Xlp (J9) or –XX:+UseLargePages (HotSpot)




32                                                                                   © 2012 IBM Corporation
Case study: SPECjbb2012

     Example showing the effect of large pages




                                                 • Increase throughput by
                                                   ~13%
                                                 • No impact on median
                                                   response time



                                                 • Helps in keeping
                                                   99th-percentile response
                                                   time lower at higher load




33                                                                © 2012 IBM Corporation
Thread scheduling



     Context switches

      – Voluntary (e.g., preemption during locking)

      – Involuntary (e.g., too many active threads)


     Watch for thread migration




34                                                    © 2012 IBM Corporation
Hardware tuning




        Application

        Framework

         Java VM


     Operating System

                        • power management
             Hardware
                        • BIOS settings



35                                           © 2012 IBM Corporation
Hardware tuning

     Power management
     Insufficient resources
       – Physical memory, amount and latency
       – I/O storage latency
              • RAID
              • SSDs
       – Network I/O bandwidth
     Tune your BIOS settings carefully
      – Hyperthreading
      – Prefetching
      – Power management




36                                             © 2012 IBM Corporation
Know your Intel® Xeon® Processor Family




37                                        © 2012 IBM Corporation
Know your Intel® Xeon® Processor SKU:




38                                      © 2012 IBM Corporation
Case study: SPECjbb2012

     Example showing the effect of 8 cores vs. 4 cores
      – Assumes application leveraging parallelism of multiple cores



                                                              • Increases throughput by
                                                                ~100%
                                                              • No impact on median
                                                                response time



                                                              • 8 cores deliver much
                                                                lower 99th-percentile
                                                                response




39                                                                             © 2012 IBM Corporation
Leveraging your hardware topology
     Understand the underlying hardware topology to reduce latency and increase throughput
     For NUMA, affinitize JVMs to core/memory subsets to improve performance
      – Improve NUMA performance
      – Optimize the cache hierarchy of the underlying processors



                                                            • Increases throughput by
                                                              ~12%
                                                            • No impact on median
                                                              response time



                                                            • Much lower
                                                              99th-percentile response




40                                                                               © 2012 IBM Corporation
Evaluating your response time



 Even though you may be achieving an acceptable SLA are there tell-tale signs that you
 could be achieving even better?
   – Lack of multi-threadedness in your application
   – Lock contention
   – Low CPU utilization
   – Excessive time (>10%) being spent in OS kernel

 Tooling to help diagnose response time issues
  – IBM HealthCenter
      – What is my JVM doing? Is everything ok?
      – Why is my application running slowly? Why is it not scaling?
      – Am I using the right options?

  – Garbage Collector and Memory Visualizer
     • Online analysis of heap usage, pause times, many others

  – Memory Analyzer
     • Offline tool providing insight into Java heaps


                                                                                © 2012 IBM Corporation
Questions?




42           © 2012 IBM Corporation
References



     Get Products and Technologies
      – IBM Java Runtimes and SDKs:
          • https://www.ibm.com/developerworks/java/jdk/
      – IBM Monitoring and Diagnostic Tools for Java:
          • https://www.ibm.com/developerworks/java/jdk/tools/
      – SPEC benchmarking
          • http://www.spec.org
     Learn
      – IBM Java InfoCenter:
          • http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp
     Discuss
      – IBM Java Runtimes and SDKs Forum:
          • http://www.ibm.com/developerworks/forums/forum.jspa?forumID=367&start=0




43                                                                             © 2012 IBM Corporation
Copyright and Trademarks



© IBM Corporation 2012. All Rights Reserved.


IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
  Business Machines Corp., and registered in many jurisdictions worldwide.


Other product and service names might be trademarks of IBM or other companies.


A current list of IBM trademarks is available on the Web – see the IBM “Copyright and
  trademark information” page at URL: www.ibm.com/legal/copytrade.shtml




44                                                                                © 2012 IBM Corporation
SPECjbb2012 architecture


 Single Application Set                Multi-Application Set

                                                         TxI      BE

     Ctr                                   Ctr
                TxI         BE
     l                                     l

                                                         TxI      BE
 Controller (Ctrl)
   – Controls and evaluates the runs
                                                                   Group
 Transaction Injector (TxI)
    – Issues “Requests” at a given rate
    – Measures response time by sending probe requests
 Backend SUT (BE)
   – Some % of transactions go across BEs exercising inter-JVM process
     communication
45                                                                     © 2012 IBM Corporation
SPECjbb2012 architecture

                            SP 1   SP 2


                     SM 2
                                               Backend 1
                                          HQ
                     SM 1

           Group 1



 SM: Supermarket     SM 2
 HQ: Headquarters
 SP: Supplier                             HQ   Backend 2
                     SM 1


                            SP 1   SP 2
           Group 2
46                                                  © 2012 IBM Corporation
Be aware of the impact of logging and tracing



     Tracing and logging events from your application can have hidden costs
       – I/O latency

      – Storage requirements

      – Overhead of test guarding tracing code

      – Impact on JIT compilation


     Do try to correlate application tracing information with events in other system or JVM logs




47                                                                                      © 2012 IBM Corporation

More Related Content

What's hot

"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)
"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)
"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)Marcin Kokott
 
Invest in Storage Professional Services, Not More Hardware
Invest in Storage Professional Services, Not More Hardware Invest in Storage Professional Services, Not More Hardware
Invest in Storage Professional Services, Not More Hardware IBM India Smarter Computing
 
Top 6 Agent Desktop KPIs & Capabilities
Top 6 Agent Desktop KPIs & CapabilitiesTop 6 Agent Desktop KPIs & Capabilities
Top 6 Agent Desktop KPIs & CapabilitiesJohn Perez
 
CFMA 2010 Unscramble and Balance Your Equipment Account
CFMA 2010 Unscramble and Balance Your Equipment AccountCFMA 2010 Unscramble and Balance Your Equipment Account
CFMA 2010 Unscramble and Balance Your Equipment AccountConstruction-Equip-Mng
 
Ciber It Outsourcing
Ciber It OutsourcingCiber It Outsourcing
Ciber It OutsourcingDarnellmills
 
Offshore Cost Relief
Offshore Cost ReliefOffshore Cost Relief
Offshore Cost Reliefrpboulan53
 
James.taylor
James.taylorJames.taylor
James.taylorNASAPMC
 
Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012
Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012 Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012
Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012 Tavant Technologies Inc.
 
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...TAUS - The Language Data Network
 
Architecture
ArchitectureArchitecture
ArchitectureJulio Pari
 
Offshore product development - a case study
Offshore product development - a case studyOffshore product development - a case study
Offshore product development - a case studyCheck Business
 
Smart Case Study 001
Smart Case Study 001Smart Case Study 001
Smart Case Study 001agbagb
 
SilverDev: Modernize Your IBM i User Experience
SilverDev: Modernize Your IBM i User ExperienceSilverDev: Modernize Your IBM i User Experience
SilverDev: Modernize Your IBM i User ExperienceSilverDev by Experia
 
Delivers Business Value For You And Your Customers - A whitepaper by Windows ...
Delivers Business Value For You And Your Customers - A whitepaper by Windows ...Delivers Business Value For You And Your Customers - A whitepaper by Windows ...
Delivers Business Value For You And Your Customers - A whitepaper by Windows ...Windows 7 Professional
 
B2B M&S Seminar on Customer Relationships & Business Negotiation
B2B M&S Seminar on Customer Relationships & Business NegotiationB2B M&S Seminar on Customer Relationships & Business Negotiation
B2B M&S Seminar on Customer Relationships & Business NegotiationChwenpai (Paul) Lee
 
ERP for Big Valley City
ERP for Big Valley CityERP for Big Valley City
ERP for Big Valley CitySanket Sao, MBA
 
Xuber upgrade and migration services
Xuber upgrade and migration servicesXuber upgrade and migration services
Xuber upgrade and migration servicesXuber
 

What's hot (20)

"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)
"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)
"How to solve unsolvable problems in projects" (33rd Degree, KrakĂłw)
 
Invest in Storage Professional Services, Not More Hardware
Invest in Storage Professional Services, Not More Hardware Invest in Storage Professional Services, Not More Hardware
Invest in Storage Professional Services, Not More Hardware
 
Top 6 Agent Desktop KPIs & Capabilities
Top 6 Agent Desktop KPIs & CapabilitiesTop 6 Agent Desktop KPIs & Capabilities
Top 6 Agent Desktop KPIs & Capabilities
 
CFMA 2010 Unscramble and Balance Your Equipment Account
CFMA 2010 Unscramble and Balance Your Equipment AccountCFMA 2010 Unscramble and Balance Your Equipment Account
CFMA 2010 Unscramble and Balance Your Equipment Account
 
Ciber It Outsourcing
Ciber It OutsourcingCiber It Outsourcing
Ciber It Outsourcing
 
Offshore Cost Relief
Offshore Cost ReliefOffshore Cost Relief
Offshore Cost Relief
 
James.taylor
James.taylorJames.taylor
James.taylor
 
Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012
Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012 Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012
Tavant Technologies Showcases its Field Service Mobilty Solution at WCM 2012
 
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
 
Architecture
ArchitectureArchitecture
Architecture
 
Offshore product development - a case study
Offshore product development - a case studyOffshore product development - a case study
Offshore product development - a case study
 
Smart Case Study 001
Smart Case Study 001Smart Case Study 001
Smart Case Study 001
 
SilverDev: Modernize Your IBM i User Experience
SilverDev: Modernize Your IBM i User ExperienceSilverDev: Modernize Your IBM i User Experience
SilverDev: Modernize Your IBM i User Experience
 
Optimize your supply chain
Optimize your supply chainOptimize your supply chain
Optimize your supply chain
 
Real world security webinar (v2012-05-30)
Real world security   webinar (v2012-05-30)Real world security   webinar (v2012-05-30)
Real world security webinar (v2012-05-30)
 
Delivers Business Value For You And Your Customers - A whitepaper by Windows ...
Delivers Business Value For You And Your Customers - A whitepaper by Windows ...Delivers Business Value For You And Your Customers - A whitepaper by Windows ...
Delivers Business Value For You And Your Customers - A whitepaper by Windows ...
 
B2B M&S Seminar on Customer Relationships & Business Negotiation
B2B M&S Seminar on Customer Relationships & Business NegotiationB2B M&S Seminar on Customer Relationships & Business Negotiation
B2B M&S Seminar on Customer Relationships & Business Negotiation
 
ERP for Big Valley City
ERP for Big Valley CityERP for Big Valley City
ERP for Big Valley City
 
BDM AtTask Case Study
BDM AtTask Case StudyBDM AtTask Case Study
BDM AtTask Case Study
 
Xuber upgrade and migration services
Xuber upgrade and migration servicesXuber upgrade and migration services
Xuber upgrade and migration services
 

Similar to Java Design Practices for Sub-100 ms SLAs

Selfexamengine.Com Qa 000 061
Selfexamengine.Com Qa 000 061Selfexamengine.Com Qa 000 061
Selfexamengine.Com Qa 000 061guestc637a7
 
The Cloud, The Enterprise Architect and the CIO
The Cloud, The Enterprise Architect and the CIOThe Cloud, The Enterprise Architect and the CIO
The Cloud, The Enterprise Architect and the CIOMatt Deacon
 
2008 11 18_contracts _oaug-sig
2008 11 18_contracts _oaug-sig2008 11 18_contracts _oaug-sig
2008 11 18_contracts _oaug-sigDZee Solutions
 
Operation in service sector
Operation in service sectorOperation in service sector
Operation in service sectorPraveen Sidola
 
Mobile DevOps - Trends and Chellenges
Mobile DevOps - Trends and ChellengesMobile DevOps - Trends and Chellenges
Mobile DevOps - Trends and ChellengesSanjeev Sharma
 
Using feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deansUsing feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deansIndia Scrum Enthusiasts Community
 
2009 08 25_business value of upgrading to oracle e-business suite contracts r...
2009 08 25_business value of upgrading to oracle e-business suite contracts r...2009 08 25_business value of upgrading to oracle e-business suite contracts r...
2009 08 25_business value of upgrading to oracle e-business suite contracts r...DZee Solutions
 
Cast Iron Overview Webinar 6.13.12 Final(Jb)
Cast Iron Overview Webinar 6.13.12 Final(Jb)Cast Iron Overview Webinar 6.13.12 Final(Jb)
Cast Iron Overview Webinar 6.13.12 Final(Jb)Carolyn Crowe
 
C bu06 planning_your_cloud_education
C bu06 planning_your_cloud_educationC bu06 planning_your_cloud_education
C bu06 planning_your_cloud_educationMegan Irvine
 
IBM Z for the Digital Enterprise 2018 - Automate Delivery Pipeline
IBM Z for the Digital Enterprise 2018 - Automate Delivery PipelineIBM Z for the Digital Enterprise 2018 - Automate Delivery Pipeline
IBM Z for the Digital Enterprise 2018 - Automate Delivery PipelineDevOps for Enterprise Systems
 
Nearshoring With Tiempo 2011
Nearshoring With Tiempo 2011Nearshoring With Tiempo 2011
Nearshoring With Tiempo 2011rgfordham
 
New Zealand Premiere! A first look at Rational Insight
New Zealand Premiere! A first look at Rational InsightNew Zealand Premiere! A first look at Rational Insight
New Zealand Premiere! A first look at Rational InsightVincent Kwon
 
What's New in Maximo 7 Workshop Alex Estevam Sep 2012
What's New in Maximo 7 Workshop   Alex Estevam Sep 2012What's New in Maximo 7 Workshop   Alex Estevam Sep 2012
What's New in Maximo 7 Workshop Alex Estevam Sep 2012alipaiva
 
Smarter Computing Integrated Systems
Smarter Computing Integrated SystemsSmarter Computing Integrated Systems
Smarter Computing Integrated SystemsIBMGovernmentCA
 
Slideshow RemedyForce 2012
Slideshow RemedyForce 2012Slideshow RemedyForce 2012
Slideshow RemedyForce 2012InfraVision
 
Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIs
 Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIs Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIs
Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIsRyan Boyles
 
Eci Service Architecture Evolution 1
Eci Service Architecture Evolution 1Eci Service Architecture Evolution 1
Eci Service Architecture Evolution 1David Sprott
 
Cast Iron Overview Webinar 6.13
Cast Iron Overview Webinar 6.13Cast Iron Overview Webinar 6.13
Cast Iron Overview Webinar 6.13gaborvodics
 
Star Knowledge Project Framework & Governance
Star Knowledge Project Framework & GovernanceStar Knowledge Project Framework & Governance
Star Knowledge Project Framework & GovernanceThe Knowledge Compass, Inc.
 

Similar to Java Design Practices for Sub-100 ms SLAs (20)

Selfexamengine.Com Qa 000 061
Selfexamengine.Com Qa 000 061Selfexamengine.Com Qa 000 061
Selfexamengine.Com Qa 000 061
 
The Cloud, The Enterprise Architect and the CIO
The Cloud, The Enterprise Architect and the CIOThe Cloud, The Enterprise Architect and the CIO
The Cloud, The Enterprise Architect and the CIO
 
2008 11 18_contracts _oaug-sig
2008 11 18_contracts _oaug-sig2008 11 18_contracts _oaug-sig
2008 11 18_contracts _oaug-sig
 
Operation in service sector
Operation in service sectorOperation in service sector
Operation in service sector
 
Mobile DevOps - Trends and Chellenges
Mobile DevOps - Trends and ChellengesMobile DevOps - Trends and Chellenges
Mobile DevOps - Trends and Chellenges
 
Using feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deansUsing feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deans
 
2009 08 25_business value of upgrading to oracle e-business suite contracts r...
2009 08 25_business value of upgrading to oracle e-business suite contracts r...2009 08 25_business value of upgrading to oracle e-business suite contracts r...
2009 08 25_business value of upgrading to oracle e-business suite contracts r...
 
Cast Iron Overview Webinar 6.13.12 Final(Jb)
Cast Iron Overview Webinar 6.13.12 Final(Jb)Cast Iron Overview Webinar 6.13.12 Final(Jb)
Cast Iron Overview Webinar 6.13.12 Final(Jb)
 
C bu06 planning_your_cloud_education
C bu06 planning_your_cloud_educationC bu06 planning_your_cloud_education
C bu06 planning_your_cloud_education
 
IBM Z for the Digital Enterprise 2018 - Automate Delivery Pipeline
IBM Z for the Digital Enterprise 2018 - Automate Delivery PipelineIBM Z for the Digital Enterprise 2018 - Automate Delivery Pipeline
IBM Z for the Digital Enterprise 2018 - Automate Delivery Pipeline
 
Nearshoring With Tiempo 2011
Nearshoring With Tiempo 2011Nearshoring With Tiempo 2011
Nearshoring With Tiempo 2011
 
New Zealand Premiere! A first look at Rational Insight
New Zealand Premiere! A first look at Rational InsightNew Zealand Premiere! A first look at Rational Insight
New Zealand Premiere! A first look at Rational Insight
 
What's New in Maximo 7 Workshop Alex Estevam Sep 2012
What's New in Maximo 7 Workshop   Alex Estevam Sep 2012What's New in Maximo 7 Workshop   Alex Estevam Sep 2012
What's New in Maximo 7 Workshop Alex Estevam Sep 2012
 
Smarter Computing Integrated Systems
Smarter Computing Integrated SystemsSmarter Computing Integrated Systems
Smarter Computing Integrated Systems
 
Slideshow RemedyForce 2012
Slideshow RemedyForce 2012Slideshow RemedyForce 2012
Slideshow RemedyForce 2012
 
Ispcms.ppt
Ispcms.pptIspcms.ppt
Ispcms.ppt
 
Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIs
 Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIs Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIs
Connect the Cloud: A Strategy for Enterprise, Mobile and Developer APIs
 
Eci Service Architecture Evolution 1
Eci Service Architecture Evolution 1Eci Service Architecture Evolution 1
Eci Service Architecture Evolution 1
 
Cast Iron Overview Webinar 6.13
Cast Iron Overview Webinar 6.13Cast Iron Overview Webinar 6.13
Cast Iron Overview Webinar 6.13
 
Star Knowledge Project Framework & Governance
Star Knowledge Project Framework & GovernanceStar Knowledge Project Framework & Governance
Star Knowledge Project Framework & Governance
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Java Design Practices for Sub-100 ms SLAs

  • 1. Daryl Maier (IBM Canada Lab), Anil Kumar (Intel Corporation) 1st October, 2012 Java Application Design Practices to Avoid When Dealing with Sub-100 ms SLAs © 2012 IBM Corporation
  • 2. Important Disclaimers THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS-IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED. ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE, OR INFRASTRUCTURE DIFFERENCES. ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE. IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE. IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: – CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS 2 © 2012 IBM Corporation
  • 3. Introduction to the speakers Daryl Maier – 12 years experience developing and deploying Java SDKs at IBM Canada Lab – Recent work focus: • X86 Java just-in-time compiler development and performance • Java benchmarking – Contact: maier@ca.ibm.com Anil Kumar – 10 years experience in server Java performance ensuring best customer experience on all Intel Architecture based platforms – Contact: anil.kumar@intel.com 3 © 2012 IBM Corporation
  • 4. Credits The contents of this presentation were jointly produced with Elena Sayapina. Java Performance / Intel Intel and IBM collaborate to ensure the best user experience across all Intel Architecture based platforms. 4 © 2012 IBM Corporation
  • 5. What this talk is about… Learn what contributes to higher transactional response times within a Java application How to measure response time Java application design practices that lead to lower response times How to tune the environment in which your application runs for better response time How to determine if you can achieve an even better response time Lots of practical examples 5 © 2012 IBM Corporation
  • 6. Service Level Agreements SLA == Service Level Agreement – A commitment to provide a service that meets a prescribed level of performance – Can be informal or contractually obligated CPU Response Time Availability Storage Concurrent ? Users 6 © 2012 IBM Corporation
  • 7. Response time Measure of time needed to complete a transaction in response to a request to do work Lower response times generally have positive effects Different perceptions of response time: user interface, real time event, service level commitments, … Isn’t improving response time simply a matter of increasing throughput? Not necessarily… 7 © 2012 IBM Corporation
  • 8. How do you measure response time? Be sure what you’re measuring is the response time you’re interested in Transaction A Requests Responses Transaction B Request Transaction Response Transaction C Queue Queue Queue Executor Thread Pool 8 © 2012 IBM Corporation
  • 9. How do you measure response time? Be sure what you’re measuring is the response time you’re interested in Transaction A Requests Responses Transaction B Request Transaction Response Transaction C Queue Queue Queue Executor Thread Pool Measuring response time from request made to response received? 9 © 2012 IBM Corporation
  • 10. How do you measure response time? Be sure what you’re measuring is the response time you’re interested in Transaction A Requests Responses Transaction B Request Transaction Response Transaction C Queue Queue Queue Executor Thread Pool Measuring response time from transaction submitted to response received? 10 © 2012 IBM Corporation
  • 11. How do you measure response time? Be sure what you’re measuring is the response time you’re interested in Transaction A Requests Responses Transaction B Request Transaction Response Transaction C Queue Queue Queue Executor Thread Pool Measure time to complete the transaction? 11 © 2012 IBM Corporation
  • 12. How do you measure response time? Make sure your timing measurement isn’t part of the response time! Be aware of accuracy and precision of Java timing methods – System.nanotime() – System.currentTimeMillis() – …and don’t use too many timers! Beware of clock skew in virtual environments – May need to keep time on an external system 12 © 2012 IBM Corporation
  • 13. How do you measure response time? Sample of transaction response times for an IR of 3000 ops/sec. Most long transactions above 95th percentile. 13 © 2012 IBM Corporation
  • 14. Influences on response time are not localized Application Framework You must design and tune the entire stack in order to achieve your Java VM response time targets Operating System Hardware 14 © 2012 IBM Corporation
  • 15. SPECjbb2012 Next generation Java business logic benchmark from SPEC Business model is a supermarket supply chain: headquarters, supermarkets, suppliers Scalable, self-injecting workload with multiple supported configurations Customer relevant technologies: security, XML, JDK 7 features Metrics: max-jOPs (throughput) and critical-jOPs (response time) Will be used for case studies in this presentation 15 © 2012 IBM Corporation
  • 16. Application design influences response time • design for scalability Application • eliminate serial bottlenecks • use appropriate JCL packages Framework • avoid needless synchronization • avoid excessive object allocations Java VM • cache data locally • use non-blocking I/O Operating System • be careful with logging and tracing Hardware 16 © 2012 IBM Corporation
  • 17. Design for scalability Scalability : the ability to increase throughput as more resources are applied Prepare your application to run on modern multi-core architectures Create more parallelism in your application and eliminate serial bottlenecks – Change algorithms Organize your application into parallel tasks – Leverage TaskExecutor framework for high-level tasks – Consider ForkJoin in Java 7 for fine-grained task decomposition 17 © 2012 IBM Corporation
  • 18. Use the java/util/concurrent package j/u/c introduced in Java 5, additional features in Java 6/7 Contains building blocks for developing scalable applications – Uses state-of-the-art concurrency algorithms using non-blocking sync algorithms – More variety in locking operations (Lock interface, multiple Conditions) – Atomic variables (atomic math ops such as increment, test-and-set) – Concurrent collections – Coarse and fine-grained task management Use j/u/c classes as base classes for new data structures Optimized by modern JVMs 18 © 2012 IBM Corporation
  • 19. Avoid unnecessary Java synchronization Required for correctness so it can’t always be done Built-in Java synchronization is coarse grained and can inhibit scalability – Useful when true mutual exclusion is the goal – JVMs can help Strongly consider using j/u/c for finer-grained locking – Building blocks for scalable locking Eliminate contended locks Use volatile fields when appropriate – No locking – May be suitable for single writer, multiple-reader (e.g., time stamps) 19 © 2012 IBM Corporation
  • 20. Avoid excessive object allocations Understand the effect of object creation on the heap and the strain on garbage collection Consider hoisting allocations from loops Consider using weak/soft references when appropriate – Useful for caches, object metadata, or easily rematerializable data Be aware of immutable classes that implicitly return new objects – e.g., BigDecimal, Integer 20 © 2012 IBM Corporation
  • 21. Case study: SPECjbb2012 Example of design choices around receipt storage in the benchmark • Some impact on throughput • No impact on median response time • Significant impact on 99th-percentile response time 21 © 2012 IBM Corporation
  • 22. Case study: SPECjbb2012 Example of design choices where background tasks become more heavy – Increase in background task of Data Mining (DM) • Some impact on throughput • No impact on median response time • Significant impact on 99th-percentile response time 22 © 2012 IBM Corporation
  • 23. Reduce data access latency Often a problem in client/server systems Cache data locally to avoid remote communication – Particularly effective with data unlikely to change Pitfall : Tradeoff between caching too much to improve remote access latency and accumulating too much that strains garbage collection – an example of where local benefits to throughput have broader negative effects Use Java NIO (Java SE 1.4) and NIO2 (Java SE 7) – Can leverage high performance features Carefully consider non-blocking, unbounded data structures (e.g., ConcurrentLinkedQueue) 23 © 2012 IBM Corporation
  • 24. Case study: SPECjbb2012 Performance effects of caching supermarket data over not caching it • Throughput reduces by half • Minor impact on median response time • Some impact on 99th-percentile response time 24 © 2012 IBM Corporation
  • 25. Application frameworks Application • application containers (e.g., application Framework servers, Eclipse) • 3rd party packages (e.g., Apache Java VM commons), Grizzly • understand thread management and local caching policies Operating System Hardware 25 © 2012 IBM Corporation
  • 26. Java virtual machine tuning Application Framework • garbage collection Java VM • heap tuning • 64-bit addressing Operating System Hardware 26 © 2012 IBM Corporation
  • 27. Java virtual machine architecture User Code Debugger Profilers Java Application Code Java API JVMTI JSE6 JSE6 Harmony User e.g. Java6/Java7 Classes Classes Classes Natives GC / JIT / Class Lib. Natives Java Native Interface (JNI) Core VM (Interpreter, Verifier, Stack Walker) Java Runtime Trace & Dump Engines Environment e.g. J9 R26 Port Library (Files, Sockets, Memory) Thread Library Operating AIX Linux Windows z/OS Systems / PPC-32 x86-32 PPC-32 zArch-31 x86-32 zArch-31 Architecture PPC-64 x86-64 PPC-64 zArch-64 x86-64 zArch-64 = User Code = Java Platform API = VM-aware = Core VM 27 © 2012 IBM Corporation
  • 28. Garbage collection Determine the best garbage collection policy to use for your application – Often a response time vs. throughput tradeoff Most GC policies involve a “stop-the-world” phase that works against response times – “throughput” policies tend to incur longer pauses but fewer interruptions – “concurrent” policies lower average pause times by completing some tasks concurrently – “balanced” policies carve heap into regions to improve parallelism and reduce pauses Tune your heap parameters -verbose:gc to correlate GC events with application events 28 © 2012 IBM Corporation
  • 29. Case study: SPECjbb2012 Example showing the effect of different GC policies and heap tunings • Small throughput reduction from ConMarkSweep • • No impact on median response time • ConMarkSweep 99th-percentile response time higher but consistent 29 © 2012 IBM Corporation
  • 30. 64-bit addressing Heap addressability beyond 32-bits (> 3.5GB) – Common for applications with large in-memory working set (e.g., databases, object caches) 64-bit addressing is a less efficient representation than 32-bit – Cache & TLB effects stress hardware Solution: build a 64-bit JVM with near 32-bit efficiency – Use 32-bit values (offsets) to represent object fields – With scaling, between 4 GB and 32 GB can be addressed Enable with –XX:+UseCompressedOops or -Xcompressedrefs 30 © 2012 IBM Corporation
  • 31. Operating system tuning Application Framework Java VM • large pages Operating System • thread scheduling Hardware 31 © 2012 IBM Corporation
  • 32. Large data and code pages OS paging architecture requires memory addresses to be mapped to more granular “pages” that are mapped to physical memory – Translation Lookaside Buffers (TLBs) – Using larger page sizes increases TLB effectiveness Large pages must be enabled by the OS – BUT require enough physical pages to be allocated together to be most effective Modern JVMs place both heap and compiled code in large pages -Xlp (J9) or –XX:+UseLargePages (HotSpot) 32 © 2012 IBM Corporation
  • 33. Case study: SPECjbb2012 Example showing the effect of large pages • Increase throughput by ~13% • No impact on median response time • Helps in keeping 99th-percentile response time lower at higher load 33 © 2012 IBM Corporation
  • 34. Thread scheduling Context switches – Voluntary (e.g., preemption during locking) – Involuntary (e.g., too many active threads) Watch for thread migration 34 © 2012 IBM Corporation
  • 35. Hardware tuning Application Framework Java VM Operating System • power management Hardware • BIOS settings 35 © 2012 IBM Corporation
  • 36. Hardware tuning Power management Insufficient resources – Physical memory, amount and latency – I/O storage latency • RAID • SSDs – Network I/O bandwidth Tune your BIOS settings carefully – Hyperthreading – Prefetching – Power management 36 © 2012 IBM Corporation
  • 37. Know your Intel® Xeon® Processor Family 37 © 2012 IBM Corporation
  • 38. Know your Intel® Xeon® Processor SKU: 38 © 2012 IBM Corporation
  • 39. Case study: SPECjbb2012 Example showing the effect of 8 cores vs. 4 cores – Assumes application leveraging parallelism of multiple cores • Increases throughput by ~100% • No impact on median response time • 8 cores deliver much lower 99th-percentile response 39 © 2012 IBM Corporation
  • 40. Leveraging your hardware topology Understand the underlying hardware topology to reduce latency and increase throughput For NUMA, affinitize JVMs to core/memory subsets to improve performance – Improve NUMA performance – Optimize the cache hierarchy of the underlying processors • Increases throughput by ~12% • No impact on median response time • Much lower 99th-percentile response 40 © 2012 IBM Corporation
  • 41. Evaluating your response time Even though you may be achieving an acceptable SLA are there tell-tale signs that you could be achieving even better? – Lack of multi-threadedness in your application – Lock contention – Low CPU utilization – Excessive time (>10%) being spent in OS kernel Tooling to help diagnose response time issues – IBM HealthCenter – What is my JVM doing? Is everything ok? – Why is my application running slowly? Why is it not scaling? – Am I using the right options? – Garbage Collector and Memory Visualizer • Online analysis of heap usage, pause times, many others – Memory Analyzer • Offline tool providing insight into Java heaps © 2012 IBM Corporation
  • 42. Questions? 42 © 2012 IBM Corporation
  • 43. References Get Products and Technologies – IBM Java Runtimes and SDKs: • https://www.ibm.com/developerworks/java/jdk/ – IBM Monitoring and Diagnostic Tools for Java: • https://www.ibm.com/developerworks/java/jdk/tools/ – SPEC benchmarking • http://www.spec.org Learn – IBM Java InfoCenter: • http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp Discuss – IBM Java Runtimes and SDKs Forum: • http://www.ibm.com/developerworks/forums/forum.jspa?forumID=367&start=0 43 © 2012 IBM Corporation
  • 44. Copyright and Trademarks © IBM Corporation 2012. All Rights Reserved. IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., and registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web – see the IBM “Copyright and trademark information” page at URL: www.ibm.com/legal/copytrade.shtml 44 © 2012 IBM Corporation
  • 45. SPECjbb2012 architecture Single Application Set Multi-Application Set TxI BE Ctr Ctr TxI BE l l TxI BE Controller (Ctrl) – Controls and evaluates the runs Group Transaction Injector (TxI) – Issues “Requests” at a given rate – Measures response time by sending probe requests Backend SUT (BE) – Some % of transactions go across BEs exercising inter-JVM process communication 45 © 2012 IBM Corporation
  • 46. SPECjbb2012 architecture SP 1 SP 2 SM 2 Backend 1 HQ SM 1 Group 1 SM: Supermarket SM 2 HQ: Headquarters SP: Supplier HQ Backend 2 SM 1 SP 1 SP 2 Group 2 46 © 2012 IBM Corporation
  • 47. Be aware of the impact of logging and tracing Tracing and logging events from your application can have hidden costs – I/O latency – Storage requirements – Overhead of test guarding tracing code – Impact on JIT compilation Do try to correlate application tracing information with events in other system or JVM logs 47 © 2012 IBM Corporation