AjaxScope: Remotely Monitoring Client-side Web-App Behavior

Similar documents
AjaxScope: A Platform for Remotely Monitoring the Client-Side Behavior of Web 2.0 Applications

AjaxScope: A Platform for Remotely Monitoring the Client-Side Behavior of Web 2.0 Applications

Live Monitoring: Using Adaptive Instrumentation and Analysis to Debug and Maintain Web Applications

SiteCelerate white paper

Monitoring the Real End User Experience

Drupal Performance Tuning

Performance Testing for Ajax Applications

Front-End Performance Testing and Optimization

10 Analytics & Optimization. From Code to Product gidgreen.com/course

Sitecore Health. Christopher Wojciech. netzkern AG. Sitecore User Group Conference 2015

Accelerating Wordpress for Pagerank and Profit

Mobile Performance Management Tools Prasanna Gawade, Infosys April 2014

Capacity Planning. Capacity Planning Process

CMS Diagnostics Guide

Debugging Mobile Apps

Outline. Introduction. WebQuilt and Mobile Devices: A Web Usability Testing and Analysis Tool for the Mobile Internet

Testing on the other side of the pendulum

FIVE WAYS TO OPTIMIZE MOBILE WEBSITE PERFORMANCE WITH PAGE SPEED

Using a Generic Plug and Play Performance Monitor for SoC Verification

Titolo del paragrafo. Titolo del documento - Sottotitolo documento The Benefits of Pushing Real-Time Market Data via a Web Infrastructure

Best of Breed of an ITIL based IT Monitoring. The System Management strategy of NetEye

Performance testing Web 2.0

Scaling out a SharePoint Farm and Configuring Network Load Balancing on the Web Servers. Steve Smith Combined Knowledge MVP SharePoint Server

Dynamic Content Acceleration: Lightning-Fast Web Apps with Amazon CloudFront and Amazon Route 53

ADS2013: App Development with SharePoint 2013

Business Application Services Testing

Testing Mobile Software

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

Performance Optimization For Operational Risk Management Application On Azure Platform

Production time profiling On-Demand with Java Flight Recorder

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Progressive Enhancement With GQuery and GWT. Ray Cromwell

Building a Mobile App Security Risk Management Program. Copyright 2012, Security Risk Advisors, Inc. All Rights Reserved

Microsoft SQL Server: MS Performance Tuning and Optimization Digital

Ajax Development with ASP.NET 2.0

Mobile Performance Testing Approaches and Challenges

SharePoint Performance Optimization

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

Why Mobile Performance is Hard

Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois

Demystifying Page Load Performance with WProf

Lustre Networking BY PETER J. BRAAM

SQL Server Performance Tuning and Optimization

Integrating Web Messaging into the Enterprise Middleware Layer

Monitoring Agent for Microsoft Exchange Server Fix Pack 9. Reference IBM

Optimize Your Microsoft Infrastructure Leveraging Exinda s Unified Performance Management

Adobe ColdFusion 11 Enterprise Edition

Web Caching and CDNs. Aditya Akella

1 How to Monitor Performance

Blackbaud NetCommunity Configuration Overview

Scaling Web Applications in a Cloud Environment. Emil Ong Caucho Technology 8621

Application Performance. Java.,.NET and the IBM i. Rory Hewitt. Co-branded Logo Footprint Aligned LEFT ON COVER ONLY Must Fit Within This Space

MEASURING WORKLOAD PERFORMANCE IS THE INFRASTRUCTURE A PROBLEM?

Reliable Mitigation of DOM-based XSS

THE SMARTEST WAY TO PROTECT WEBSITES AND WEB APPS FROM ATTACKS

Java Monitoring. Stuff You Can Get For Free (And Stuff You Can t) Paul Jasek Sales Engineer

Title Release Notes PC SDK Date Dealt with by, telephone. Table of Content GENERAL Corrected Issues PDD...

DATA COMMUNICATOIN NETWORKING

Addressing Performance and Security in a Screen Reading Web Application that Enables Accessibility Anywhere

IMCM: A Flexible Fine-Grained Adaptive Framework for Parallel Mobile Hybrid Cloud Applications

Instant Chime for IBM Sametime Installation Guide for Apache Tomcat and Microsoft SQL

Architectural Overview

Speeding Foreign Exchange (FX) Mobile Trading Apps

Best Practices for Web Application Load Testing

PTC System Monitor Solution Training

<Insert Picture Here> Oracle Web Cache 11g Overview

Performance Optimization and Debug Tools for mobile games with PlayCanvas

