From 0aee87d2ee7af85e9c138d48eda920c5be323238 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 14 Apr 2005 21:26:01 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@161354 13f79535-47bb-0310-9956-ffa450edef68 --- modules/mappers/mod_rewrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index aab63cbe59..0baad43800 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1238,7 +1238,7 @@ static char *lookup_map_txtfile(request_rec *r, const char *file, char *key) 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; } -- 2.40.0