httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Re: ap_sub_req_lookup_uri(r->uri, r, NULL)->content_type always returns 'text/plain'?
Date Sun, 15 Nov 2009 01:10:33 GMT

---- Eric Covener <> wrote: 
> On Sat, Nov 14, 2009 at 7:37 PM,  <> wrote:
> > Our use case is slightly different that the original one for this module.  The
original code is designed to limit the number of connections from any given IP address, whereas
in my case, we want to limit the total number of connections to the entire Apache server instance.
> What does this get you over just setting MaxClients directly?
> -- 
> Eric Covener


"MaxClients" was one of the first approaches that I tried when i was asked about this.

The problem with MaxClients that I found was that it appeared that when it was used, Apache
would queue up the requests.  The end-result from the user perspective was that either response
time would look really slow, or their browser would eventually timeout, and they'd get (in
IE) a "The page cannot be displayed".

For the situation that I've been asked to look into, they don't want either of the above (slow
response or "The page cannot be displayed"), but they want the user to get some kind of message
like "System too busy.  Please try again later.".

With mod_limitipconn (vs. MaxClients), when mod_limitipconn is "triggered", Apache immediately
(well, almost immediately) sends a 503 response, and with a custom ErrorDocument, we can customize
the message.

This works pretty well, but the problem is that since most pages have embedded content (css,
images, etc.), and, without the working NoIPLimit directive, mod_limitipconn will send 503
responses indiscriminately, i.e., it can send a 503 response to a GET for a CSS, which makes
the pages that the user's see look broken.  

I was hoping that I could get the NoIPLimit directive to work, then I could then configure
mod_limitipconn to not count requests for things like CSS and GIFs, but per my original post,
it looks like, for some reason the "content_type" that it's getting is always "text/plain".
 Actually, I think what's happening is when it calls that ap_...uri(), it's getting nothing,
so it uses the default content type, which happens to be "text/plain".


View raw message