Sitecore Dashboard User Guide

Mobile Application Performance Report

Introduction to Cisco Inventory and Reporting

Government Girls Polytechnic, Bilaspur

Capacity Planning. The purpose of capacity planning is to:

Evaluating and Comparing the Impact of Software Faults on Web Servers

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

Advanced Web Application Development using Microsoft ASP.NET

What s New in IBM Web Experience Factory IBM Corporation

WebTorrent: a BitTorrent Extension for High Availability Servers

Evaluation and Optimization of Web Application Performance Under Varying Network Conditions

Development Techniques for Native/Hybrid Tizen Apps. Presented by Kirill Kruchinkin

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Using WebLOAD to Monitor Your Production Environment

Introduction to IBM Worklight Mobile Platform

Nginx 1 Web Server Implementation

Data Sheet: Work Examiner Professional and Standard

Braindumps.C questions

RightNow November 09 Workstation Specifications

CTX-1259BI Citrix Presentation Server 4.5 and XenApp 5.0 for Windows Server 2003: Administration

Load and Performance Load Testing. RadView Software October

Release Notes LS Retail Data Director August 2011

Analyzing HTTP/HTTPS Traffic Logs

A Baseline for Web Performance

Software Engineering for LabVIEW Applications. Elijah Kerry LabVIEW Product Manager

Wide-area Network Acceleration for the Developing World. Sunghwan Ihm (Princeton) KyoungSoo Park (KAIST) Vivek S. Pai (Princeton)

Polaris: Faster Page Loads Using Fine-grained Dependency Tracking

Configuring the LCDS Load Test Tool

Monitoring applications in multitier environment. Uroš Majcen A New View on Application Management.

PERFORMANCE TESTING CRASH COURSE

WAN Optimization for Microsoft SharePoint BPOS >

Setup The package simply needs to be installed and configured for the desired CDN s distribution server.

Website Optimization Tips for Speed

Transcription:

AjaxScope: Remotely Monitoring Client-side Web-App Behavior Emre Kıcıman emrek@microsoft.com Ben Livshits livshits@microsoft.com Internet Services Research Center Microsoft Research Runtime Analysis & Design Microsoft Research

A Web Application

A Web Application Talks to >14 backend services (traffic, images, search, directions, ads, ) ~ 1 MB code 70k lines of JavaScript code downloaded to the client. 2855 Functions

Web 1.0 Web 2.0 Server-side computation Static HTML Client-side rendering

Web 1.0 Web 2.0 Server-side computation Static HTML JavaScript + DHTML Client-side rendering Client-side computation

Web App Challenges Code complexity: more client-side code Ex. Maps.live.com: 1MB of code, 70k LoC Bugs, race conditions, memory leaks, Non-standard execution environments Many APIs differ across browsers Perf of simple ops vary 10x-100x across impl. Third-party dependencies (e.g., mash-ups) Missing: Visibility into behavior on clients

Outline 1. Motivation 2. AjaxScope Platform 3. Expt: Adaptive instrumentation 4. Expt: Distributed instrumentation 5. Conclusions

AjaxScope Approach Goal: Detailed visibility into app behavior in the client Approach: On-the-fly rewriting to add instrumentation Key Enabler: Instant re-deployability of web apps

Monitoring Goals Performance Optimization Performance profiling String optimization; cache placement; Code splitting and joining Debugging Report function arguments, app state, errors Memory leak checking Statistical debugging Test Code coverage A/B tests Operations Measure RPC network latencies User interaction feedback What features are being used / discovered?

Approach: JavaScript Rewriting Simple but powerful monitoring Inspect application state Observe control flow Limited only by JS sandbox Easy deployability No changes required to original web app No changes to client-side browsers

