Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Mark Friedman Architect Developer Division Microsoft Corporation.

Similar presentations


Presentation on theme: " Mark Friedman Architect Developer Division Microsoft Corporation."— Presentation transcript:

1

2  Mark Friedman Architect Developer Division Microsoft Corporation

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 Network Latency Client-side script Server-side.aspx Network Latency Client-side script Server-side.aspx Network Latency Client-side script Server-side.aspx Unit TestLoad Test e.g., VS TeamTest Production 10

11 11

12 12

13 13

14

15 15

16 16

17 17

18 18

19 19

20 w3wp.exe Common Language Runtime (CLR) JIT compiler Garbage Collection threads mscoree.dll mscorsvr.dll MyApp.dll 20

21 Form: Code behind: Private Sub FileDropDownList_SelectedIndexChanged _ (ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles FileDropDownList.SelectedIndexChanged Session("FileSelected") = FileDropDownList.SelectedValue End Sub 21

22 22 IIS Architecture HTTP Request

23 23 See “IIS 7.0 Output Caching” at http://learn.iis.net/page.aspx/154/iis-7-output-caching/http://learn.iis.net/page.aspx/154/iis-7-output-caching/

24 24

25 25 From a command line: \windows\system32\inetsrv\appcmd list WP

26

27 27

28 28

29 Request Life-cycle Events Begin Request Authentication Authorization Resolve Cache Map Handler Acquire State Execute Handler Release State Update Cache Log Request Send Request 29

30 Event BeginRequest PreRequestHandlerExecute AuthenticateRequest PostRequestHandlerExecute PostAuthenticateRequest ReleaseRequestState AuthorizeRequest PostReleaseRequestState PostAuthorizeRequest PostMapRequestHandler ResolveRequestCache PostMapRequestHandler PostResolveRequestCache PostMapRequestHandler MapRequestHandlerUpdateRequestCache PostMapRequestHandlerPostUpdateRequestCache AcquireRequestState LogRequest PostAcquireRequestState EndRequest 30

31 31

32  Mark Friedman Architect Developer Division

33 33

34 34

35 35

36 36

37 37

38 38

39 39 See “How to Trace Requests for a Specific URL or Set of URLs” at http://www.microsoft.com/technet/pro dtechnol/WindowsServer2003/Library/II S/c56d19af-b3d1-4be9-8a6f- 4aa86bacac3f.mspx?mfr=true

40 40

41 41

42 EventUsage PreInit Create dynamic controls, set the Theme; master page, etc. Init Read or initialize control properties InitComplete Raised by the Page object. PreLoad Perform any processing on your page or control before the Load event. Load The Page calls the OnLoad event method on the Page, then recursively for each child control and its children Control events Button Clicks and other Control events are processed after Page_Load LoadComplete Fires after all controls on the page are loaded. PreRender Data binding for controls occurs now. SaveStateComplete Fires when the ViewState for all controls is complete and saved. Render Method that writes out the html markup associated with the control. Unload Do final cleanup, such as closing files or database connections 42

43 43

44 44

45 45

46 46

47 State Management ViewState Stored in _VIEWSTATE hidden field ControlState Override if ViewState is turned off on the Page HiddenField control Cookies Add cookie data to the Cookies collection in the HttpResponse object Query strings Application State HttpApplicationState Session State Profiles SqlProfileProvider 47

48 48

49

50 50

51 51

52 52

53 53 ASP.NET Session state HttpContext.Session Data associated with a logical sequence of Requests that need to be persisted across interactions Unique session IDs are passed along automatically with each Request as either cookies or embedded in the URL Session data is stored in a Dictionary collection, allowing individual session state variables to be accessed directly by Key name Three external storage options InProc StateServer SQL Server Timeout management

54 54 HttpContext.Session InProc option provides fastest service, but does not permit access to Session data from a different process in a Web garden application or a different Web server in a cluster Using alternatives to InProc session storage has significant performance implications StateServer SQL Server Custom provider Measure impact using the IIS RequestNotification events e.g., AcquireRequestState, PostAcquireRequestState

55 55 Session State options

56 56

57 57 Session State options

58 58

59 59

60 60

61 61

62 62

63 63

64 64

65 65

66 66

67 67

68 68

69 69

70 70

71 71

72 72

73 73

74 74

75 75

76 76

77 77

78 78

79 79

80 80

81 81

82 82

83 83

84 84

85 85

86 86 BindingResponse Time (msecs)Throughput wsHttpBinding13001200 basicHttpBinding11501800 netTcpBinding4005100 netNamedPipeBinding2807000 Source: Resnik, Crane, & Bowen, Essential Windows Communication Foundation, Addison Wesley, 2008. Chapter 4. See also, “A Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies”A Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies Caution: your mileage will vary. Caution: your mileage will vary.

87

88

89

90

91  Mark Friedman Architect Developer Division

92 92

93 93

94 94

95 95

96 96

97 97

98 98

99 99

100 100

101 Best Practices for Improving Page Load Time

102 102

103 103

104 104

105 105

106 106

107 107

108 108

109 109

110 110


Download ppt " Mark Friedman Architect Developer Division Microsoft Corporation."

Similar presentations


Ads by Google