Which iis7 component is wpas responsible for managing




















And since not all pages are the same you end up with providing more Web Parts than you would want. Another approach that you might have heard about is to user item level permissions on specific Web Parts making them available to specific users only. Just like the previous solution, this approach trims the list of available Web Parts. The downside is that it makes it really challenging to manage the environment: have you ever tried to get an overview of item level permissions without third party functionality?

On top of that, just like the previous solution, this approach applies globally to all pages in the whole Site Collection. In SharePoint we had some options to control which Web Parts should be available where. The problem with it was that it was fragmented and had to be configured separately for every Web Part Zone.

The great news is that this situation has changed in SharePoint with the introduction of the Web Part Adder control. Web Part Adder Microsoft. Web Part Adder is visible every time you choose to add a Web Part to a page. The important thing is that you can have only one instance of Web Part Adder on a page. Web Part Adder gives us a number of configuration capabilities to control which Web Parts should be available for the users to add.

One of the interesting properties of the Web Part Adder control is the AllowWebPartImport property, which, as its name says, defines whether users are allowed to import Web Parts or not. After setting this property to false users will not be able to insert List View Web Parts:. After setting its value to false the Closed Web Parts category will not appear in the list of available categories in the Web Part Adder even though there are closed Web Parts associated with the page.

A great way of optimizing the list of available Web Parts for users is by using the RecommendSiteTemplate property. If your solution consists of multiple Site Definitions this approach can help you help your users to find the right Web Parts. As you have just seen it offers you a number of ways to control which Web Parts are available to users.

Next to the capabilities that I have just showed you there are two more properties that the Web Part Adder offers you to control the list of available Web Parts. Important Microsoft recommends that you apply all patches to the server. If the components are eventually installed, the latest versions of their binaries will be used automatically, and there is no need to reapply any patches.

Having both IIS 7. NET managed modules running in the same request pipeline yields many benefits including unifying the configuration system and security models for both IIS and ASP. From the security perspective, ASP. NET advanced security services can be plugged in directly to the IIS main request processing pipeline and used together with the security features that IIS offers. In short, with IIS 7. NET resources. My first demo showcased the componentization capabilities of IIS 7.

As part of the demo, I walked through how to edit the configuration in the Application- Host. After saving the file, IIS automatically picked up the changes and restarted, loading absolutely no modules.

After making a request to the default Web site, I would swiftly get back an empty response this configuration currently returns a Unauthorized error because no authentication modules are present. After a pause, I commented that, though secure, this server was also fairly useless, and then I segued into adding back the functionality that I needed for my application.

I had done this demo earlier for internal audiences to much acclaim, but I will always remember the audience reaction during that TechEd session. The people in the audience went wild, some even breaking into a standing ovation. This was a resounding confirma- tion of our efforts to give administrators the ability to start from nothing, building up the server with an absolutely minimal set of features to produce a simple-to-manage Web server with the least possible surface area.

Performance With its componentized architecture, IIS 7. Modules are loaded into memory only if they are installed and enabled. By removing unnecessary IIS 7. At the same time, by reducing memory usage for the IIS 7. For example, in IIS 6. For more details on removing modules you do not require, see Chapter With the new modular-based engine and the tight integra- tion between ASP.

NET interfaces and the functionality of the. Not only are you able to decide which features to include in the Web server, but you can also extend your Web server by adding your own custom components to provide specific functionality. For example, you can develop an ASP. In short, you can build your own custom server to deliver the feature sets your applications require.

You might, for example, deploy a set of IIS 7. For more information on customizing modules in IIS 7. Table highlights the different service categories and lists sample built-in modules within those categories. NET run time. For more information regarding the module configuration store, module dependencies, and potential issues when a module is removed, see Appendix C. Summary The key features delivered by IIS 7. This is the first time Web administrators have full control over the IIS server.

It is also the first version of IIS that is fully extensible. It provides a unified request processing model that integrates ASP. Modules are fundamental building blocks in IIS 7. By choosing the right set of modules, you can enable a rich set of functionality on your server, or you can remove features you do not need so as to reduce the security surface area and improve performance.

