AJAX Performance and Monitoring

Similar documents
Comet and WebSocket Web Applications How to Scale Server-Side Event-Driven Scenarios

Developing Ajax Web Apps with GWT. Session I

,

Tooling for Ajax-Based Development. Craig R. McClanahan Senior Staff Engineer Sun Microsystems, Inc.

Lightstreamer. The Streaming-Ajax Revolution. Product Insight

OSSW ICOSST 2009, Al-Khawarizmi Institute of Computer Science University of Engineering and Technology, Lahore

Web 2.0 Käyttöliittymätekniikat

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

Upload to your web space (e.g., UCSC) Due this Thursday 4/8 in class Deliverable: Send me an with the URL Grading:

But before understanding the Selenium WebDriver concept, we need to know about the Selenium first.

COPYRIGHTED MATERIAL

AJAX: Rich Internet Applications

J Optimizer 1.0 User Guide

Credits: Some of the slides are based on material adapted from

GRITS AJAX & GWT. Trey Roby. GRITS 5/14/09 Roby - 1

Zero Latency HTTP The comet Technique

F10 "CHALLENGES IN PERFORMANCE TESTING OF AJAX APPLICATIONS" Rajendra Gokhale Aztecsoft BIO PRESENTATION PAPER 5/18/ :15:00 AM

IBM JZOS Meets Web 2.0

Kaazing Gateway: An Open Source

HTTP, WebSocket, SPDY, HTTP/2.0

Interactive webmaps with ArcGIS. Kristel Meikas, AlphaGIS

Short Test Cycles for Performance Testing with TruClient Technology

What the Bayeux? Filip Hanik. SpringSource Inc Keystone, Colorado, Slide 1

HP TruClient technology: Accelerating the path to testing modern applications. Business white paper

Interactive Websites: Comet and DWR. Joe Walker, SitePen

SSC - Web applications and development Introduction and Java Servlet (I)

Seminar report Google App Engine Submitted in partial fulfillment of the requirement for the award of degree Of CSE

AJAX Programming Overview. Introduction. Overview

Implementing Asynchronous Web Application using Grizzly's Comet. Jeanfrancois Arcand Staff Engineer Java WebTier

Luckily, our enterprise had most of the back-end (services, middleware, business logic) already.

Why load test your Flex application?

Using Smart Tools to Write Good Code

<Insert Picture Here> Oracle Policy Automation 10.0 System Requirements

AJAX Programming Chris Seddon

When learning coding, be brave

Module 6 Node.js and Socket.IO

Web Architecture and Technologies

COPYRIGHTED MATERIAL. Part I: Getting Started. Chapter 1: Introducing Flex 2.0. Chapter 2: Introducing Flex Builder 2.0. Chapter 3: Flex 2.

<Insert Picture Here> Oracle Policy Automation System Requirements

The Next Generation of Eclipse: e4. Mike Milinkovich Executive Director Eclipse Foundation

JavaScript Doesn't Have to Hurt: Techniques, Tools and Frameworks to Ease JavaScript Development

Active Endpoints. ActiveVOS Platform Architecture Active Endpoints

Browser Problems In Ajax Applications

Komodo IDE 4. Multi-platform, multi-language IDE for dynamic languages and Ajax technologies.

Rails powered by GlassFish & jmaki

Customizing a Packaged Application for a J2EE Environment: A Case Study. Leslie Tierstein TopTier Consulting, Inc.

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

Performance Tune your Ajax Applications. The Ajax Experience 2007 Bob Buffone

Building next-gen Web Apps with WebSocket. Copyright Kaazing Corporation. All rights reserved.

White Paper. Major Performance Tuning Considerations for Weblogic Server

13 th Annual International Software Testing Conference in India 2013

Business white paper. Setting the pace. Testing performance on modern applications

Hackveda Appsec Labs Java Programming Course and Internship Program Description:

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

Enabling Performance & Stress Test throughout the Application Lifecycle

IBM Integration Bus v9.0 System Administration: Course Content By Yuvaraj C Panneerselvam

FIREFLY ARCHITECTURE: CO-BROWSING AT SCALE FOR THE ENTERPRISE

Web Browser as an Application Platform Antero Taivalsaari

Backend Web Frameworks

TUTORIAL: WHITE PAPER. VERITAS Indepth for the J2EE Platform PERFORMANCE MANAGEMENT FOR J2EE APPLICATIONS

Distributed Architectures & Microservices. CS 475, Spring 2018 Concurrent & Distributed Systems

