Practical mod_perl / HTML Version / books


previous page: 5.11.4. Tracking and Terminating Hanging Processespage up: HTML Version of the booknext page: 5.11.6. Limiting the Request-Rate Speed (Robot Blocking)

5.11.5. Limiting the Number of Processes Serving the Same Resource


Search







modperlbook.org


 HTML Version


 PDF Version


 Download Code


 Table of Contents


 Errata


 mod_perl2 User's Guide


 Sitemap





Add to Google



Creative Commons License


Written by
Eric Cholet (Logilune)
and Stas Bekman (StasoSphere).

Hosted by ibiblio.org.




























To limit the number of Apache children that can simultaneously serve a specific resource, take a look at the Apache mod_throttle_access module.

Throttling access is useful, for example, when a handler uses a resource that places a limitation on concurrent access or that is very CPU-intensive. mod_throttle_access limits the number of concurrent requests to a given URI.

Consider a service providing the following three URIs:

/perl/news/
/perl/webmail/
/perl/morphing/

The response times of the first two URIs are critical, since people want to read the news and their email interactively. The third URI is a very CPU- and RAM-intensive image-morphing service, provided as a bonus to the users. Since we do not want users to abuse this service, we have to set some limit on the number of concurrent requests for this resource. If we do not, the other two critical resources may have their performance degraded.

When compiled or loaded into Apache and enabled, mod_throttle_access makes the MaxConcurrentReqs directive available. For example, the following setting:

<Location "/perl/morphing">
    <Limit PUT GET POST>
        MaxConcurrentReqs 10
    </Limit>
</Location>

will allow only 10 concurrent PUT, GET, HEAD (as implied by GET), or POST requests for the URI /perl/morphing to be processed at any given time. The other two URIs in our example remain unlimited.

 

Continue to:

  • prev: 5.11.4. Tracking and Terminating Hanging Processes
  • Table of Contents
  • next: 5.11.6. Limiting the Request-Rate Speed (Robot Blocking)

Tags

mod_perl, modperl, Apache, perl, cgi, html, mod_perl, e-commerce, scalability, free, open source, OSS, apache, squid, high availability, modperl, linux, unix, Web, www, mod_perl, webserver, admin, apache, book, webmaster, tools, modperl, guide, docs, documentation, help, mod_perl, perl, information, apache, script, errata, eric cholet, perl, apache, mod-perl, stas bekman, mod_perl, cool, perl, Apache, performance, speed, choice




Other projects to check out: meta-religion.com is for those interested in Religious, Spiritual and Esoteric Phenomena. i-want-a-better.com is a community of people discussing what they would like to be improved in their lives and things they use and interact with. You may also want to find a healer in your area or read articles on variety of topics.






TOP
previous page: 5.11.4. Tracking and Terminating Hanging Processespage up: HTML Version of the booknext page: 5.11.6. Limiting the Request-Rate Speed (Robot Blocking)

© 2007 StasoSphere

[ Privacy Policy ] [ Terms of Use ] [ About Authors ] [ Search ]

Last modified Wed May 7 06:27:42 2008