Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building High Performance, Robust Server Applications with Internet Information Server 5.0 Van Van IIS - Program Manager Microsoft Corporation.

Similar presentations


Presentation on theme: "Building High Performance, Robust Server Applications with Internet Information Server 5.0 Van Van IIS - Program Manager Microsoft Corporation."— Presentation transcript:

1

2 Building High Performance, Robust Server Applications with Internet Information Server 5.0 Van Van IIS - Program Manager Microsoft Corporation

3 Agenda  What is a Windows ® DNA Application?  Design for Success: Building Windows DNA Applications using Internet Information Server 5.0 Presentation Presentation Business Logic Business Logic Data Services Data Services  Testing for Success  Performance Tuning Applications

4 Windows DNA Applications What is it?  Extensible Modular Modular Integrates with existing back end Integrates with existing back end  Scalable High Performance High Performance High Availability High Availability  Reliable Handle failures gracefully Handle failures gracefully  “End-to-End” Application Solution

5 Windows DNA Applications 3-Tier Application  Divide your Windows DNA Application into three logical layers Presentation Presentation Business Logic Business Logic Data Services Data Services  Use Active Server Pages (ASP) as the “glue” to link presentation with business logic  Do NOT put business logic in ASP

6 3-Tier Web Architecture Internet Information Server and ASP DCOM Data services SQL Server Oracle Microsoft Exchange MSMQ Business logic MTS Components Presentation Internet Explorer OthersHTTPHTTP

7 Design For Success

8 Process Isolation Performance versus Robustness

9 Flow Control Design Applications NOT Pages 1 of 5  Normal Response Client ASP A ASP B IIS Request Response

10 Flow Control Design Applications NOT Pages 2 of 5  Normal Response  Response.End Response. IsClientConnected Response. IsClientConnected Client ASP A ASP B IIS Request Response

11 Flow Control Design Applications NOT Pages 3 of 5  Normal Response  Response.End  Response.Redirect Client ASP A ASP B IIS Request (1) Response.Redire ct Request (2) Response

12 Flow Control Design Applications NOT Pages 4 of 5  Normal Response  Response.End  Response.Redirect  Server.Transfer Client ASP A ASP B IIS Request Server.Transfer Response

13 Flow Control Design Applications NOT Pages 5 of 5  Normal Response  Response.End  Response.Redirect  Server.Transfer  Server.Execute Client ASP A ASP B IIS Request Server. Execute Response

14 3-Tier Validation “End-to-End” Solution  Validate in all 3-tiers Client side validation with “smart” clients Client side validation with “smart” clients Server side validation for legacy clients Server side validation for legacy clients Data validation when persisting Data validation when persisting  Scalable - distribute work as necessary  Reliable - fault tolerant architecture  Extensible - interchangeable pages

15 <html><body> What is your favorite sport? What is your favorite sport? <p> </form></body></html> <html><body> What is your favorite sport? What is your favorite sport? <p> </form></body></html> Caching Output <% function getSportsListBox() { SportsListBox = Application("SportsListBox") if (SportsListBox != null) return SportsListBox; crlf = String.fromCharCode(13, 10) SportsListBox = " " + crlf; SQL = "SELECT SportName FROM Sports ORDER BY SportName"; cnnSports = Server.CreateObject("ADODB.Connection"); cnnSports.Open("Sports", "WebUser", "WebPassword"); rstSports = cnnSports.Execute(SQL); fldSportName = rstSports("SportName"); while (!rstSports.EOF){ SportsListBox = SportsListBox + " " + fldSportName + " " + crlf; rstSports.MoveNext(); } SportsListBox = SportsListBox + " " Application("SportsListBox") = SportsListBox return SportsListBox; } %> <% function getSportsListBox() { SportsListBox = Application("SportsListBox") if (SportsListBox != null) return SportsListBox; crlf = String.fromCharCode(13, 10) SportsListBox = " " + crlf; SQL = "SELECT SportName FROM Sports ORDER BY SportName"; cnnSports = Server.CreateObject("ADODB.Connection"); cnnSports.Open("Sports", "WebUser", "WebPassword"); rstSports = cnnSports.Execute(SQL); fldSportName = rstSports("SportName"); while (!rstSports.EOF){ SportsListBox = SportsListBox + " " + fldSportName + " " + crlf; rstSports.MoveNext(); } SportsListBox = SportsListBox + " " Application("SportsListBox") = SportsListBox return SportsListBox; } %>

16 Presentation Layer

17 Let the client do the work Use double dynamic HTML  Use the browser capabilities component Test for script support Test for script support Test for D/HTML support Test for D/HTML support *Use application state for this component *Use application state for this component  Send HTML, DHTML, and client-side scripting based on capabilities Ubiquitous, easy, fast to download Ubiquitous, easy, fast to download DHTML dynamic page repainting DHTML dynamic page repainting Client-side scripts pushes work to client Client-side scripts pushes work to client

18 Business Logic Layer