In Chapter 12, you can learn more about the different types of modules IIS 7. The metabase of old has been transformed into a. NET configuration—inspired system that is much easier on many levels to support. The new design provides the basis for delegated configuration, centralized configuration, ASP. NET integration, xcopy deployment of configuration, and many other benefits. In many cases, the IIS 7. However, when you add flexibility to a system, you often introduce complexity, which is the case with the IIS 7.

As shown in Figure , the configuration of IIS 7. For administrators with an understanding of the. Site Web. The new architecture reflects require- ments that the IIS 7. This hierarchy includes the. NET configuration informa- tion. The configuration files in the hierarchy contain configuration sections, which are structured XML elements that describe configuration settings for specific IIS features.

This makes configu- ration self-explanatory, and you can easily edit it by hand. For example, the application devel- oper can place the following configuration in a web.

Because the IIS 7. Because this file travels with your application content, it enables the application to be deployed to an IIS server simply by copying its contents, without having to modify any central configuration. At the same time, the server administrator can place server-level IIS configuration, such as the Web site and Application pool definitions, in the server-level applicationHost.

This file can also contain the default configuration for other IIS sections, which are by default inherited by all Web sites on the server. Using the configuration-locking mechanisms that the config- uration system provides, the administrator can specify which configuration can be modified by applications through the use of distributed web.

All in all, the new configuration file hierarchy offers a lot more flexibility than the IIS 6. Next, we will look at how the configuration file hierarchy works and the syntax of configuration sections. Nodes of that tree corresponded to URLs on the server, and each node contained a set of properties that specified the configuration for that URL along with properties inherited from parent nodes. If you are familiar with the IIS 6. Instead of encod- ing the entire URL hierarchy in a single file, the configuration file hierarchy maps to the URL hierarchy.

Each file defines configuration that is implicitly associated with a specific URL level based on the position of this file in the configuration hierarchy. For example, application- Host. Note that the use of web. There are other configuration files involved with IIS 7. Table IIS 7. Just like the metabase, the IIS 7. This level corresponds both to the URL namespace at which the configuration is effective and a configuration path used in commands such as when using Appcmd to reference the correct configuration store.

In this way, the IIS 7. When the configuration system retrieves configuration for a specific configuration path, it merges the contents of each configuration file corresponding to each segment of the path, building an effective configuration set for that path.

This works well with the ability to specify distributed web. When reading configuration for this path, the server will merge the configuration in machine. Important The root web. This is not the same as a web. In the first case, we are talking about web. NET that is the parent, or root of all Web site web. The web. NET root web. Server-level configuration for IIS features is stored in the applicationHost. For example, if you wanted to configure the server to disable directory browsing by default, you would put that configuration in the applicationHost.

This allows IIS 7. NET in site and application web. NET modules in the managed pipeline, and integrate. As previously mentioned, machine. NET Framework configura- tion settings loaded by all.

NET applications on the machine, and root web. These files are modifiable only by machine administrators. This way, IIS application pools that are set to use different versions of the. NET Framework automatically include the configuration files for the right. NET Framework version. Note that as in IIS 6. It is modifiable only by machine administrators. In fact, if you examine the contents of applicationHost.

The allowDefinition settings assign a scope to the sec- tion that limits where the section can be used. In this case, the Sites section can only be used in applicationHost. It is strongly recommended that you do not edit the allowDefinition settings from the defaults. Finally, this file also contains information about which configuration sections are allowed to be overridden by lower configuration levels, and which are not.

Child override is controlled by the overrideModeDefault attribute in the example just provided of the configuration sections declarations.

The server administrator can use this attribute to control the delegation of IIS features to the site administrators. We will review controlling section delegation in the Delegating Configuration section of this chapter.

Distributed web. These files can specify new configuration settings or override configura- tion settings set at the server level for the URL namespace corresponding to the directory where they are located assuming the configuration sections used are unlocked by the administrator. Chapter 4: Understanding the Configuration System This is the foundation for the delegated configuration scenario, which enables applications to specify required IIS settings together with their content, and which makes simple xcopy deployment possible.

