Portlets2008 Portlet Performance Tuning

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    Welcome, this is pretty generic and should also be a good primer in general, as well as just for portlets

    Favorites, Groups & Events

    Portlets2008 Portlet Performance Tuning - Presentation Transcript

    1. Portlet Performance Tuning
      • Presented By: Jason Shao
      CAMPUSEAI CONSORTIUM
      • Approach
      • Systems Architecture
      • Tuning: Browsers, Portlets, DB, JVM
      • Testing: Load & QA
      • Monitoring
      • Discussion
      Agenda
      • Requirements
      • Measure Performance
      • Identify Bottlenecks
      • Fix Bottlenecks
      • Wash, Rinse, Repeat (2-4)
      Approach The Approach
      • Tools & Services
        • Architecture
        • Service Mix
      • Usage Patterns
        • Scenarios (e.g. use cases)
        • Traffic Patterns
      Approach – Requirements Define Requiremens – Check Variables
      • Page Load Time
      • Responsiveness
      • Memory Usage
      • CPU Utilization
      • Scalability
      Approach - Requirements What Are Our Targets?
      • Process
      • Environment
      • Tools
      Approach – Measurement Measurement
    2. Approach – Measure Performance “ In this business… Perception is Everything”
      • Mostly browser-side
        • Client-side Bandwidth
        • Latency
        • Loading Resources (Images, CSS)
        • Building Browser Model
        • DOM, CSS, JS
      Approach – Measurement Perception is a Client Issue
      • Caching
      • Connections
      • Rendering
      Approach – Measurement Understand Browser Performance
      • 80/20 Rule
      • Avoid premature optimization
      • Keep a checklist
        • DB: Indexes, Queries, Dataset Retrieval
        • Caching
        • Understanding Libraries & Algorithms
      Approach – Identify Bottlenecks Find & Fix the Bottlenecks
    3. Approach – Measure Performance “ SYSTEM ARCHITECTURE… sounds serious”
      • Availability
      • Capacity
      • Complexity
      Systems Architecture Balance Key Concerns
    4. Systems Architecture
      • Where does my business logic live?
      • What persistence strategy do I use?
      • Are their opportunities for caching?
      • Who does the heavy lifting?
        • Portal? Appserver? DB? Webservice?
      Systems Architecture Portlet Architecture
    5. Approach – Measure Performance “ 5. Tuning… the repeating part of wash, rinse, repeat”
      • Caching
      • Connections
      • Rendering
      Tuning – Browsers Browser Tuning
    6. Approach – Measure Performance “ Broadband and caching fix everything, right?”
    7. Approach – Measure Performance “ How often have you been on a poor wifi connection?”
    8. Approach – Measure Performance
      • Changes default browser caching
        • Less info cached to disk
        • Cached data not saved between sessions
      • May not be getting caching benefit you think you are
      Tuning – Browsers HTTPS – We’re Safe, Right?
      • Bad, Bad, Bad
      • Typically based off i-node/file handle
        • Apache: inode-size-timestamp
        • IIS: Filetimestamp:ChangeNumber
      • Kill caching in clustered environment
      • Kill caching of dynamic content
      Tuning – Browsers E-Tags
      • Good, Good, Good
        • Some odd combinations/trickery required to work in all browsers
      • Prevent round trips to the server
      Tuning – Browsers Expires
      • Most browsers use 2 threads per host to retrieve resources
      • Most servers throttle max connections from a client IP
      • Minimize separate server round-trips
      Tuning – Browsers Connections
      • 3xx status codes – mostly 301 and 302
        • HTTP/1.1 301 Moved Permanently
        • add Expires headers to cache redirects
        • Watch for trailing slashes (esp. w/Apache)
      Tuning – Browsers Redirects
    9. Tuning – Browsers CSS Sprites
    10. Approach – Measure Performance “ How does the browser put the page together?”
      • Styles at the Top
        • CSS blocks rendering in IE
      • Scripts at the Bottom
        • Scripts block rendering and downloads
        • Scripts can force BOM rebuilds
      Tuning – Browsers Rendering Tricks
      • Firebug
        • https://addons.mozilla.org/en-US/firefox/addon/1843
      • Yslow
        • https://addons.mozilla.org/en-US/firefox/addon/5369
      Tuning – Browsers Handy Tools
    11. Approach – Measure Performance “ Don’t forget: Portlet s ”
      • Portlet Caching
        • JSR-168 specification
        • Action vs. Render Requests
      Tuning – Portlets Portlets
      • Initialization
      • Data Lookups
      • Object Creation
      • Shared State
      Tuning – Portlets Portlets – What Gets Cached?
      • Initialization Data can be cached:
        • Globally
        • Per-User
        • Per-Login
        • Per-Session
        • Per-Transaction
      Tuning – Portlets Initialization
    12. Approach – Measure Performance “ Tuning is the DBA’s Job”
    13. Approach – Measure Performance
      • Indexing
      • Caching
      • Connection Pooling
      • Table Size
      • Query Tuning
      Tuning – Database Be Kind to your Database
      • Hibernate, Toplink, ORM bugs
        • indexes not created
        • Indexes poorly used
      • Differences between databases
        • Remember: Primary/Foreign keys
      Tuning – Database Index, Index, Index
      • Application Caching
      • ORM Caching
      • Database-side caching & tuning
        • e.g. MySQL QueryCaching
      Tuning – Database Caching
      • Audit Your Configuration
      • MySQL:
        • url@javax.sql.BaseDataSource=jdbc:mysql:// localhost:3306/sakai? useUnicode=true&characterEncoding=UTF -8&useServerPrepStmts=false&cachePrepSt mts=true&prepStmtCacheSize=4096&prep StmtCacheSqlLimit=4096 
      Tuning – Database Configuration
    14. Approach – Measure Performance “ JVM Tuning ~ Black Magic”
    15. Approach – Measure Performance
      • JVM Memory Model
      • JVM Versions
      • Heap Settings
      • GC Tuning
      Tuning – JVM Key Factors
      • JDK 1.4 (Hotspot)
      • JDK 1.5
      • JDK 1.5 (64-bit)
      • JDK 6
      Tuning – JVM Sun JVM Versions
    16. Tuning – JVM Memory Model
      • -d64 –Xmx3000m –Xms3000m –Xmn1g -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:MaxPermSize=256m -XX:PermSize=64m
      Tuning – JVM JVM Options: Heap & GC
      • http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
      • http://java.sun.com/performance/reference/whitepapers/tuning.html
      • http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
      Tuning – JVM Resources
      • -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintAdaptiveSizePolicy -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime
      Tuning – JVM Verbose GC
      • Profilers
        • Yourkit
      • GC Visualizers
        • http://java.sun.com/performance/jvmstat/visualgc.html
      Tuning – JVM More Handy Tools
    17. Approach – Measure Performance “ Is this a test?”
      • Load Testing
        • Soak Testing
        • Capacity Testing
        • Throughput Testing
      • QA
      Testing Testing
      • Script
        • Environment
        • Conditions
        • Reports
      Testing Load Testing
      • Develop a comparison point
        • Base workload
        • Typical workload
        • Minimum workload
      Testing Baselining
      • Soak: What happens over time?
      • Capacity: What happens with xxx users?
        • Or xxxx users?
        • Or xxxxx users?
      • Throughput: How much can I push?
      Testing Probe Seams
      • What’s next year’s anticipated enrollment?
        • Usage?
        • Scheduling?
      • Have we had problems in the past?
      Testing Refine Test Scenarios
      • What do you need to setup?
      • What do you need to teardown?
      • How do you start?
        • Stop?
        • Watch?
      Testing Automate, Automate, Automate
      • Small changes can have large impacts
      • If you thought it would cause problems, would you ever put it in?
      • Fixing problems before they become problems helps us sleep at night
      Testing Test Regularly
      • Load Generators
        • Jmeter - http://jakarta.apache.org/jmeter/
        • Mercury Loadrunner
      • Functional Test Tools
        • Wiki & Documentation
        • Selenium - http://selenium.openqa.org/
      Testing Tools
    18. Approach – Measure Performance “ I’m done, right?”
      • Portals are dynamic environments
        • Content is always changing
        • Users can modify the environment
        • Lots of interactions
      Monitoring Monitoring – Know When It Breaks
      • When writing portlets, think about errors
      • Logging is good: Never eat an exception
        • Catch (Exception e) {}
      • Sometimes calling home is better
      Monitoring Error Reporting
    19. Approach – Measure Performance Automate, Automate, Automate
    20. Approach – Measure Performance
      • Notification
        • Nagios
      • Log Analysis
        • Splunk
        • grep
      Monitoring Monitoring Tools
      • Ken & Erin for assistance & review
      • Dan Mindler - everything I know about the JVM I learned from Dan
      • Chuck Hedrick - lots of experimentation at Rutgers with tweaking & tuning
      • Steve Souders @ Yahoo – client tuning
      Monitoring Acknowledgements
    21. Approach – Measure Performance Let’s Talk

    + Jason ShaoJason Shao, 7 months ago

    custom

    352 views, 0 favs, 0 embeds more stats

    Tuning portlets & other items

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 352
      • 352 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 18
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories