 Emre Kıcıman Researcher Microsoft Corporation  Ethan Jackson Post Doc Researcher Microsoft Corporation BAM Ajax View Doloto.

Download Report

Transcript  Emre Kıcıman Researcher Microsoft Corporation  Ethan Jackson Post Doc Researcher Microsoft Corporation BAM Ajax View Doloto.

 Emre Kıcıman
Researcher
Microsoft Corporation
 Ethan Jackson
Post Doc Researcher
Microsoft Corporation
BAM
Ajax View
Doloto
 Ethan Jackson
RiSE – MSR Redmond
Microsoft Corporation
 Wolfram Schulte
RiSE – MSR Redmond
Microsoft Corporation
The weather might be stormy
We want the “Internet-as-a-Platform,” but how can we:
(1) Master necessary implementation technologies ?
(2) Predict behavior of the overall application?
1. Distributed Systems Programming
2. Web Development
3. Uncertainty of Computer Fabric
Your model is your weather man
BAM provides technology-independent abstractions for
modeling cloud applications.
Ask the model how the system behaviors, pre-implementation.
Then, synthesize implementation from the model.
Maps
User
Credentials
MP3s
A node is an independent process containing
some structured data. The type of the node
determines the type of data it can contain.
Nodes can (logically) connect, making pointto-point information exchange possible. A
cloud is a collection of these nodes.
Operations modify data. Invariants check data for
consistency. Nodes can initiate operations; one or
more nodes may violate invariants.
Extending invariants and operations
Invariants and operations are understood over the maximal
cliques; i.e. the largest pair-wise connected subgraphs.
Union data on {2,6}
then check invariants
Union data on {0,1,2}
then check invariants
The system is stable is all maximal cliques satisfy invariants.
Architect understands
specs over highly
symmetric, logically local
regions of the cloud
The maximal cliques are regions of the network that can directly
work together to perform operations.
Parts of a BAM model
Data Specs
Operation Specs
Access Policies
Abstract database
schema
Set of operations that
can manipulate the
database
Types of agents in the
cloud
Declarative queries
that identify
inconsistent
databases
Data access rights of
each agent
Communication
capabilities of each
agent
BAM Technology-Independent
Abstractions
Analysis, Simulation, Code generation
Running example
Document Management System
1. Authorized users can view, create,
and modify their documents, from a local client.
(Data, Operations, Access Control)
2. Authorized users can manage their documents, even if not
connected to a server. (Asymmetry, Connectivity)
3. One or more servers synchronize with clients to record the
latest versions of document. (Consistency)
Abstract database
We do not specify foreign keys or specific implementation of
containment, etc…
Declarative queries
Consistency rules
Queries with actions
Operations also query the database, but then modify it for each
successful query.
Another example
Operations can be used to model synchronization actions.
Communication Policies
The legal
communication paths
between agent types
Data access
rights for
agent types.
Maximal cliques
Synchronize
Operation
Synchronize
Operation
Create New Document
Operations are extended over the cliques, but by applying data access rights first.
Data Specs
Operation
Specs
Access Policies
What you provide – A BAM Model
Abstract
Database
Consistency
Extension over
maximal
cliques
What it means – Powerful technology-independent abstraction
BAM Simulation and
Implementation
What you get – Simulation and synthesized solution
We solve the integration problem once, and reuse
through code generators and frameworks.
Implementation time was 3 months by a summer intern.
Connectivity state
PRNP allows one BAM node to
discover other nodes with which it
may interact.
Internet boundary
.NET Remoting serves as the primary
protocol layer by which nodes request
connections and exchange data.
Maximal cliques are calculated using a
distributed algorithm with heartbeat
messages to improve robustness of
the overall system.
Volta
Microsoft Volta uses IL-level rewriting to automatically split a system into
browser-side and server side tiers.
Local lightweight
web server
Volta
Browser with single origin restriction
Internet boundary





Talks to >14
backend services
(traffic, images,
search, directions,
ads, …)
~ 1 MB code
70k lines of
JavaScript code
downloaded to
the client.
2855 Functions
• Performance
 Performance profiling
 String optimization; cache placement; …
 Code splitting and joining
• Debugging
 Report function arguments, app state, errors
 Memory leak checking
Ajax View Power Tool
 Statistical debugging
• Test
coming soon
• ASP.Net plugin
• VS integration
• Operations
• Cross-browser
 Measure RPC network latencies
• Focus: Perf profiling in test
• User interaction feedback
 Code coverage
 A/B tests
 What features are being used / discovered?
Instrumented
Applications
Ajax View
Plugin/Proxy
Logs
Goal: Detailed visibility into app behavior on client
Approach: “On-the-fly” rewriting to add instrumentation
• No client-side changes. Work with existing web applications
Low Overhead: Adapt/distribute instr. across users
Ajax
View
My Service
3rd Party Service
(Mashup, Ads, Gadgets, etc)
Users

Simple but powerful monitoring




Easy deployability



Key Enabler: Instant re-deployability
of web applications


1. Adapt instrumentation over time



2. No single user runs all instrumentation code





<script>
LogTime();
FastFunc1();
FastFunc2();
SlowFunc();
LogTime();
</script>
If it’s
slow
<script>
LogTime();
FastFunc1();
LogTime();
FastFunc2();
LogTime(); Found
SlowFunc(); it!
LogTime();
</script>
<script>
FastFunc1();
FastFunc2();
SlowFunc();
</script>
…
function SlowFunc() {
// drill-down continues
}


Portals
Maps
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
Full Profiling
Drill-down Profiling
300%
10,000,000
250%
1,000,000
Logging BW Overhead
(bytes)
Perf Overhead
Full Profiling
Drill-down Profiling
100,000
200%
10,000
150%
100%
50%
0%
Web sites
Avg 30% reduction in
CPU Overhead
1,000
100
10
1
Web Sites
95% Avg Reduction in
Logging Bandwidth
Cnn.com Startup (ms)
2000
1500
1000
500
Baseline
0
0%
50%
100%
% of cycle checks distributed to single user
Fine-grained control of per-user overhead
2. Trades-off detection time
1.
End-to-end visibility into client-side web applications
 Requires no client-side/server-side changes
 Distribution and adaptation controls overhead
 While maintaining high coverage & detail
 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



Up to 90% of a
Web 2.0 app is
JavaScript code!








1.
[training]
2.
[rewriting]
3.
[prefetch]
1. [training] Runtime training to collect
access profile (AjaxView Fiddler plugin)
2. [rewriting] Function rewriting or
“stubbing” for on-demand code loading
3. [prefetch] Background prefetch of clusters
as the application is running
Automated Function Splitting
var g = 10;
function f1(){
var x=g+1;
…
…
…
…
…
return …;
}
var g = 10;
var real_f1;
function f1() {
if(!real_f1){
var code = load(“f1”);
real_f1 = eval(code);
f1 = real_f1;
}
return real_f1.apply(this,
arguments);
}
eval($exp(“f1”), “”);
// 21 chars
Size Savings With Doloto
Runtime Savings With Doloto
50kbs/300ms
300kbs/300ms
300kbs/50ms
60%
50%
40%
30%
20%
10%
0%
Chi game
Bunny Hunt
Live.com
Live Maps
Google Sp’sheet

Monitoring + control  cross-user, largescale feedback loop



2 simple examples of using this runtime
visibility to help optimize performance


[email protected]
[email protected]
For papers, presentations,
and downloads:
http://research.microsoft.com/~ejackson/bam.htm
http://research.microsoft.com/projects/ajaxview/
http://research.microsoft.com/projects/doloto/
www.microsoftpdc.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.