Finally, because the ASP. NET configuration settings. It is not part of the IIS 7. When in use, it specifies the location and access details required for IIS 7. This enables multiple IIS 7. Among other things, administration. These extensions provide the features you see in the IIS Manager. Temporary Application Pool. At run time, IIS 7. The filtered configuration files contain only the application pool definitions for the current application pool other application pool definitions that may contain custom application pool identities are filtered out.

Also removed are all site definitions and site-specific configuration specified in location tags for sites that do not have applications in the current application pool. The temporary configuration file created for each application pool is protected in such a way that only the application pool for which it is created can read the file.

This ensures that no worker process application pool can read the configuration settings for any other worker process. The application pool configuration files are not intended to be used for updates, and neither administrators nor developers should edit them directly or indirectly.

Their use is completely transparent, but it is part of the configuration system, so we thought it should be called out here. Configuration File Syntax Each configuration file uses special XML elements called configuration sections to specify configuration information. A configuration section is the basic unit of configuration, typically defining the behavior of a specific part or feature in the Web server. Here is an example of a configuration file that specifies multiple configuration sections:.

Section groups do not define any settings, they simply group related section elements together. Sections are the elements, shown in bold, that contain specific configuration settings. The configuration section elements each follow a specific structure defined by their schema, which controls what attributes and child elements are allowed inside the section, the type of data they can contain, and various other configuration syntax restrictions.

Unlike the ASP. We will examine this schema mechanism a little later in the chapter. In addition to section groups and configuration sections themselves, configuration files can also contain section declarations and location tags. Section declarations are necessary to declare a particular section before it can be used, and they also indicate what section group the sec- tion belongs to.

Location tags enable configuration to be scoped to a specific configuration path, rather than to the entire namespace to which the current configuration file corresponds. Direct from the Source: Working Around Limits on web. This is for security purposes, to avoid possible denial-of-service attacks on the server by providing very large configuration files. In most cases, this size should be sufficient for most situations, but what if your config- uration file is bigger than KB?

This can happen for applications that use web. To allow these larger files, you can override the maximum limit by adding a registry key.

Create the following key. Set this value to the file size in kilobytes make sure you select Decimal when entering the value to set this as a new machine-wide limit on web. Section Declarations Each section that is used in a configuration file contains a section declaration in application- Host. Section declarations are generally created during the installation of the feature and do not typically need to be added manually.

For example, following is an excerpt from the applicationHost. Section declarations can specify a number of properties that control where the section is available, including allowDefinition, which determines at which level in the configuration hierarchy the section can be used, and overrideModeDefault, which determines if lower configuration levels can use the section by default.

After the section is declared, it can be used in the current configuration file or anywhere lower in the configuration file hierarchy, meaning it does not need to be re-declared in configuration files below re-declaring this section will actually result in a configuration error. In fact, all IIS configuration sections are declared in applicationHost.

The allowDefinition and overrideModeDefault attributes control the actual ability to use this configuration section in the lower levels. Section Groups You use section group elements to group related configuration sections together. This implicitly declares the section group itself. Section groups cannot define any attributes and therefore do not carry any configuration information of their own.

Section groups can be nested within one another, but sections cannot. Think of section groups as a namespace qualification for sections. When specifying the configuration section, you must place it inside the section group element according to the declaration. Table lists most of the section groups you will find in the IIS 7. NET configuration Framework machine. Not listed in Table , for the sake of brevity, are section groups declared in. These sections control various aspects of the.

NET Framework behavior, including system. Sections The configuration section is the focus of the IIS 7. Each configuration section has a specific structure defined by its schema, containing specific attributes, elements, and collections of elements necessary to express the required configuration for the corresponding IIS feature. A configuration section may contain 0 or more of the elements depending on the schema shown in Table Supported types include int, string, timespan, enumerations, and others.

Attributes may have associated validation rules, which restrict the allowed values. They may also have additional metadata such as default values, or they may specify whether or not the attribute must be specified when the section is used.

Child elements Child XML elements, which in turn can contain attributes and other child elements. Collection elements have metadata associated with them that define their behavior, including what attributes serve as collection item keys, the order in which collection items are added when collections are merged between configuration files, and more. Most configuration sections specify default values for all of the attributes in their schema. Each configuration file can specify the section element to explicitly set the value of one or more attributes, or modify the collections in the section.

