Tuning Applications

I’ve already discussed some Registry settings and metabase properties that can be modified to tune the performance of ASP, ASP.NET, and ISAPI applications on IIS 6. But there are also a couple of things you can do with IIS Manager to tune web applications performance on IIS.

ISAPI Caching

When an application processes a client request, ASP compiles the application script into a template that is then cached in memory in case a client requests the script again. ASP templates are stored as an intermediate byte code that can be executed faster than a script, an IIS 6 feature that significantly improves ASP performance over earlier versions.

You enable ASP caching for an application by first enabling caching of ISAPI extensions for that application, since ASP itself is implemented as an ISAPI extension (asp.dll) on IIS. To enable ISAPI caching do the following:

  1. Open the properties sheet for the website containing the application and select the Home Directory tab.

  2. If the application has no name, create it by clicking the Create button.

  3. Click the Configuration button to open the Application Configuration properties sheet for your application.

  4. On the Mappings tab, make sure Cache ISAPI Extensions is checked, which it is by default (Figure 12-11).

    click to expand
    Figure 12-11: Enabling caching of ISAPI applications

Recall that by default ASP caches 250 templates in memory, with additional templates being cached to disk. If the server is under heavy load, and you need more templates in memory, change the AspScriptFileCacheSize setting in the metabase, as discussed in the earlier section “Metabase Tuning Tips.”

ASP Buffering

ASP buffering causes output from ASP applications to be buffered (that is, collected or accumulated) in memory before sending it to the client. This can improve performance for certain types of ASP applications. Configure this setting with the Options tab of the Application Configurations properties sheet discussed in the preceding section (Figure 12-12). ASP buffering is enabled by default and can also be configured by editing the AspBufferingOn metabase property as discussed in the earlier section “Metabase Tuning Tips.”

click to expand
Figure 12-12: Enabling ASP buffering

Writing High-Performance Applications

To ensure that dynamic applications run with the highest possible performance on IIS, in addition to everything I’ve already talked about, you still need to code your applications efficiently. ISAPI applications run the fastest because they are coded using a high-level programming language such as C or C++, but that means they are also difficult to develop. ASP is the most common development platform for web applications running on IIS, but ASP.NET provides certain enhancements over ASP that make it preferable for developing scalable, high-performance web applications. Here is a brief potpourri of tips for tuning ASP.NET applications for maximum performance:

  • Disable Session State if you don’t plan to use it, and store your application session data out-of-process when deploying web gardens and web farms.

  • Perform all input validation on the client to reduce the number of round trips needed to the server.

  • Use stored procedures instead of ad hoc queries when accessing data on back-end SQL servers.

  • Trap exceptions instead of using them to direct program flow.

  • Use Option Strict in VBScript code to ensure type-safe coding.

  • Always leave caching turned on.

  • Be sparing in your use of server controls.

For more ASP.NET programming tips, see Microsoft’s website http://gotdotnet.com.

Additional Application Tuning Tips

Finally, here are a few more miscellaneous tips for tuning applications running on IIS 6:

  • Where possible within your applications, use static HTML files. They are faster than ASP or ISAPI and use less memory and processor resources.

  • Configure expire headers for static HTML files and image files so the client will cache these. (See Chapter 16 for how to enable and configure content expiration.)

  • Use SSL sparingly and only for pages that require it: the performance hit for implementing SSL encryption is heavy, and extensive CPU resources are required.

  • Recode ASP scripts longer than 100 lines as COM+ components for huge improvements in performance.




IIS 6 Administration
IIS 6 Administration
ISBN: 0072194855
EAN: 2147483647
Year: 2003
Pages: 131
Authors: Mitch Tulloch

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net