Bug 41796

Summary: Internal Dummy Connection should process effortlessly
Product: Apache httpd-2 Reporter: Michael Krieger <phyre>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED FIXED    
Severity: major CC: brian
Priority: P2    
Version: 2.2.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Michael Krieger 2007-03-08 17:49:05 UTC
It's clear that the Internal Dummy Connection requests are needed and it is my
understanding that these exist in 2.0 but however are not logged.

My concern is not with them existing or logging, but with the request that is
being made.
The "GET /" request used causes dynamic pages to generate- in some cases with
tens or hundreds of requests in a matter of a few seconds.  A dynamic page I
have shows these Internal dummy connections making tens of database queries to
generate and returning 100-200KB of data to the dummy connection.

This should be changed to either:
 a) request something else other than "GET /", such as using "OPTIONS *", or
"GET /robots.txt" or "GET /apache_internal_dummy_file.txt" that would not be
used or would not incur the massive processing of many of today's Web sites.
 -OR- (better yet)
 b) be handled specially by the request handler that in the case of a connection
from the local IP with that user agent, it should avoid as much advanced
processing as possible(rewrite rules, PHP scripts, Perl scripts, SSI, Directory
restrictions, htaccess processing, etc), and simply return a very short "ACK"
style request with only the necessary headers to be deemed valid.

When the whole server approaches the request limit near the same time or
receives certain commands that dispatch these, it is important that it is not
making requests it shouldn't.

Advertisers and users depend on these database requests to count pageviews and
other measures that Apache suddenly adds hundreds of throughout a day... which
can add up and show a difference in pageviews from what actually is occuring.
Comment 1 Michael Krieger 2007-03-08 18:28:55 UTC
My TEMPORARY solution was to create these virtualhosts (apparently it's an IP6
request in my configuration, so I needed the second).

<Virtualhost 127.0.0.1>
        ServerName      localhost
        DocumentRoot    /var/www
</VirtualHost>
<Virtualhost [::1]>
        ServerName      localhost
        DocumentRoot    /var/www
</VirtualHost>

At least these I know will return MY dummy file instead of a huge PHP script
where the database queries and numbers do matter.

However, this issue needs to be addressed if this method is used to wake up the
children.  Making requests blindly and without care to a Web server can throw
off numbers in more than the logs in an era where everything is dynamic.  The
REQUEST FILE either NEEDS to be configurable, or the HOST NEEDS to be
configurable, or the request TYPE needs to be harmless and dealt with
internally, or the request needs to be silently handled internally without doing
any processing.  Either way really, with the preference being internally
handling it, then changing the type.
Comment 2 Joe Orton 2007-03-12 07:50:07 UTC
Agreed, as discussed recently on dev@ - committed in: 

http://svn.apache.org/viewvc?view=rev&revision=517233