19
WCF Zen of Performance and Scale Nicholas Allen Sr Program Manager blogs.msdn.com/ drnick TL38

Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Embed Size (px)

Citation preview

Page 1: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

WCFZen of Performance and Scale

Nicholas AllenSr Program Managerblogs.msdn.com/drnick

TL38

Page 2: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

This talk is Zen for levels 300 and up Background needed to enjoy this session

WCF 3.x development experience Distributed systems design experience

Background not needed Workflow: Kenny Wolf “WF 4.0: A First Look” WCF 4.0: Ed Pinto “WCF 4.0: Building WCF

Services with WF in .NET 4.0” Dublin: Dan Eshner “Hosting and Managing

Workflows and Services” Oslo: Doug Purdy “A Lap Around Oslo”

Expectations

Page 3: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Inside WCF 3.x Performance The Formula 1 story Understanding performance 137 knobs, 1 concept

Future of WCF performance and scale The Starbucks story Understanding where we’re going in WCF 4.0

Agenda

Page 4: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

InsideWCF 3.x Performance

Page 5: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Everything is interconnected You go as fast as the slowest step Understand the impact of time averaging

There is no “go fast” button Design controls the performance baseline Knobs are powerful but unpredictable

Only measurements matter Assumptions are not tunable Reality makes a difference

Understanding System Performance

Page 6: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Types of Performance

Reference Set

Startup Time

Thread Count

Latency

Working Set

Net Utilization

Pool Size

Concurrency

CPU UtilizationCoordination

Capacity

Client Balance Server

Thro

ughp

ut

B

alan

ce

C

ost

Memory

Memory

Memory

Memory

Memory

CPU

CPU

CPU

IO

IO

IO

Page 7: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Parties exchange data by push and pull

The Push-Pull Principle

Push PullBuffer

PushPull Pump

Push Push

Pull Pull

A buffer or pump inverts the exchange These control mechanisms require knobs

Page 8: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Control

A Push-Pull Look at WCF

Network DispatchTransport Channels App

ConnectionPoolSettingsListenBacklogMaxPendingAcceptsMaxPendingConnections

MaxConcurrentCallsMaxConcurrentInstancesMaxConcurrentSessions

Network Transport Encoder Channels Serializer

Streamed Data

App

XMLDictionaryReaderQuotasMaxBufferSizeMaxBufferPoolSize

CreateBufferedCopy(maxBufferSize)MaxReceivedMessageSizeConnectionBufferSize

Network SerializerTransport Channels AppEncoder

Buffered Data

Page 9: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Some channels push

Common Exceptions to the Rules

Transmit Transmit AckTransmit

Reliable ChannelsChannels

OneWay ChannelsChannels

AcknowledgementIntervalInactivityTimeoutMaxPendingChannelsMaxRetryCountMaxTransferWindowSize

ChannelPoolSettingsMaxAcceptedChannels

Transmit

SendBufferSizeMaxOutputDelay

TcpWindowSize

Many networks both push and pull

Sliding Window

Page 10: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Accept Channel

Acquire Session Throttle

Run Message

PumpClose

Channel

Release Session Throttle

Channel Pump

A Closer Look at the Pump

DispatchChannels Pump

Receive Message

Acquire Throttles

Select Operatio

nDispatch Request

Release Throttles

Message Pump

Page 11: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Danger of Looking too Closely

DispatchChannels Pump

Authorize Caller

Create Instance Context

Run Message Inspectors

Lock Instance Context

Apply Transaction

Bind to Thread

Create Instance

Initialize Call Context

Authorize Caller

Create Instance Context

Run Message Inspectors

Lock Instance Context

Apply Transaction

Bind to Thread

Create Instance

Initialize Call Context

Page 12: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Performance is essential but not glamorous Understand the system

Understand what success means Design is a limiting factor

Understand the principles “What” is forms of the 3 classes of resources “Where” can be explored using push-pull “How” probably requires looking at the code

Know when you’re done Hypothesis and test is an iterative process Performance curves degrade on the high end

Key Performance Lessons

Page 13: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

FutureWCF Performance and Scale

Page 14: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Performance Tuning a Coffee Shop

Barista

Barista

$

Cashier

$

Cashier

$

Cashier

Customer CustomerCustomerCustomerCustomer

Customer Customer

CustomerCustomer

CustomerCustomer

Customer

Customer

Customer

Customer

Customer

Customer

Customer

Customer

Customer Customer

Mix Drink

Line Up

Place Order

Throw Cup

Pick Up Serve

Page 15: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Coffee Store Service Architecture

$

$

$

Customers Cashiers Baristas

Line Queue Cup Queue

LineUp

ThrowCup

MixDrink

PlaceOrder

Applies correlation address

PickUp Queue(correlates to original customer)

ServePickUp

Durable Duplex Correlation

Queue Channel Extensions

DublinHostingActivity

Compensation

Page 16: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Evals & Recordings

Please fill

out your

evaluation for

this session at:

This session will be available as a recording at:

www.microsoftpdc.com

Page 17: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

Please use the microphones provided

Q&A

Page 18: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38

© 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.

Page 19: Nicholas Allen Sr Program Manager blogs.msdn.com/drnick TL38