The section can be specified at multiple configuration files, in which case when the configuration system retrieves the contents of this section for a particular configuration path, it merges the contents of all instances of this section.

For example, here are the contents of a web. This configuration overrides the global enabled attribute set in applicationHost. To learn more about the syntax of each configuration section, you can review its schema. As you can see, the schema contains more information than just the structure of the configuration section—it also contains various metadata about the format and behavior of attributes and collections, including the types for attributes and which attributes serve as unique keys for collections.

Note When working with IIS configuration, you will likely never have to work with section schema. However, it is useful to know where the schema information is located if you need a reference for the structure and semantics of IIS configuration sections.

You should never attempt to modify the IIS schema files. NET configuration sections respectively. Custom configuration sections registered with the IIS 7. Location Tags By default, configuration specified in a particular configuration file applies to the entire URL namespace corresponding to that file. For example, configuration set in applicationHost.

This works most of the time. However, in some cases it is necessary to apply configuration to a specific subset of the URL namespace, or to a specific URL. Location tags are the mechanism that enables this by specifying a configuration path for which all configuration specified within a location tag applies. This location tag, when specified in applicationHost. Defining site-specific directory or file configuration in applicationHost.

For example, this is the technique commonly used by shared hosting servers to set site-specific configuration without giving the site administrators control over that configuration.

When making changes to configuration in the IIS Manager or one of the programmatic interfaces, if a setting is not delegated, it is written to applicationHost. Locking or unlocking a specific configuration section for a particular configuration path.

By placing a configuration section inside the location tag for a particular path, you can use the overrideMode attribute on the location tag to lock or unlock this config- uration section for that path.

Specifying configuration for a specific nonphysical URL. You can use a location tag to keep all of the configuration for a site or application in a single web. We will discuss using location tags in more detail later in this chapter.

Differences Between the IIS 7. For IIS 7. Why did the IIS team invest such time and effort in a wholesale change to the structure and mechanics of the configuration system?

Primarily to make a quantum leap in performance, scale, and manageability. It was time to rebuild with a new set of design criteria. The resulting system is quite a bit more complex because it is very ambitious. Yet at the same time, it is more manageable, scalable, and flexible. Table compares some of the key differences between the IIS 6. Table Metabase. Metabase is a Configuration is IIS configuration is file-based memory construct file-based; configuration always fully represented configuration that is written to writes are persisted in.

The metabase emulation layer, called the ABO Mapper, provides immediate translation of the metabase configuration structure and actions triggered by callers to the new configuration system. This maps all writes and reads to the metabase to the corresponding IIS 7.

This service performance is transparent to the caller so that the existing installers, configura- tion scripts, and tools continue to work as if they were working on IIS 6. In the end, virtually all metabase properties can be successfully mapped to the IIS 7. Note You can find documentation that describes how IIS 6.

If you are, though, you will need to install the IIS 6. You can also chose to install the legacy IIS 6. However, we recommend that for your configuration scripts and programs, you start to use the new configuration tools and APIs that the IIS 7. In fact, the. However, IIS 7. NET configuration files, machine. One of the primary benefits of this design is that IIS 7. This enables applications to contain all of the configuration they need to run on the IIS platform in the web.

From a developer perspective, it also enables managed modules developed for IIS 7. Administration and other. Likewise, the IIS 7. NET configuration sections in automated deployment and management scenarios. NET configuration features. For example, you can configure database connection strings in the IIS Manager instead of having to open up the. IIS Manager also enables you to manage users and roles by using the. NET role and membership providers.

This is very useful for managing user information for features such as forms authentication and storing IIS Manager users. The unification of the. The fact that the ASP. However, some problems do still exist. One of the key limitations stems from the difference in encryption support between the two configuration systems. NET configuration files may contain user names and passwords that the developer can encrypt.

This way, when you view the. The problem arises because IIS 7. NET configuration system use different methods for encrypting secrets. NET configuration system supports section-level encryption, which encrypts the entire contents of the configuration section. Because of this, if you attempt to read an encrypted ASP. NET functionality. Likewise, you cannot encrypt ASP. NET will fail to read their contents.