Example: Record Function Args 1. Search JavaScript AST for function definitions 2. For each function definition, add a statement to report every argument. function foo(a,b) { // do something } function foo(a,b) { sendlog( value of a= +a); sendlog( value of b= +b); // do something } sendlog() queues up messages for bulk reporting to AjaxScope

Deploying AjaxScope

Users Server-side Deployment

Our Prototype (Client-side) Researcher Logs

AjaxScope Proxy Rewritten Web Page Rewriting Engine JS Parser Web Page Logs Log Collector Instrumentation #1 Instrumentation #2 Pluggable policies Controls rewriting based on incoming logs Platform support for adaptive and distributed instrumentation

Rewrite On-the-fly Service has tight control over code running at client Clients always download new version Cache-ability controlled by service Enables dynamic instrumentation Use to reduce performance overhead 1. Adaptive instrumentation 2. Distributed Instrumentation Also enables A/B tests to compare versions

Outline 1. Motivation 2. AjaxScope Platform 3. Expt: Adaptive instrumentation 4. Expt: Distributed instrumentation 5. Conclusions

Portals Maps Experimental Setup Profile 90 web sites startup Client-side AjaxScope Site Code Size (kb) # of Functions Exec Time (ms) maps.google.com 295 1935 530 maps.live.com 924 2855 190 msn.com 124 592 300 yahoo.com 278 1097 670 google.com/ig 135 960 190 protopages.com 599 1862 13780 + 6 more JS-heavy news & game sites + 78 sites randomly chosen, weighted by popularity

Adaptation: Drill-down Perf Profiling Naïve: Add timestamps everywhere Too expensive! (both CPU and logging BW) Instead, auto-drill-down based on user experience <script> LogTime(); FastFunc1(); FastFunc2(); SlowFunc(); LogTime(); </script> If it s slow <script> LogTime(); FastFunc1(); LogTime(); FastFunc2(); LogTime(); SlowFunc(); LogTime(); </script> Found it! <script> FastFunc1(); FastFunc2(); SlowFunc(); </script> function SlowFunc() { // drill-down continues }

Perf Overhead Logging BW Overhead (bytes) Adaptation Results Full Profiling Drill-down Profiling Full Profiling Drill-down Profiling 300% 250% 200% 150% 100% 10,000,000 1,000,000 100,000 10,000 1,000 100 50% 10 0% Web sites 1 Web Sites Avg 30% reduction in CPU Overhead 95% Avg Reduction in Logging Bandwidth

Outline 1. Motivation 2. AjaxScope Platform 3. Expt: Adaptive instrumentation 4. Expt: Distributed instrumentation 5. Conclusions

Monitoring for JS Memory Leaks Mem leaks major problem in older browsers Web apps can work-around E.g., Circular reference across DOM + JavaScript memory heaps Instrumentation looks for runtime patterns indicative of leak Expensive! Use distribution to reduce per-user overhead

Example: CNN.com var pipelinecontainers = document.getelementbyid("cnnpipelinemodule").... getelementsbytagname("div"); for (var i=0; i<pipelinecontainers.length; i++){ } var pipelinecontainer = pipelinecontainers[i]; if(pipelinecontainer.id.substr(0,9) == "plinecntr") { } First, get DOM elements pipelinecontainer.onmouseover = function () {CNN_changeBackground(this,1); return false;} Then, set their event handlers to a new function

Example: CNN.com var pipelinecontainers = document.getelementbyid("cnnpipelinemodule").... getelementsbytagname("div"); for (var i=0; i<pipelinecontainers.length; i++){ DOM object } } var pipelinecontainer = pipelinecontainers[i]; JavaScript Object if(pipelinecontainer.id.substr(0,9) == "plinecntr") { pipelinecontainer.onmouseover = function () {CNN_changeBackground(this,1); return false;} function closure references pipelinecontainer

Checking for Memory Leaks Check all object assignments for potential cycles a.b = c; a.b = c TraverseHeapAndCheckForCycles(c, a); Distribute expensive traversals across users Each user gets random N% of checks Controls per-user overhead

Cnn.com Startup (ms) Distribution Gives Fine Control of Per-User Overhead 2000 1800 1600 1400 1200 1000 800 600 400 200 0 0% 20% 40% 60% 80% 100% % of cycle checks distributed to single user Baseline Trade-off per-user overhead vs. detection speed

Outline 1. Motivation 2. AjaxScope Platform 3. Expt: Adaptive instrumentation 4. Expt: Distributed instrumentation 5. Conclusions

Related Work JavaScript rewriting for safety & security BrowserShield and CoreScript Monitoring and tracing systems E.g., Magpie, Project5 Dynamic and adaptive instrumentation In parallel computing cluster: ParaDyn Runtime program analysis for bug finding Statistical debugging, taint analysis,

Future Work Platform improvements: Integrate caching considerations into rewriting Limit risk of bad rewriting with meta-monitoring Improved information protection Collecting data and analysis: Compare executions across users to find outliers Collect dynamic call graphs to inform smart prefetching

Conclusions End-to-end visibility into client-side web app Requires no client-side / server-side changes Distribution and adaptation controls overhead While maintaining high coverage & detail Demonstrated variety of instrumentation policies Performance profiler, memory leak checker, cache placement, Download and extend the prototype http://research.microsoft.com/projects/ajaxview/ Supports plug-ins for new instrumentation policies

(this page intentionally left blank)