Recommended: ASP error collection ASP error collection is helpful to beginners, and perhaps experts will forget it. ASP error collection Microsoft VBScript language*Error (0x800A03E9)-->Insufficient memory Microsoft VBScript language*Error (0x800A03EA)-->Speech*Error Microsoft VBScript language*Error (0x800A03EA)-->Speech*Error Microsoft VBScript language*
The ASP request is initialized by the WAM object. The WAM object then sends it to ASP-RunTime. ASP-RunTime responds to it by creating an internal page object.A WAM object is a free thread object. When it calls an ISAPI extension such as ASP.DLL, it uses threads of the MTA model allocated by the thread pool maintained by IIS-RunTime.
A difficult problem faced when creating an ISAPI extension is how to deal with the thread concurrency and synchronization caused by this MTA thread pool. ASP-RunTime simplifies the problem by switching each ASP request to a single threaded unit (STA) before running the ASP script. ASP-RunTime manages a standalone STA helper thread pool (in the background, ASP actually does this by using a COM thread pool). ASP designers created this thread pooling scheme to provide an optimized balance between concurrency and resource utilization while eliminating the need for programmers to achieve synchronization.
How does ASP-RunTime switch each request from an MTA thread to a STA thread. The ASP-RunTime scheduling mechanism places each request into a central request queue. The STA threads in the thread pool managed by the ASP monitor the queue and process the requests in a first-in-first-out manner. Note that the size of this thread pool changes dynamically. ASP-RunTime generates additional threads during peak communications, and releases threads when there is less communication.
Switching to STA thread effectively solves the concurrency problem, but this also has a significant impact on performance. The ISAPI extended DLL processed in a separate MTA thread squadron provides faster response times.
IIS provides a method to set the maximum size of the STA thread pool and request queue. The size of the thread pool is controlled by the AspProcessorThreadMax primary key in the IIS metadatabase. The default setting for this primary key is 25 per process per processor (Comment: It is best to find Microsoft's relevant documentation to prove this number. Some people say that this number is 10 per CPU). That is to say, in a four-processor computer, each process that processes ASP can have up to 100 auxiliary threads. Unless issues related to tuning thread pools have been considered, changing this key value should be avoided. Note that you cannot use Internet Server Manager to change this setting. It must be modified using management scripts or VB applications.
IIS sets a maximum capacity for the ASP request queue. By default, ASP-RunTime allows a queue to hold up to 3000 requests (a different Microsoft document states that this queue can only hold 500 requests). Once exceeded, the later entry ASP request will be denied, and the error message is returned as Server Too Busy.
The AspProcessorThreadMax primary key and AspRequestQueueMax primary key can be programmed using IIS management objects and ADSI. For example, in a Standard EXE project, refer to the Active DS type library and write the following code:
Dim MyWebServer As ActiveDS.IADs
Set MyWebServer = GetOject(IIS://Localhost/W3SVC)
MyWebServer.Put AspProcessorThreadMax, 30
MyWebServer.Put AspRequestQueueMax, 1500
MyWebServer.SetInfo
Here is a brief summary of how the ASP thread pool works in IIS installed by default on a single processor computer. This thread pool has 25 STA helper threads available for each processor. When a request arrives, it is placed in the request queue. ASP-RunTime schedules an idle STA thread from the thread pool, if one is available (note that this scheme allows any thread in the thread pool to process the request). If there are no free helper threads, the request will be added to the queue. As long as the queue does not reach the default maximum capacity, all requests will be processed.
Programming Distributed Application with Visual Basic 6.0 from Ted Pattison
Share: Technical features and usage methods of ASP A few years ago, the only channel in the industry for dynamic homepage release was the CGI (Common Ga teway Interface) model. Although the subsequent technical solutions such as ISAPI, NSAPI and JDBC have improved compared to CGI, these solutions are still measured from the technical reality of the enterprise network (Intranet).