For more details on this issue and how to solve it, see Chapter Another limitation stems from the lack of a versioning mechanism for the. As of this writing, the IIS 7. NET Framework 2. NET Framework 1.

Moreover, some of the tools in the IIS 7. NET Framework configura- tion files for versions other then 2. Future versions of IIS may address this problem. The use of IIS 7. NET web. NET applications that are using. This is because the ASP. IgnoreSection, System. However, ASP. Because the configuration is stored in plain-text XML files and uses a well-structured, human- readable syntax, you can edit it manually using Notepad or your favorite text editor.

In fact, many people prefer this approach when editing configuration for distributed web. In addition to enabling configuration to be edited by hand, IIS 7.

It also includes the Appcmd command line tool, which you can use to edit configuration quickly from the command line.

Finally, it includes several administrative scripts and APIs for editing configuration programmatically, including the IIS 7. Administration APIs for managing configuration from. Note Where possible, use tools to manipulate IIS 7. This is much easier and provides protection against generating incorrect configuration. In fact, you should choose to use tools to edit the configuration on the server, because doing so ensures that you are interacting correctly with the underlying complexity of the configuration system and guarantees that the configuration is written using the correct syntax.

You can read about managing IIS 7. However, there are times when you need to specify configuration by hand or use one of the lower-level tools like Appcmd or programmatic interfaces like the Microsoft.

Administra- tion namespace provided in. In this case, you do need to understand the structure of configuration sections and inheritance behavior of the configuration hierarchy in order to do this correctly. In the remainder of this section, we will discuss the basics of editing IIS 7. Note Use Appcmd to edit configuration in situations in which IIS Manager does not expose the desired configuration functionality.

Appcmd can perform most configuration tasks you can do by hand, and it offers the benefit of additional validation. It also allows you to perform configuration tasks in an automated fashion on other machines if needed.

Caution Before modifying configuration, always make sure you have a backup of the current state so you can come back to it if necessary. This hierarchy contains multiple configuration files, comprising the. NET configuration files, applicationHost.

This hierarchy allows you to map configuration to a URL namespace on your server by placing it in the right configuration file. When the server reads configuration for a particular Web site or URL, it merges all config- uration files along the configuration path, merging the configuration specified in them to achieve the effective set of configuration for a given path.

Because of the configuration merging, configuration specified at a higher configuration path always inherits to all child paths, unless it is overridden lower down. For example, configuration specified in applicationHost. Table indicates where you may chose to place configuration in order to apply it to the desired scope. When specifying configuration at a specific site or URL, you always have a choice of specifying configuration in a distributed web.

Both have advantages and disadvantages you need to consider. Using location tags can allow you to place all configuration in a single location, instead of multiple web. Also, if configuration is locked at a particular configuration path for example, configuration that should only be set by server administrators is typically locked in applicationHost. However, placing configuration in distributed web. This is a very powerful ability.

Finally, a note about configuration delegation—not all configuration sections are allowed to be specified in distributed web. It is up to the server administrator to decide which configuration sections are delegated and to unlock them in application- Host.

This may impact your ability to run applications that specify configuration in distributed web. Setting Configuration To set configuration, you need to know three things: the name of the section that contains the desired configuration settings, the desired property of that section, and the configuration path at which you want to set this setting to apply as we discussed in the previous section.

You will typically know the first two from the documentation of the feature you are attempting to configure. When you know this information, you can specify the corresponding section element in the configuration file.

Configuration sections contain the properties that you intend to configure, such as default- Document, but you need to do more than just provide a name. You turn the default document feature on and off and provide the list of default documents using attributes or collection elements contained inside the section. Setting Section Attributes The majority of configuration settings are expressed via attributes, which may either be exposed on the collection element itself or in one of the child elements of the collection.

To specify a value for the attribute, you simply need to set the value of that attribute. This effectively overrides any default value or value previously set to this attribute in earlier configuration paths.

Each attribute has a specific type and may have additional validation rules associated with it in the schema definition of the section. Likewise, attributes may be given default values that are taken on by them if they are not explicitly set in configuration. This will be documented for each section to assist you in setting their values.

Manipulating Configuration Collections In addition to attributes, configuration sections can also contain collections.