Index. Bitwise operations, 131. Cloud, 88, 101

Corey Clark PhD Daniel Montgomery

Programming for Digital Media. Lecture 7 JavaScript By: A. Mousavi and P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Web 2.0, AJAX and RIAs

1. I NEED TO HAVE MULTIPLE VERSIONS OF VISUAL STUDIO INSTALLED IF I M MAINTAINING APPLICATIONS THAT RUN ON MORE THAN ONE VERSION OF THE.

eclipse rich ajax platform (rap)

Mischa Kölliker. JavaLounge Zürich, 23. Juni 2009

Top Ten Enterprise Java performance problems. Vincent Partington Xebia

Project Horizon Technical Overview. Steven Forman Principal Technical Consultant

AJAX: From the Client-side with JavaScript, Back to the Server

Project Horizon Technical Overview. Bob Rullo GM; Presentation Architecture

Using JavaScript on Client and Server with Project Phobos

CS533 Concepts of Operating Systems. Jonathan Walpole

Asynchronous Ajax for Revolutionary Web Applications. Jeanfrancois Arcand Ted Goddard, Ph.D.

Scaling DreamFactory

ArcGIS Enterprise Performance and Scalability Best Practices. Andrew Sakowicz

Java EE 7 is ready What to do next? Peter Doschkinow Senior Java Architect

Making Ajax Easy With Model-Glue. Joe Rinehart Firemoss, LLC

More on Testing and Large Scale Web Apps

Performance Case Study

SEDA: An Architecture for Well-Conditioned, Scalable Internet Services

TomcatCon London 2017 Clustering Mark Thomas

Not just an App. Server

PHP 6 & The PHP Collaboration Project Present & Future. Zeev Suraski Co-founder & CTO, Zend Technologies Co-architect of PHP

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Client-side Debugging. Gary Bettencourt

What Is NetBeans? Free and open-source based > Open source since June, 2000 > Large community of users and developers

Tapestry. Code less, deliver more. Rayland Jeans

Getting the Most from Eclipse

Runtime Application Self-Protection (RASP) Performance Metrics

IBM Rational Developer for System z Version 7.5

Improve Web Application Performance with Zend Platform

VA Smalltalk Update. John O Keefe Principal Smalltalk Architect Instantiations, Inc. Copyright, Instantiations, Inc.

P a g e 1. Danish Tecnological Institute. Developer Collection Online Course k Developer Collection

Automated testing in ERP using Rational Functional Tester

Improve and Expand JavaServer Faces Technology with JBoss Seam

WebSphere Puts Business In Motion. Put People In Motion With Mobile Apps

PaaS Cloud mit Java. Eberhard Wolff, Principal Technologist, SpringSource A division of VMware VMware Inc. All rights reserved

Getting Started with the ArcGIS API for JavaScript. Julie Powell, Paul Hann

Transcription:

AJAX Performance and Monitoring Ron Bodkin, Glassbox Leader ron.bodkin@glassbox.com Rod Bodkin AJAX Performance and Monitoring Page 1

Agenda AJAX Overview AJAX Technology Challenges Solutions Rod Bodkin AJAX Performance and Monitoring Page 2

AJAX Rod Bodkin AJAX Performance and Monitoring Page 3

AJAX Defined Asynchronous JavaScript And XML A group of technologies: HTML, JavaScript and XML Still HTML-based, but with JavaScript packages that make web pages feel more responsive Parts of a page fetch data and update without the major re-load everyone is used to Used correctly, Ajax brings the interactivity of good desktop apps to the Web, such as a spell checker that checks on the fly like Outlook. Ajax can be chatty, so it needs a good network and thoughtful design Rod Bodkin AJAX Performance and Monitoring Page 4

Other Options Fat Client Most interactive Hard to distribute, maintain HTML Easy to write, most portable Less interactive especially on WAN Flash Wide deployment (>95%) still mostly used for animation Harder to develop, integrate Java applets had early promise, limited to a niche Microsoft XAML/Avalon Windows Vista only ask me in 2009 Rod Bodkin AJAX Performance and Monitoring Page 5

Why AJAX? Rich interactivity Responsiveness like a desktop app Lively site Ease of use Browser-based Standards Ubiquitous Easy update Productive, usable, networked applications Rod Bodkin AJAX Performance and Monitoring Page 6

