ASP.NET process mode

xiaoxiao2021-03-06  59

ASP.NET process mode

Using Process Model Process Model Configuring Passive Process Recycling Proactive Process Recycling Process Model Event Enable Network Garden This section

-------------------------------------------------- ----------------------------- One of the most important requirements for the ASP.NET framework application is reliability. The structure of the application running in the server process (in IIS is INetInfo.exe) does not provide a solid foundation for generating reliable applications that can continue long-running. There are too many resources shared at the process level, and a mistake makes the entire server process crash too easily. To resolve this issue, ASP.NET provides an external execution model that protects server processes from user code interference. It also allows you to apply intuitive inferration methods to the process of survival to improve the availability of web applications. By using an asynchronous process, the best balance can be achieved between performance, scalability, and reliability.

Process model configuration

The process model is set in the root configuration file of the computer. Machine.config is disclosed. The configuration section is named , as shown in the following example. The process model is enabled by default (enable = "true").

Most of these settings initiate a new auxiliary process to request a service (normally replacing the old auxiliary process). Process model supports two types of recycling: proactive and passive.

Passive process recycling

The passive process recycling occurs when the process behavior is maloccused or cannot be requested for the request service. The process generally displays the detected signs, such as deadlocks, access conflicts, memory leaks, etc. to trigger the process recycling. You can use the configuration settings described in the following table to control the conditions that triggered the restart process.

Setting Description RequestQueuelimit Processes deadlock conditions. This DWORD value is set to the maximum number of requests allowed in the queue, and the number is considered to be auxiliary process behavior. When this value is exceeded, a new process is initiated and the request is reassigned. The default is 5,000 requests. MemoryLimit processes memory leak conditions. This DWORD value is set to the percentage of physical memory available to the auxiliary process, which is considered to be auxiliary process behavior. When this percentage is exceeded, the new process is started and the request is reassigned. The default is 80%. ShutDowntimeout specifies the time (time: score: second) of the auxiliary process itself. If the timeout expires, the ASP.NET ISAPI will turn off the auxiliary process. The default is "00:00:05".

Active process recycling

The active process recycles regularly restart the auxiliary process, even if the process is very normal. This may be a useful method that prevents the service from being rejected due to the condition that the process model cannot detect. The process can restart after the number of times more than a specific request is reached.

Setting Description Timeout: 分: String value of second format, configure time limit, will start a new auxiliary process after the limit is replaced. The default is infinite, this keyword indicates that the process should not be restarted. Idletimeout: Score: String of second format, used to configure inactive time, more than this amount of the secondary process will automatically turn off. The default is infinite, this keyword indicates that the process should not be restarted. RequestLimit is set to the DWORD value of the requested number, and the new auxiliary process will be activated after this number is launched to replace the current process. The default is infinite, this keyword indicates that the process should not be restarted. Record process model event

The process model writes an event to the Windows event log when a process loop occurs. This is controlled by the Loglevel property in the Configuration section.

Setting Description Loglevel controls the process loop event to the event log. Its value can be: All: Record all process loop events. None: Do not record events. ERRORS: Only accidents are recorded.

When a loop event occurs, if the record is enabled for the event, the following event is written to the application event log.

Closing Cause Event Log Type Description UNEXPECTED Error ASP.NET The auxiliary process is unexpectedly closed. RequestQueuelimit error Because the request queue limit is exceeded, the ASP.NET assist process has been restarted. RequestLimit information The ASP.NET assist process has been restarted because it exceeds the request restriction. The timeout information has been restarted because the time division has arrived. Idletimeout information is that the ASP.NET assist process is closed because the idle oversteph is arrived. MemoryLimitexceeded error Because the process's memory restriction is exceeded, the ASP.NET assist process has been restarted.

Enable network garden

Process model helps enable scaling on multiprocessor computers, distribute work to multiple processes (one each CPU), and each process sets the processor relationship to its CPU. This eliminates the lock of the processor, is ideal for large SMP systems. This technology is called web gardening. Enable the configuration settings of the online garden list them in the table below. Note that these settings take effect only after the server is restarted. In order to make this change, IIS must loop.

Set Description WebGarden controls the CPU relationship. TRUE indicates that the process should be related to the corresponding CPU. The default is false. The number of CPUMASK controls the number of processes and the working mechanism of the network garden. Start a process for each CPU, where the corresponding bit in the mask is set to 1. When the usecpuaffinity is set to 0, the CPUMASK settings only control the number of the auxiliary process (set to 1 bits). The maximum number of the auxiliary process allowed is the number of CPUs. By default, all CPUs are enabled and the same auxiliary process as the number of CPUs is started. The default is 0xfffffffff.

You should understand some side effects of Web Horticulture:

If the application uses a session state, it must select a process provider (NT service or SQL). Application status and application static based on each process, not based on each computer. The cache is based on each process instead of each computer.

转载请注明原文地址:https://www.9cbs.com/read-72071.html

New Post(0)