com+ 1.x overview frank e. redmond iii program manager com+ microsoft corporation 1-301

45
COM+ 1.x COM+ 1.x Overview Overview Frank E. Redmond III Frank E. Redmond III Program Manager Program Manager COM+ COM+ Microsoft Corporation Microsoft Corporation 1-301 1-301

Upload: francesca-dannels

Post on 31-Mar-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

COM+ 1.x Overview COM+ 1.x Overview

Frank E. Redmond IIIFrank E. Redmond IIIProgram ManagerProgram ManagerCOM+COM+Microsoft CorporationMicrosoft Corporation

1-3011-301

Page 2: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301
Page 3: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

COM+ 1.x GoalCOM+ 1.x Goal

Provide services that will increase the Provide services that will increase the overall scalability, availability, and overall scalability, availability, and

manageability of COM+ 1.0 manageability of COM+ 1.0 applicationsapplications

Page 4: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

AgendaAgenda

Scalability EnhancementsScalability Enhancements Availability EnhancementsAvailability Enhancements Manageability EnhancementsManageability Enhancements

Page 5: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Scalability EnhancementsScalability Enhancements

Process RecyclingProcess Recycling Configurable Isolation LevelConfigurable Isolation Level

Page 6: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Process RecyclingProcess Recycling

Problem:Problem: The performance of most The performance of most applications degrades over timeapplications degrades over time Reliance on third-party code of Reliance on third-party code of

uncertain qualityuncertain quality Memory leaksMemory leaks Non-scalable resource usageNon-scalable resource usage

Solution:Solution: Shut down and restart the Shut down and restart the application’s processapplication’s process

Developer Benefit:Developer Benefit: A quick fix for A quick fix for known problems and a guard known problems and a guard against unexpected onesagainst unexpected ones

Page 7: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Process RecyclingProcess Recycling

Configured using COM+ Admin SDKConfigured using COM+ Admin SDK Application.RecycleLifetimeLimitApplication.RecycleLifetimeLimit

Elapsed timeElapsed time Application.RecycleCallLimitApplication.RecycleCallLimit

# of calls# of calls Application.RecycleActivationLimitApplication.RecycleActivationLimit

# of activations# of activations Application.RecycleMemoryLimitApplication.RecycleMemoryLimit

Amount of memory usedAmount of memory used Application.RecycleExpirationTimeoutApplication.RecycleExpirationTimeout

Delay before recycled process is terminatedDelay before recycled process is terminated

Page 8: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Process RecyclingProcess Recycling

Retrieve the InstanceID for the applicationRetrieve the InstanceID for the application ICOMAdminCatalog2::GetInstanceIDFromAppIDICOMAdminCatalog2::GetInstanceIDFromAppID

Recycle the process!Recycle the process! ICOMAdminCatalog2::RecycleProcessICOMAdminCatalog2::RecycleProcess Specify reason for recyclingSpecify reason for recycling

CRR_LIFETIME_LIMITCRR_LIFETIME_LIMIT CRR_ACTIVATION_LIMITCRR_ACTIVATION_LIMIT CRR_CALL_LIMITCRR_CALL_LIMIT CRR_MEMORY_LIMITCRR_MEMORY_LIMIT CRR_RECYCLED_FROM_UICRR_RECYCLED_FROM_UI CRR_NO_REASON_SUPPLIEDCRR_NO_REASON_SUPPLIED

Page 9: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Process RecyclingProcess Recycling

Interested parties notified via COM+ Interested parties notified via COM+ EventsEvents ICOMProcessRecycle::ProcessRecycled(ICOMProcessRecycle::ProcessRecycled(

[in] BSTR bstrAppID,[in] BSTR bstrAppID,

[in] BSTR bstrInstanceID,[in] BSTR bstrInstanceID,

[in] DWORD dRecycleReason)[in] DWORD dRecycleReason)

Page 10: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

DllHost.exe

ICOMAdminCatalog2::RecycleProcess(…)

COM+ System App

If IsCallerInRole(“Administrator”){ CoRecycleThisDllHost(…) StartTimer(…)}

OLE32