19 Components  Implement the business logic layer using server-side COM components Visual Basic® Visual Basic® C++ C++ Java™ Java™  Server components provide Abstraction of complexity Abstraction of complexity Encapsulation of internal details Encapsulation of internal details Modularity for code reuse Modularity for code reuse

20 Components  Basic Principles Reuse existing components Reuse existing components Buy new components Buy new components Build your own components Build your own components  Provide a scriptable interface for your ASP use COM Interface COM Interface No need for graphical UI No need for graphical UI  Choose language accordingly

21 Components Threading Models  Every component has a “Threading Model” Single Single Apartment Apartment Free Free Both Both  Choice of Threading Model determines Thread that your component will be created on Thread that your component will be created on Whether calls are direct or through proxy Whether calls are direct or through proxy

22 Components Threading Model Impact  Performance Calls may be marshaled by proxy Calls may be marshaled by proxy  Access to context Context is an attribute of the thread Context is an attribute of the thread  Security May lose impersonated identity May lose impersonated identity

23 Threading Models Page Scoped Objects  Both and Apartment are equally good  Free is less good  Single is bad

24 Threading Models Session Scoped Objects  Mark Session objects as Both Apartment is OK Apartment is OK Locks down session Locks down session Free is mediocre Free is mediocre Single is bad Single is bad

25  Mark Application objects as Both  ASP never locks down Application Scoped Objects  For Apartment model objects, you can only use the tag in global.asa  Non-Both objects will lose security and context Threading Models Application Scoped Objects

26 Threading Models Recommendation Write components as Both

27 Writing Components Language Choices  Visual Basic ® Default Thread Model is Single, can produce Apartment Default Thread Model is Single, can produce Apartment  C++ Can create Both model components Can create Both model components  Java ™ Produces Both components by default Produces Both components by default

28 Data Services Layer

29 Active Data Objects (ADO)  Business components use ADO.asp files should not use ADO.asp files should not use ADO Better performance and reuse Better performance and reuse  Mark ADO as both model threaded MakeFre15.bat in the folder Program Files\Common Files\System\ADO MakeFre15.bat in the folder Program Files\Common Files\System\ADO  Learn about the six commonly used ADO objects

30 Using ADO  Using ADO from ActiveX Components ADO command object for ease of use ADO command object for ease of use No “Select * From table” No “Select * From table” .asp file using RecordSets ADO field object for performance ADO field object for performance Set rsCustomers = Customers.List Set fldCustomerID = rsCustomers(“CustomerID”) Set fldCustomerName = rsCustomers(“CustomerName”) Do Until rsCustomers.EOF Response.Write fldCustomerID & “ -- “ & _ Response.Write fldCustomerID & “ -- “ & _ fldCustomerName & “ ” fldCustomerName & “ ” rsCustomers.MoveNext rsCustomers.MoveNextLoop

31 SQL Server™  Configure SQL Server Memory size Memory size  Protocol selection Named pipes if on the Internet Information Server machine Named pipes if on the Internet Information Server machine TCP Sockets if on a different machine TCP Sockets if on a different machine  Let SQL do the work Joins/sorting/grouping Joins/sorting/grouping  Connection pooling HKLM\SOFTWARE\ODBC\ODBCINST.INI\ SQL Server\CPTimeout HKLM\SOFTWARE\ODBC\ODBCINST.INI\ SQL Server\CPTimeout

32 SQL Server™  Maintain SQL Server Monitor logs Monitor logs  Use stored procedures  Use show plan  Use indexes  Update statistics

33 ODBC  SQL Server ODBC connection pooling On by default for SQL Server because it is now set per driver On by default for SQL Server because it is now set per driver  ODBC performance monitor counters from ODBC SDK

34 Testing and Tuning

35 Testing for Success  Functional Level Rate component throughput Rate component throughput Know the cost of external dependencies Know the cost of external dependencies  Page Level Trace.asp execution for bottlenecks Trace.asp execution for bottlenecks Determine your 5 worst.asp files Determine your 5 worst.asp files  Application Level Simulate sessions Simulate sessions Determine the number of machines needed Determine the number of machines needed

36 Performance Tuning  Tools Profiling (Response.End) Profiling (Response.End) WebCat WebCat WebLoad WebLoad New ASP performance counters New ASP performance counters

37 Call to Action  Install the Windows NT 5.0 Start building simple components in the language of your choosing Start building simple components in the language of your choosing  Begin a pilot Windows DNA Application Project Expense Reporting Application Expense Reporting Application Internal Purchasing Application Internal Purchasing Application  Write killer Windows DNA applications

38 Other PDC Talks  Architecting Your Application For IIS 5.0  Debugging ASP Applications and Components  Using the Microsoft XML Parser in the Middle Tier

39


Download ppt "Building High Performance, Robust Server Applications with Internet Information Server 5.0 Van Van IIS - Program Manager Microsoft Corporation."

Similar presentations


Ads by Google