httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject svn commit: r161354 - httpd/httpd/trunk/modules/mappers/mod_rewrite.c
Date Thu, 14 Apr 2005 21:26:05 GMT
Author: gregames
Date: Thu Apr 14 14:26:01 2005
New Revision: 161354

URL: http://svn.apache.org/viewcvs?view=rev&rev=161354
Log:
lookup_map_txtfile: used buffered i/o rather than reading RewriteMap txt: files 
one byte at a time. 

I was horrified to see a dump of a server with hundreds of worker threads in 
read() syscalls,  all trying to read a 149k RewriteMap file simultaneously.  
each thread finds one key, inserts it into the cache, then the rest of the 
information is discarded.  there are further improvements which could be made but 
let's try the simplest first.


Modified:
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?view=diff&r1=161353&r2=161354
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Thu Apr 14 14:26:01 2005
@@ -1238,7 +1238,7 @@
     char line[REWRITE_MAX_TXT_MAP_LINE + 1]; /* +1 for \0 */
     char *value, *keylast;
 
-    if (apr_file_open(&fp, file, APR_READ, APR_OS_DEFAULT,
+    if (apr_file_open(&fp, file, APR_READ|APR_BUFFERED, APR_OS_DEFAULT,
                       r->pool) != APR_SUCCESS) {
         return NULL;
     }



Mime
View raw message