CoRecycleThisDllHost(…){ … FireProcessRecycledEvent(…)}

Page 11: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Configurable Isolation LevelConfigurable Isolation Level

Isolation level = The extent to which Isolation level = The extent to which changes made outside a transaction changes made outside a transaction are ‘visible’ to that transactionare ‘visible’ to that transaction

‘‘Visibility’ of external changes Visibility’ of external changes (isolation level) controlled using (isolation level) controlled using lockslocks

Page 12: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Configurable Isolation LevelConfigurable Isolation Level

Locks used to control…Locks used to control… Whether current TX can ‘see’ Whether current TX can ‘see’

uncommitted data - Dirty Readsuncommitted data - Dirty Reads Whether other TX’s can modify Whether other TX’s can modify

existing data before the current TX existing data before the current TX ends - Unrepeatable Readsends - Unrepeatable Reads

Whether other TX’s can add new data Whether other TX’s can add new data before the current TX ends - Phantom before the current TX ends - Phantom ReadsReads

Page 13: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Configurable Isolation LevelConfigurable Isolation Level

Lower Isolation level = Less Lower Isolation level = Less locking, more concurrency, higher locking, more concurrency, higher potential for incorrect datapotential for incorrect data

Higher Isolation level = More Higher Isolation level = More locking, less concurrency, lower locking, less concurrency, lower potential for incorrect datapotential for incorrect data

Isolation Level Dirty Reads Unrepeatable Reads Phantom Reads

Read UncommittedRead CommittedRepeatable ReadSerializable

YesNoNoNo

YesYesNoNo

YesYesYesNo

Page 14: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Configurable Isolation LevelConfigurable Isolation Level

Problem:Problem: COM+ 1.0 uses highest COM+ 1.0 uses highest possible isolation level possible isolation level (SERIALIZABLE) to guarantee(SERIALIZABLE) to guarantee correct datacorrect data Overkill for some applicationsOverkill for some applications Better to be safe the sorry Better to be safe the sorry

Solution:Solution: Allow developers to Allow developers to choose the desired isolation levelchoose the desired isolation level

Developer Benefit:Developer Benefit: Potential for Potential for increased concurrency, increased concurrency, performance, and scalabilityperformance, and scalability

Page 15: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Configurable Isolation LevelConfigurable Isolation Level

Root component determines the Root component determines the isolation level for the entire TXisolation level for the entire TX CCI downstream component w/ CCI downstream component w/

isolation level higher than root = isolation level higher than root = E_ISOLEVELMISMATCHE_ISOLEVELMISMATCH

Component isolation level = ‘None’ Component isolation level = ‘None’ means any isolation level okmeans any isolation level ok Isolation Level = ‘None’ on root Isolation Level = ‘None’ on root

component defaults to SERIALIZABLEcomponent defaults to SERIALIZABLE Better to be safe than sorry Better to be safe than sorry

Page 16: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Configurable Isolation LevelConfigurable Isolation Level

Configured using the COM+ Admin Configured using the COM+ Admin SDKSDK Component.IsolationLevelComponent.IsolationLevel

Page 17: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

AgendaAgenda

Scalability EnhancementsScalability Enhancements Availability EnhancementsAvailability Enhancements Manageability EnhancementsManageability Enhancements

Page 18: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Availability EnhancementsAvailability Enhancements

Applications as NT ServicesApplications as NT Services Memory GatesMemory Gates

Page 19: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Applications as NT ServicesApplications as NT Services

Problem:Problem: COM+ 1.0 Applications COM+ 1.0 Applications cannot run as NT servicescannot run as NT services

Solution:Solution: Allow COM+ 1.x Allow COM+ 1.x applications to run as NT servicesapplications to run as NT services

Developer Benefit:Developer Benefit: COM+ applications can be started at COM+ applications can be started at

system boot or in ordersystem boot or in order COM+ applications can be run as COM+ applications can be run as

LocalSystemLocalSystem COM+ applications can be easily made COM+ applications can be easily made

Cluster-awareCluster-aware

Page 20: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Applications as NT ServicesApplications as NT Services