Why Now? Technology matured Successful large-scale applications Emergence of tools and frameworks Even as IE went from 95% to 85% share Rod Bodkin AJAX Performance and Monitoring Page 7

New Interaction Patterns Source: Adaptive Path Rod Bodkin AJAX Performance and Monitoring Page 8

Agenda AJAX Overview AJAX Technology Challenges Solutions Rod Bodkin AJAX Performance and Monitoring Page 9

Enabling Technologies XMLHttpRequest Allows asynchronous communication with server Generates events as data is received JavaScript Better portability across major browsers Still a lot of conditional logic required Dynamic updates to page DOM gives full object access innerhtml attribute for modifying HTML inside a tag Rod Bodkin AJAX Performance and Monitoring Page 10

Javascript (Browser) Libraries dojo (widgets, packaging, utilities, persistence) Prototype (framework) script.aculo.us (effects, widgets) AjaxTK/Apache Kabuki - Zimbra (widgets) Yahoo! User Interface Library (widgets) TIBCO General Interface (framework & tools) Rod Bodkin AJAX Performance and Monitoring Page 11

Browser + Server Frameworks Java DWR (Direct Web Remoting) Google Web Toolkit ZK AjaxTags Ajax4JSF PHP Symfony AjaxAC.NET Atlas Ajax.NET MagicAjax.NET Ruby on Rails Python: Django Perl Catalyst CGI::Ajax Rod Bodkin AJAX Performance and Monitoring Page 12

Example: DWR 1.0 AJAX Source: Getahead Rod Bodkin AJAX Performance and Monitoring Page 13

Reverse AJAX: Automatic Updates Server Browser Event Update? Script Rod Bodkin AJAX Performance and Monitoring Page 14

Reverse AJAX: Polling Server Browser Event Update Script Rod Bodkin AJAX Performance and Monitoring Page 15

Reverse AJAX: Comet Server Browser Start Event Update Script Rod Bodkin AJAX Performance and Monitoring Page 16

Reverse AJAX: Piggy Back Server Browser Event Request Reply Update Script Often discussed, but who is implementing it? Rod Bodkin AJAX Performance and Monitoring Page 17

Widgets, e.g., Google Web Toolkit Rod Bodkin AJAX Performance and Monitoring Page 18

Direct Service Integration Web page AJAX engine Mash-ups Google Maps Credit Agency Order Service Rod Bodkin AJAX Performance and Monitoring Page 19

Indirect Service Integration Web page AJAX engine Google Maps Credit Agency Aggregation server Order Service Rod Bodkin AJAX Performance and Monitoring Page 20

Proxy Web Service Integration Web page AJAX engine Google Maps Credit Agency Proxy server Order Service Rod Bodkin AJAX Performance and Monitoring Page 21

Agenda AJAX Overview AJAX Technology Challenges Solutions Rod Bodkin AJAX Performance and Monitoring Page 22

AJAX Problem Areas Excess server requests JavaScript problems Server load Service fragility Integration server problems Rod Bodkin AJAX Performance and Monitoring Page 23

Excess Server Requests Adds complexity One single action can generate a flood of requests Or a handful of slower ones What happens if some are unreliable? One missing timeout can produce a huge backlog Hard to Monitor End User Performance Initial page load time isn t the issue Can t determine cause of requests without page analysis Hard to correlate Requests with Pages let alone User Actions Rod Bodkin AJAX Performance and Monitoring Page 24

JavaScript Problems Not as fast as compiled languages! Processing large data sets is hard Engines can do a lot of work Browser portability is still an issue May require digging into framework code Stateful UI s: what interactions led to errors? Debugging nested DOM/CSS/JS Accessibility HTTP limit of 2 simultaneous connections per server by default (configurable) Rod Bodkin AJAX Performance and Monitoring Page 25

Server Load: Pre-AJAX Short spikes of activity Long pauses of inactivity think time Efficient for use of server sockets and threads Can tax CPU Dynamic pages integrate big static chunks Rod Bodkin AJAX Performance and Monitoring Page 26

Server Load: AJAX Initial download of engine (static content) Bursts of activity (change of context) With more frequent updates Typically shorter less intensive interactions Frequent requests and polling use network, CPU, sockets, and threads Comet instead uses much more sockets and typically threads and buffers More demanding of client too More static content Rod Bodkin AJAX Performance and Monitoring Page 27

Service Fragility Each service is a possible point of failure Outages Configuration problems Changes to service Cascading slowness possible Not meeting SLA Tests robustness/race conditions in browser Rod Bodkin AJAX Performance and Monitoring Page 28