Collections allow lists of items to be represented in configuration, and they support additional behaviors such as adding or removing elements in multiple configuration levels and preventing duplicate items from being added. Collections are typically configured through three different operations: adding collection elements, removing collection elements, and clearing the collection. In fact, each collection element has the same schema flexibility as any other configuration element or the section itself.

Most collections enforce item uniqueness to prevent duplicate items from being added. If an item with a duplicate key is specified, the collection will trigger a configuration error when accessed. When you add collection elements at a particular configuration level, they add to the existing elements that were inherited from a parent level.

The ordering of collection items inside a collection is determined by the order in which they are added. When collection items are inherited from the parent configuration levels, they are placed before the collection items specified at the current level.

This is true for most collections, except for collections that elect to have a prepend order—these collections place the elements declared at the current level before elements inherited from parent levels. For more about managing modules, see Chapter Each remove element specifies the attributes that together comprise the collection key to uniquely identify the element that is to be removed. This is often done whenever the current configuration level has to have complete control over the contents of the collection and cannot inherit parent items.

The following example clears the default document collection and adds back a single element to make sure that only Default.

This means that if the administrator adds new collection items at the server level, they will not be propagated to the current level. Administration, the underlying configuration system APIs will make sure that the resulting configuration is correct. It will even prevent you from adding a duplicate collection element or attempting to write configuration that has been locked at a parent configuration level.

This is the reason why you should always prefer to use tools to write configuration, rather than doing it manually. Note Use tools to set configuration—this will catch most mistakes and prevent you from generating incorrect configuration. However, there are times when you may still run into a situation in which configuration is incorrect.

This is most likely if you edit configuration by hand and make a mistake in the section syntax or set attributes to unsupported values. However, it may also happen in other cases—for example, if an application that defines configuration is deployed to a server where some of the sections are locked at the server level, resulting in a lock violation.

Because of this, it is important to be able to understand various configuration error condi- tions, and be able to use the resulting configuration error information to resolve them. Caution Always back up configuration before making changes to it. There are several types of configuration errors that are handled differently by the configura- tion system and have varying degrees of impact on IIS. Table summarizes some of the common error conditions and the impact they have on the server.

Attribute validation error: There is an invalid Same as above. Collection validation error: There are duplicate Same as above. Lock violation: Specifying configuration for Same as above. The key to understanding these error conditions is to understand how the configuration system handles errors.

Errors that cause the entire configuration file to become unavailable, because it cannot be read or because it contains invalid XML as shown in Figure , cause all attempts to read configuration from that file to fail. Because of this, all operations that require reading this file will fail—if this file is applicationHost.

In this case, you will not be able to get a detailed request error describing the error condition, because the server will not be able to start any IIS worker processes to serve the request. If the file is a distributed web. However, IIS worker processes will still be able to start and generate a detailed configuration request error that will describe the reason, and sometimes even the position in the file, where the error has occurred.

Finally, for all other errors in configuration sections that are not invalid XML, only accesses to the affected section will fail. If the error is in one of the system. Empty caches can cause your application to experience slower performance until the caches build up again. This is what happens with most applications that have a startup delay … they are preloading the caches! If you want to have the best of both worlds: warm caches on startup, and low startup delays, consider two strategies:.

Thankfully, this problem too is solvable. You can configure application initialization to warm up your app with zero startup delay. IIS 7. This happens whenever you deploy a new website, change website bindings, or modify any other server-level configuration. IIS automatically applies your changes to:. Changes to compiled content files, e. NET pages, are detected automatically and trigger dynamic recompilation. This can also cause application restart after so many recompiles to reduce assemblies loaded in the app.

CLR configuration for application pool E. This triggers additional, unnecessary initialization overhead. Worse, you may end up recycling more than necessary, e. If you are making many content and config changes, you run the risk of causing multiple application or application pool restarts. You can also set the WaitChangeNotification and MaxWaitChangeNotification properties to delay application restarts this does not work for web.

In the worst case, you can always stop the application pool and restart it after deployment is made. In fact, deploying thousands of websites may be the only legitimate use case I can find for stopping WAS during the deployment. When the website hangs, most people panic, because they usually lack any information about what is causing the problem. This does sometimes help, although temporarily, and the problems usually return.

