.

Architecture: Apache request loop

The Loop

The Apache web server runs as a parent task, with one or more child processes. The parent is responsible for creating the children who in turn serve the actual pages and dynamic content. In Ensembl, the servers usually run with around 10 to 50 child processes. The load average is the number of children plus one parent.

   Apache request
    ↓                
    ↓                
 parent forks to make 
child process             
    ↓                
    ↓                
mod_perl adds new version
 of modules to new child  
    ↓                
    ↓                
  child INIT_handler      
When a new child is required (when the server load is high or the number of children falls below the configured minimum), the Apache parent creates one. The mod_perl environment of the parent is copied to the child, but in Ensembl's case, this is minimal. It is more efficient to put the modules in the parent process at the Apache startup time rather than in each child. The majority of the Perl modules and configuration settings are loaded by the child init handler. Once the child is up and running, requests are sent to it and handled by the inner request loop.

The diagram below shows a simplified Ensembl request loop (although more specifically, this diagram represents a portion of the Apache keep-alive loop).
   Child init handler 
        |
        +------- ← -------+
 R *    ↓                 |
 e *  Post read request   |
 q *    ↓                 |
 u *    ↓                 |
 e *  Trans handler       |
 s *    ↓                 ↑ 
 t *    ↓                 |
   *  Script handler      |
 l *    ↓                 |
 o *    ↓                 |
 o *  Clean up handler    |
 p *    |                 |
        +------- → -------+
        ↓ 
   Child exit handler

Loop handlers

Configuring the loop

The Apache request loop is configured by the main Apache httpd.conf file. Any Perl method can be set to handle any of the stages in the event loop.

Footnotes


 

© 2024 Inserm. Hosted by genouest.org. This product includes software developed by Ensembl.

                
GermOnline based on Ensembl release 50 - Jul 2008
HELP