Integration Server Problems Slow database query Too many queries Bottlenecks from aggregating many services memory, sockets, Contention for locks in server lots of threads for one session Outages/misconfiguration Traditional problems in a new context Rod Bodkin AJAX Performance and Monitoring Page 29

Typical Application Problems Rod Bodkin AJAX Performance and Monitoring Page 30

Agenda AJAX Overview AJAX Technology Challenges Solutions Rod Bodkin AJAX Performance and Monitoring Page 31

The Performance Lifecycle Operate Monitor Update Define Service level Test Load test often Multi-platform Design Load test architecture Create budget Develop Code & debug Unit tests Troubleshoot Rod Bodkin AJAX Performance and Monitoring Page 32

Architecture Is Key AJAX shuffles the deck Changed workloads Emerging, immature technologies Allocate work sensibly Informs basic goals and SLA s Budgets for both latency and scalability Interactive events (heavy & light) Update callbacks Prototype basic elements Many new technologies at play Extrapolate to model performance Rod Bodkin AJAX Performance and Monitoring Page 33

Server Options The usual suspects Java EE (Tomcat, JBoss, Jetty, GlassFish, WebSphere*, WebLogic* ).NET for Windows* LAMP Emerging networking options Grizzly event-based HTTP Connector (in GlassFish) COMETd (Perl) Twisted (Python) Scala, Erlang/OTP (Concurrency Oriented Languages) Apache 2 Event MPM Continuation support * Indicates cost to use. Rod Bodkin AJAX Performance and Monitoring Page 34

Emerging Standards? The Jetty open source Java Web container: Uses NIO to only use threads when processing I/O Server requests set up a continuation If waiting for data, they suspend by throwing When data is available, they are resumed The server replays the processing, but the next time they will continue Continuations allow using one thread per active request Also uses NIO split buffers to limit buffers for many requests DWR 2 s Reverse AJAX works with Jetty continuations Supports polling & COMET Rod Bodkin AJAX Performance and Monitoring Page 35

Continuations Object to represent the state of program execution Native support in dynamic languages like Ruby, Smalltalk Java options rely on specialized state Jetty implementation supports AJAX scalability Requires no side effects in code Replays state based on request state & session state Doesn t checkpoint session state Other frameworks use to simplify conversations RIFE framework for Java Seaside framework for Smalltalk Rod Bodkin AJAX Performance and Monitoring Page 36

Eclipse IDE Support ATF (editor, debugger) MyEclipse * (editor, code assist, debugger) Aptana * (code completion) IntelliJ IDEA* (refactoring editor) * Indicates cost to use. Rod Bodkin AJAX Performance and Monitoring Page 37

Browser Development Tools Debugging Mozilla Venkman debugger & profiler Microsoft Script Debugger for IE Inspectors WebDeveloper toolbar for Firefox: CSS, inspector FireBug console viewer, inspector, debugger Mouseover DOM Inspector Request monitoring FireBug GreaseMonkey: XMLHttpRequest Tracing/Debugging Eclipse ATF Logging: MochiKit, dojo server-side? * Indicates cost to use. Rod Bodkin AJAX Performance and Monitoring Page 38

Venkman Profiling Output 33 <http://localhost:8080/glassbox/dwr/util.js> util.js: 750-2500 milliseconds Function Name: anonymous (Lines 294-375) Total Calls: 6930 (max recurse 0) Total Time: 2093.01 (min/max/avg 0/10.02/0.3) Time (ex. calls): 1011.45 (min/max/avg 0/10.02/0.15) 35 <http://localhost:8080/glassbox/js/troubleshooter.js> troubleshooter.js: 750-2500 milliseconds Function Name: loadrowinfo (Lines 78-83) Total Calls: 99 (max recurse 0) Total Time: 2293.3 (min/max/avg 20.03/40.06/23.16) Time (ex. calls): 0 (min/max/avg 0/0/0) Rod Bodkin AJAX Performance and Monitoring Page 39

Unit Test Baseline test for functionality AND performance In browser Script.aculo.us, JsUnit, ASTUce JavaScript unit tests Rhino, MS Windows Script Host JavaScript Coverage Validator (beta)* On server JUnit, NUnit Java Coverage: Emma, Cobertura, Clover* * Indicates cost to try or use. Rod Bodkin AJAX Performance and Monitoring Page 40

