Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 52111 invoked by uid 500); 10 Jan 2002 02:49:44 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 52099 invoked from network); 10 Jan 2002 02:49:44 -0000 Message-ID: <3C3D0151.8050604@cnet.com> Date: Wed, 09 Jan 2002 18:49:53 -0800 From: Brian Pane User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.5) Gecko/20011011 X-Accept-Language: en-us MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: cvs commit: httpd-2.0/docs/manual/mod mod_log_config.html References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Joshua Slive wrote: >>-----Original Message----- >>From: Ian Holsman [mailto:ianh@apache.org] >> > >>>> new option LogExcludeByType >>>> main use is so that you can ignore logging images >>>> >>>Hmmm... I'm pretty close to a -1 on this one. We were just discussing >>>simplifying the logging directives, while this will compilicate >>> >>them for no >> >>>good reason. Can you justify why this is an improvement over >>>http://httpd.apache.org/docs/logs.html#conditional and >>>http://httpd.apache.org/docs/env.html#examples ? >>> >>I guess the answer is mainly a speed one. >> >>setenvif is a regex call while this isn't. >> > >Can you really benchmark speed differences between the two? > Yes. And the difference is quite large. The cost of a single regex comparison isn't too bad compared to the cost of a single hash table lookup (about 300 cycles for the regex match vs ~100 for the hash table lookup on a Sparc, based on our most recent round of profiling data). The problem is that mod_setenvif does a *lot* of regex operations per request. Specifically, it does O(N) regex comparisons for N SetEnvIf rules, compared to O(1) hash table lookups per request for LogExcludeByType. At least in its present form, mod_setenvif simply isn't a scalable solution. I'm mildly alarmed that we're actually advocating it as a general-purpose solution in the documentation URLs listed above; we really should warn readers that the processing cost scales linearly with the number of rules. >Wouldn't we be better off designing a fast-path for mod_setenvif that could >take something like >SetEnvIf REQUEST_URI \.gif$ >and test it without a regex? (I admit that I don't know how much work that >would be.) > That would work if you could also reduce the O(N) comparisons per request to O(1)...without that additional improvement, though, it still won't scalewell as the number of SetEnvIf rules increases. --Brian