Configured using the COM+ Admin Configured using the COM+ Admin SDKSDK Application.RunAsServiceApplication.RunAsService

Page 21: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Memory GatesMemory Gates

Problem:Problem: Creating components in low- Creating components in low- memory situationsmemory situations Enough memory to create component but Enough memory to create component but

not enough to actually use itnot enough to actually use it Low-memory error-handling code typically Low-memory error-handling code typically

not well debuggednot well debugged Solution:Solution: Don’t allow servers to be Don’t allow servers to be

loaded or components to be created in loaded or components to be created in low-memory situationslow-memory situations

Developer Benefit:Developer Benefit: Increased reliability Increased reliability by avoiding not-so-well-debugged low- by avoiding not-so-well-debugged low- memory error-handling codememory error-handling code

Page 22: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Memory GatesMemory Gates

Process creation memory gateProcess creation memory gate E_OUTOFMEMORY if > 90% of virtual E_OUTOFMEMORY if > 90% of virtual

memory being usedmemory being used Object creation memory gateObject creation memory gate

E_OUTOFMEMORY if > 95% of virtual E_OUTOFMEMORY if > 95% of virtual memory being usedmemory being used

Both gates checked in Service Both gates checked in Service Control Manager (SCM)Control Manager (SCM)

Page 23: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

AgendaAgenda

Scalability EnhancementsScalability Enhancements Availability EnhancementsAvailability Enhancements Manageability EnhancementsManageability Enhancements

Page 24: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Manageability EnhancementsManageability Enhancements

Pause/Disable ApplicationsPause/Disable Applications Process DumpProcess Dump Alias ComponentsAlias Components Public/Private ComponentsPublic/Private Components Application PartitionsApplication Partitions

Page 25: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Pause/Disable ApplicationsPause/Disable Applications

Problem:Problem: No way to control No way to control component activationscomponent activations

Solution:Solution: Allow Allow administrative/programmatic administrative/programmatic control of component activationcontrol of component activation

Developer Benefit:Developer Benefit: COM+ COM+ applications more manageableapplications more manageable

Page 26: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Pause/Disable ApplicationsPause/Disable Applications

Pause – Prevents future activationsPause – Prevents future activations Existing component Existing component

instances/references unaffectedinstances/references unaffected CoCreateInstance & CoGetClassObject CoCreateInstance & CoGetClassObject

return E_APP_PAUSED for paused appsreturn E_APP_PAUSED for paused apps Only works for COM+ Server applicationsOnly works for COM+ Server applications

Does not work for COM+ library applicationsDoes not work for COM+ library applications Does not work for ‘classic’ COM componentsDoes not work for ‘classic’ COM components

ICOMAdminCatalog::PauseApplicationICOMAdminCatalog::PauseApplication Resume – Allows future activationsResume – Allows future activations

ICOMAdminCatalog::ResumeApplicationICOMAdminCatalog::ResumeApplication

Page 27: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Pause/Disable ApplicationsPause/Disable Applications

Disable – Prevents future activationsDisable – Prevents future activations Existing component instances/references Existing component instances/references

unaffectedunaffected CoCreateInstance & CoGetClassObject return CoCreateInstance & CoGetClassObject return

E_APP_DISABLED for disabled appsE_APP_DISABLED for disabled apps Works for COM+ applications (server and Works for COM+ applications (server and

library) and individual COM+ componentslibrary) and individual COM+ components Does not work for ‘classic’ COM componentsDoes not work for ‘classic’ COM components

Enable – Allows future activationsEnable – Allows future activations Application::Enabled/Component::Enabled Application::Enabled/Component::Enabled

attribute in COM+ Catalogattribute in COM+ Catalog Enabled status maintained between rebootsEnabled status maintained between reboots

Page 28: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Process DumpProcess Dump

Problem:Problem: Difficult to troubleshoot Difficult to troubleshoot COM+ applications in production COM+ applications in production environmentenvironment

Solution:Solution: Allow administrator to Allow administrator to dump the entire state of a process dump the entire state of a process without terminating itwithout terminating it

