slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Overview PowerPoint Presentation
Download Presentation
Overview

Loading in 2 Seconds...

play fullscreen
1 / 34

Overview - PowerPoint PPT Presentation


  • 176 Views
  • Uploaded on

Maximizing COM+ Application Throughput Steve Swartz Program Manager COM+ Team Microsoft Corporation 1-402. Overview. Throughput: What and How COM+ Threading COM+ Process Pooling COM+ Synchronization COM+ Activation. Demo. Throughput. Throughput defined Throughput and infrastructure

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Overview' - isabelle-oconnor


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

Maximizing COM+ Application Throughput Steve SwartzProgram ManagerCOM+ TeamMicrosoft Corporation

1-402

overview
Overview
  • Throughput: What and How
  • COM+ Threading
  • COM+ Process Pooling
  • COM+ Synchronization
  • COM+ Activation
throughput
Throughput
  • Throughput defined
  • Throughput and infrastructure
  • Throughput and scalability
  • Throughput and performance
  • Performance vs. scalability
throughput and resources
Throughput and Resources
  • Maximizing throughput means using resources efficiently
  • Minimize create/destroy costs
  • Acquire late/release early
  • Avoid creating too many resources
  • Avoid waiting for resource
  • Avoid requiring particular resources
  • Avoid holding unused resources
throughput and com
Throughput and COM+
  • COM+ services relevant to throughput:
  • Thread models & pools
  • Synchronization domains
  • Process pools
  • JIT and Object Pools
costs to keep in mind
Costs to keep in mind
  • XProcess vs. XThread calls
  • Regular vs. context marshalling
  • Activations and calls
  • Cross-machine hops vs. localization
overview1
Overview
  • Throughput: What and How
  • COM+ Threading
  • COM+ Process Pooling
  • COM+ Synchronization
  • COM+ Activation
com threading models
COM+ Threading Models
  • Apartments vs. threads
  • Single threaded apartments
    • Concurrency & reentrancy
    • Thread-local storage
    • STAs are a bottleneck
  • The multi-threaded apartment
  • The neutral apartment
com threads
COM Threads

Process

MTA Pool

RPC

Thread Pool

(MTA)

Main STA

com threads1
COM+ Threads

Process

MTA Pool

RPC

Thread Pool

(MTA)

STA Pool

Main STA

sta pool vs mta pool
STA Pool vs. MTA Pool
  • STA pooled objects
    • Contend for a specific thread
    • Cannot take advantage of new threads
  • MTA pooled objects
    • Contend for all threads
    • Can take advantage of new threads
example sta pool
Example: STA Pool
  • What you have to change to use the STA Thread Pool:
server app hints
Server App Hints
  • Server App==OutOfProc COM+ App
  • Stick to one thread model
  • Concentrate on parent objects
  • Avoid shared child objects
  • Neutral apartment for infrastructure objects
library app hints
Library App Hints
  • Library App==InProc COM+ App
  • Behavior of caller matters
    • Are your object references shared?
    • Are you called from different kinds of apartments?
  • Specify known caller’s threading model
  • “Both” for single user/unknown caller
  • “Neutral” for many user
overview2
Overview
  • Throughput: What and How
  • COM+ Threading
  • COM+ Process Pooling
  • COM+ Synchronization
  • COM+ Activation
process pooling
Process Pooling???
  • Process pools can help throughput when you’ve got:
    • Single-threaded applications
    • Applications that serialize the processing of requests
    • Apps prone to server sized slowdowns or bottlenecks
example process pooling
Example: Process Pooling
  • What you have to change to use Process Pools:
overview3
Overview
  • Throughput: What and How
  • COM+ Threading
  • COM+ Process Pooling
  • COM+ Synchronization
  • COM+ Activation
sta synchronization
STA Synchronization
  • Prevents concurrent access
  • Allows reentrancy (to avoid deadlocks)
  • Allows multiple copies (in different apartments)
  • A Throughput Bottleneck
com activities
COM+ Activities
  • Synchronization domains
  • Four levels of configuration
    • Requires New
    • Requires
    • Supports
    • Not supported
  • Cross-apartment, not out-of-proc
com synchronization
COM+ Synchronization
  • Prevents concurrent access
  • Allows reentrancy
  • Allows multiple copies
  • Can be used in MTA
  • Less of a throughput bottleneck
example synchronization
Example: Synchronization
  • What you have to change to use COM+ synchronization
overview4
Overview
  • Throughput: What and How
  • COM+ Threading
  • COM+ Process Pooling
  • COM+ Synchronization
  • COM+ Activation
programming models
Programming Models
  • COM+: Fewer longer-lived clients
  • IIS: Many transient clients
  • Focus on COM+ model, BUT…
  • … IIS is COM+’s longer-lived client
optimizing com activation
Optimizing COM+ Activation
  • JIT
  • Object Pooling
  • Recent TPC-C benchmarks
slide28
JIT
  • On Activation, Proxy/Stub created
  • Object created at first use
  • Object controls its own lifetime
  • JIT enables scalable programming model
  • JIT is not useful by itself
object pooling
Object Pooling
  • Pool of stateful instantiations
  • Request/wait architecture
  • When should I pool objects
    • When create costs are relatively high
    • When use costs are relatively low
    • When an object will be reused often
    • Experiment!
  • Don’t pool objects with client-specific state
object connection pools
Object & Connection Pools
  • Object Pools are 2x faster
  • Object Pools are asynchronous
  • Object Pools handle min/max well
  • Object Pools handle more resources
  • Object Pools handle more resource types
jit and object pooling
JIT and Object Pooling
  • JIT caches COM infrastructure
  • Object pool caches state, objects
  • Together, they
    • Minimize overhead of starting work
    • Minimize size of resource caches
    • Maximize throughput
example jit and object pooling
Example: JIT and Object Pooling
  • What you have to change to use JIT and Object Pooling:
    • Client does not call Release()
    • Server must call SetComplete()
    • Server must implement IObjectControl
    • Server must be thread-neutral
    • Server must enlist itself
example jit and object pooling1
Example: JIT and Object Pooling

QueuedPoolofMTA

Threads

JITtedObjectsinObjectPool

ISAPI

SQLServer