System Test Functional system tests (in browser) Script recording and playback validation Selenium, Squish/Web* Script code objects (e.g., for JUnit) Waitij/Waitir (Win/IE scripting for Java/Ruby) Load and Stress tests: simulate traffic OpenSTA (http/s only confused by gmail) JMeter (http/s only) LoadRunner (http/s, script objects too)* * Indicates cost to try or use. Rod Bodkin AJAX Performance and Monitoring Page 41

Configuration Tune based on Load Test Network Load balancers, firewalls, routers OS level Maximum sockets Maximum threads Web server Timeouts Application server Threads Timeouts VM Memory settings (e.g., -Xss thread stack size) Rod Bodkin AJAX Performance and Monitoring Page 42

Systems Monitoring Network-level Router, sniffer metrics: throughput, latency End-user response time (not just http pings!) Customer Experience Management complicated: Keynote*, TeaLeaf* OS-level : sockets, IO, processes, CPU netstat, top, Nagios, Hyperic, HP Openview*, Tivoli* * Indicates cost to try or use. Rod Bodkin AJAX Performance and Monitoring Page 43

Using Fiddler: Mail Login & View Yahoo Mail Beta Request Count: 52 Bytes Sent: 61,069 Bytes Received: 165,677 US West Coast (DSL - 30KB/sec) Round trip cost: 5.20s Elapsed Time: 12.20s Gmail Request Count: 48 Bytes Sent: 55,443 Bytes Received: 51,044 US West Coast (DSL - 30KB/sec) Round trip cost: 4.80s Elapsed Time: 7.80s Rod Bodkin AJAX Performance and Monitoring Page 44

App Server Monitoring Container Server JMX: request queue, pools, throughput Java VM with Java 5 JMX Data All threads, memory Key elements threads, memory, request queues, throughput, etc. * Indicates cost to try or use. Rod Bodkin AJAX Performance and Monitoring Page 45

App Monitoring with Aspects Aspects run automatically at well-defined points at runtime No need to instrument code Allows low overhead tracking Easy to update monitoring policies Enable and disable, even sampling Standardized support AspectJ load-time weaving avoids changes to build process Popular extensible language for Java 5 javaagents Spring AOP allows proxy-based option for coarse-grained components Flexibility Reuse open source monitors for common APIs Easy to extend for custom monitoring Rod Bodkin AJAX Performance and Monitoring Page 46

Glassbox Open Source Client Machine Browser HTTP Application Agent Application Server Machine Web Server AOP Web Services Java Application Java Virtual Machine Any Database Java 1.4+ Discovers and tracks operations as they execute Load-time weaving Low overhead Detects common problems, e.g. AJAX latency, load Excess queries Slow/broken Web services Rod Bodkin AJAX Performance and Monitoring Page 47

Troubleshooting Tools Provide 1. Aggressive data filtering can reduce the data haystack early 2. Troubleshooting intelligence means users need not be experts in the tool or have written the system Benefits 3. Cleaner data and more accurate diagnoses streamline communication Fix problems faster and cheaper by streamlining communication. Fix more problems by enabling non-experts to track them down. Rod Bodkin AJAX Performance and Monitoring Page 48

Bringing It Together DEMO Rod Bodkin AJAX Performance and Monitoring Page 49

Conclusions AJAX is now ready for prime time Emphasize high-value interactivity Supporting technologies becoming mainstream But test carefully and watch for shifts Focus on architecture up front Benchmark latency and throughput Integrate monitoring and troubleshooting up front We re looking for collaborators to build better AJAX monitoring & troubleshooting Please leave your business card to get updates These slides will be updated on the post-conference CD Rod Bodkin AJAX Performance and Monitoring Page 50

Resources Ajaxian for News: www.ajaxian.com Ajax Patterns for Technologies: ajaxpatterns.org Ajax: A New Approach to Web Applications: http://adaptivepath.com/publications/essays/archives/000385.php Ajax Impact on Server Scaling: www.zimbra.com/blog/archives/2006/04/ajax_impact_on.html Scaling Connections for AJAX with Jetty 6: www.mortbay.com/mb/log/gregw/?permalink=scalingconnections.html Not There Yet: COMET with Apache and Jetty: http://blogs.pathf.com/agileajax/2006/05/not_there_yet_c.html What I Didn t Know About XHR: http://www.oreillynet.com/xml/blog/2006/10/what_i_didnt_know_about_xhr.html Glassbox: www.glassbox.com Rod Bodkin AJAX Performance and Monitoring Page 51