Developer Benefit:Developer Benefit: COM+ COM+ applications much easier to applications much easier to troubleshoottroubleshoot

Page 29: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Process DumpProcess Dump

Process dump generated using Process dump generated using userdump.exeuserdump.exe User-mode process dump tool takes User-mode process dump tool takes

snapshots of running processessnapshots of running processes Leaves target process virtually Leaves target process virtually

unscathedunscathed Does not “invade” target processDoes not “invade” target process Target process can continue to run Target process can continue to run

after snapshot is takenafter snapshot is taken COM+ gives userdump.exe full COM+ gives userdump.exe full

pathname of dump filepathname of dump file

Page 30: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Process DumpProcess Dump

Dump file configured per COM+ Dump file configured per COM+ application using the COM+ Admin application using the COM+ Admin SDKSDK Application.DumpFilePathApplication.DumpFilePath

Path only (no filename) COM+ generates Path only (no filename) COM+ generates filename based on application namefilename based on application name MyApp001, MyApp002, etc.MyApp001, MyApp002, etc.

Application.MaxDumpFilesApplication.MaxDumpFiles Avoids overwriting existing dump filesAvoids overwriting existing dump files

COM+ does NOT:COM+ does NOT: Install userdump.exeInstall userdump.exe Do dump file management (Deleting, Do dump file management (Deleting,

archiving, etc.)archiving, etc.)

Page 31: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Alias ComponentsAlias Components

CLSID = Implementation (code) + CLSID = Implementation (code) + Configuration RequirementsConfiguration Requirements

Problem: Problem: Implementation sharing Implementation sharing done at source code leveldone at source code level

Solution:Solution: Allow implementation Allow implementation sharing to be done at binary sharing to be done at binary COMponent levelCOMponent level

Developer Benefits:Developer Benefits: Less code to write, debug, maintain!Less code to write, debug, maintain! Lower development cost!Lower development cost! Faster time to market!Faster time to market!

Page 32: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Alias ComponentsAlias Components Many CLSIDs sharing a single Many CLSIDs sharing a single

binary (DLL) implementation binary (DLL) implementation Configurations may be different!Configurations may be different!

CLSID1 CLSID4CLSID3CLSID2

CLSID1

Page 33: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Public/Private ComponentsPublic/Private Components Problem: Problem: All COM+ components are All COM+ components are

public public Solution:Solution: Allow both public and private Allow both public and private

components components Similar concept as public/private methods of Similar concept as public/private methods of

VB or C++VB or C++ Public components can be activated from Public components can be activated from

other applicationsother applications Private components can only be seen and Private components can only be seen and

activated from other components within the activated from other components within the same applicationsame application

Developer Benefit:Developer Benefit: More control of More control of functionality exposure functionality exposure Component-based application development Component-based application development

is even easieris even easier

Page 34: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Application PartitionsApplication Partitions

Problem:Problem: Only a single Only a single application/component application/component configuration is allowed on a single configuration is allowed on a single machinemachine

Solution:Solution: Allow multiple Allow multiple configurations of a single configurations of a single application/component on a single application/component on a single machinemachine

Developer Benefit:Developer Benefit: Easier to Easier to manage a few large servers vs. manage a few large servers vs. many small serversmany small servers

Page 35: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Application PartitionsApplication Partitions

Partitions represent logical machine Partitions represent logical machine boundaries within a single physical boundaries within a single physical machinemachine E.g. Test Partition, Production E.g. Test Partition, Production

Partition, etc…Partition, etc… ‘‘Base Partition’ represents the actual Base Partition’ represents the actual

physical machinephysical machine COM+ applications are installed into COM+ applications are installed into

one or more partitionsone or more partitions Allows multiple COM+ application Allows multiple COM+ application

installations/configurations on a installations/configurations on a single machine!single machine!

Page 36: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Application PartitionsApplication Partitions

Partitions are grouped into partition Partitions are grouped into partition setssets Partition set represents a group of Partition set represents a group of

logical machineslogical machines One partition in the set is always One partition in the set is always

marked as the ‘Default’ partitionmarked as the ‘Default’ partition Users/OUs are assigned to a single Users/OUs are assigned to a single

