httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51019] New: [PATCH] Implementation of Asynchronous processing support in MPM-WINNT and CORE that doesn't block worker threads
Date Mon, 04 Apr 2011 18:23:30 GMT

           Summary: [PATCH] Implementation of Asynchronous processing
                    support in MPM-WINNT and CORE that doesn't block
                    worker threads
           Product: Apache httpd-2
           Version: 2.2.17
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Keywords: PatchAvailable
          Severity: enhancement
          Priority: P2
         Component: mpm_winnt

Created an attachment (id=26853)
 --> (
Path to provide Async processing support in Apache Core, MPM Winnt and
mod_isapi modules

Implementation of Asynchronous processing support in MPM-WINNT and CORE that
doesn't block worker threads (true async file transfers in Core and ISAPI

Apache Http Server by design does not support asynchronous processing model as
IIS, i.e., HTTP requests that take longer duration such as large file downloads
and Content generators such as mod_Isapi doing HSE_STATUS_PENDING operations
will block worker threads until operations are completed. The provided fix is
to make Apache web server mpm_WinNT core utilize Windows API (TransmitFile, IO
Completion port) to relinquish worker threads efficiently and thereby
increasing the servers scalability significantly.

Reproduction steps:
1. Host Apache such that you can download large files greater than 10MB over
2. Download more than 20 files simultaneously, you can see that worker threads
used for download operations switch between Kernel and User mode frequently and
thereby consuming more CPU resources unnecessarily for long duration.

Enhanced Apache (core, mpm_winnt) request processing pipeline such that HTTP
requests are either processed in asynchronous fashion (if possible) or in
default/synchronous mode. This includes an additiont to APR 1.4.2 network API.

Testing Done:
Tested this enhancement and found Apache to be stable/robust (less memory and
CPU usage).

Test enviornment:
Windows 2003 or 2008
Module configuration: 
mpm_winnt,,,,,,,,,, and
ThreadsPerChild: 30 or more

Test case 1: Download more than 30 files of more than 10MB in size, and check
whether worker threads are able to handle more than 30 requests in parallel.
Test case 2: Use Isapi extension that utilizes HSE_STATUS_PENDING server
support function, and check whether threads are not getting blocked.

Enhancement details: 
Apache core HTTP pipeline is enhanced as follows: 

1)Dispatch stage:
HTTP connection listening thread accepts and dispatches incoming HTTP requests
to Apache worker threads, this stage is enhanced to dispatch asynchronous
operation completion notifications (refer below) as well.

2)Execution stage: 
Worker threads processes incoming requests as follows. 

a. If incoming requests are deemed to take longer duration, such requests are
executed in asynchronous fashion, i.e.,
       i. File download requests: Apache core is enhanced to probe into HTTP
request and identify whether the URI requested involves large data transfer or
not (magnitude configurable via httpd.conf, currently set as >=10MB). If
magnitude is large enough, asynchronous contexts are setup, file transfer
operation is delegated to Windows kernel and worker thread is relinquished back
to Apache. When transfer operation is done, completion notification is signaled
from kernel to Apache dispatch stage.
      ii. Long operations: Apache mod_isapi module is enhanced to relinquish
worker thread if ISAPI extensions hint about extended operation
(HSE_STATUS_PENDING). ISAPI extensions later notify mod_isapi once the extended
asynchronous operation is done (HSE_REQ_DONE_WITH_SESSION), and mod_isapi
module signals completion notification such that Apache dispatch stage gets

c. If incoming requests cannot be possibly (no hints available) or optimally
executed in asynchronous mode, such requests are immediately executed by worker
threads in blocking fashion.

d. If incoming request is an asynchronous completion notification, worker
thread cleans up resources used for asynchronous processing in blocking

Author: L.Thangaraj AntonyCrouse

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message