Sometimes right away! Most importantly, restarting your website makes sure that you will continue to have performance problems! Simply because restarting prevents you from being able to determine WHY the site is hanging or slow and eliminating that root cause.

Recycling can temporarily relieve thread blockage, but it does not address the underlying problem. So, there is a high risk that the hang will quickly return. If you are having a hang during peak traffic, due to threads being blocked e.

The new worker process will often rapidly hit the same hang condition. This happens because the new worker process will usually start with fewer threads. The large burst of incoming requests will make sure that the those new threads will all get blocked in the same code and much more quickly than before. But, since most hangs are caused by slow external resource retrieval, or thread pool exhaustion, recycling is usually not helpful :. NET hangs manually in our Hang troubleshooting guide , but I would advise using LeanSentry hang diagnostics to get it done quickly and reliably.

NET website hangs:. LeanSentry will then identify the application code causing the hang so you can resolve it quickly:. Go to the Diagnose w3wp. However, recycling these overworked worker processes can have a strong downside. The higher usage is almost always due to a confluence of higher load and heavier than desired processing by the application.

When you recycle the pool, the system will end up working even harder. This happens because the new worker process will be processing the same load, but without the benefit of full caches. And this is on top of any initialization overhead costs. Again, using the issue as an opportunity to diagnose the root cause always wins over temporary recycling.

LeanSentry automatically detects and diagnoses high CPU incidents, so you can get to the root of the issue quickly. You can use the CPU diagnostics reports to determine the exact code pathways that are causing elevated CPU usage, so they can be optimized.

This one is a bit different. This is because memory leaks usually take place over time, due to accumulation of objects that are not properly released e. As a result, recycling the application pool can be an effective bandaid for applications with memory leaks. See the Diagnose w3wp.

NET applications experience elevated or leaky memory usage in production. The downside of this is that many websites require memory-based recycling to keep the server from running out of memory. Another downside is cost. Sites with memory issues often experience a x increase in cloud costs due to needing to run EACH instance with more memory.

Of course, we recommend diagnosing and optimizing memory usage regularly to keep your costs low. This will also help you reduce need for recycling, and increase overall performance by lowering Garbage collection overhead. You can read more about this in our IIS worker process memory optimization guide.

These are all great benefits for sure and well worth it. This will make IIS recycles your application pool when it exceeds a certain memory threshold. To automatically recycle the worker process when it reaches a problematic memory threshold :. These errors usually have to do with WAS failing to allocate a worker process for the application pool in question.

Or, the worker process failing to dequeue requests from the application pool queue. You need to know what kind of problem you are dealing with to know if a recycle will help. For example:.

There is one specific case to be aware of, and that is Rapid Fail Protection. When it does, WAS will disable the application pool to prevent future failures. This now means that your applications in the pool are permanently down. However, then you are likely to have more crashes. The right solution here, as always, is to diagnose the crash itself and remove the root cause. LeanSentry Error diagnostics automatically diagnose causes of Service Unavailable and Queue full incidents in production.

Look for critical error alerts that identify the code-level root causes of s including crashes, CPU overloads, and many others. Then see the Website is not responding or is slow section earlier in this guide.

If you are receiving errors, a recycle will help only if the error is due to a bad state. And only if that state is cleared when your application restarts. If the error is due to a persistent issue misconfiguration or external problem SQL server is down , recycling will not help. In fact, it could make things worse by triggering the additional overhead of application startup.

Because the right answer depends on the specific error, the best thing to do is get the full error details. This will allow you to directly address it instead of hoping it goes away after the restart. Resolving production errors with LeanSentry If you are using LeanSentry, you can use it to get production error details for all production errors across the entire IIS stack. In conclusion, you can take the following actionable steps to deal with recycling in your production IIS site:.

If you are recycling because of hangs, CPU overloads, memory leaks and the like, deploy LeanSentry to diagnose and fix those issues the right way. Diagnose your website Pricing Expert guides How-to Login. Category Restarting and recycling IIS.

How can I reduce application pool recycling, or application restarts, to improve my website availability? Your application is not loading at all, or throwing errors.



0コメント

  • 1000 / 1000