partition setpartition set Users can only access components Users can only access components

from partitions in their partition setfrom partitions in their partition set Everyone can access the base Everyone can access the base

partitionpartition

Page 37: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Application PartitionsApplication Partitions Users/OUs bound to a partition setUsers/OUs bound to a partition set Partition set composed of partitionsPartition set composed of partitions

Active Directory

Machine

Org Unit

User Partition

Application

PartitionSet

Page 38: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Application PartitionsApplication Partitions

CCI behavior varies based on CCI behavior varies based on caller’s ‘partition context’caller’s ‘partition context’ If ‘partition context’ exists, CCI If ‘partition context’ exists, CCI

searches for:searches for: Private componentPrivate component Public component in ‘current’ partitionPublic component in ‘current’ partition Public component in base partitionPublic component in base partition

If ‘partition context’ does not exist…If ‘partition context’ does not exist… CCI establishes it based on caller identity, CCI establishes it based on caller identity,

then searches for:then searches for: Public component in ‘current’ partitionPublic component in ‘current’ partition Public component in base partitionPublic component in base partition

Page 39: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Application PartitionsApplication Partitions

COM+Partition 1

Base Partition

Partition 2

App 2

CLSID2

CLSID5

App 1

CLSID1

Lib 1

CLSID1

CLSID5

App 3

CLSID4

CLSID1

App 1

CLSID3

Page 40: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Demo Time!!!!!Demo Time!!!!!

Page 41: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

SummarySummary

Build component-based Build component-based applications using COM+ 1.0 today!applications using COM+ 1.0 today!

Microsoft will continue to provide Microsoft will continue to provide new and innovate component new and innovate component services tomorrow and into the services tomorrow and into the future!future!

Benefit:Benefit: Cheaper/Easier to build Cheaper/Easier to build scalable, reliable, manageable scalable, reliable, manageable component-based applications!component-based applications!

Page 42: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Additional COM+ SessionsAdditional COM+ Sessions

MondayMonday 1- 301COM+ 1.x Overview1- 301COM+ 1.x Overview 1- 404 Understanding COM+ Security 1- 404 Understanding COM+ Security

Pt.1Pt.1 1- 405 Understanding COM+ Security 1- 405 Understanding COM+ Security

Pt.2Pt.2 TuesdayTuesday

1- 306 Intro to COM+ Partitions1- 306 Intro to COM+ Partitions 1- 309 Using COM+ Queued 1- 309 Using COM+ Queued

ComponentsComponents 1- 308 Using COM+ Events1- 308 Using COM+ Events

Page 43: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Additional COM+ SessionsAdditional COM+ Sessions

WednesdayWednesday 1- 305 Increasing Your Windows DNA 1- 305 Increasing Your Windows DNA

Application Scalability w/ Load Application Scalability w/ Load BalancingBalancing

1- 402 COM+ Internals1- 402 COM+ Internals 1- 403 Maximizing COM+ Application 1- 403 Maximizing COM+ Application

ThroughputThroughput ThursdayThursday

1- 401 COM+ Base Services1- 401 COM+ Base Services 1- 307 Measuring Windows DNA 1- 307 Measuring Windows DNA

Application PerformanceApplication Performance 1- 201 Understanding SOAP1- 201 Understanding SOAP

Page 44: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301

Additional ResourcesAdditional Resources

Microsoft COM WebsiteMicrosoft COM Website http://www.microsoft.com/comhttp://www.microsoft.com/com

MSDN WebsiteMSDN Website http://msdn.microsoft.comhttp://msdn.microsoft.com

Microsoft Platform SDKMicrosoft Platform SDK http://msdn.microsoft.com/developer/sdk/platform.asphttp://msdn.microsoft.com/developer/sdk/platform.asp

Platt, Platt, Understanding COM+Understanding COM+. Microsoft . Microsoft Press, 1999. Press, 1999.

DCOM mailing listDCOM mailing list http://msdn.microsoft.com/workshop/essentials/mail.asphttp://msdn.microsoft.com/workshop/essentials/mail.asp

Page 45: COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301