Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E2DC119B7 for ; Mon, 14 Apr 2014 12:49:58 +0000 (UTC) Received: (qmail 35011 invoked by uid 500); 14 Apr 2014 12:49:53 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 34887 invoked by uid 500); 14 Apr 2014 12:49:52 -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: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 34870 invoked by uid 99); 14 Apr 2014 12:49:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2014 12:49:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of macbogucki@gmail.com designates 74.125.83.42 as permitted sender) Received: from [74.125.83.42] (HELO mail-ee0-f42.google.com) (74.125.83.42) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2014 12:49:45 +0000 Received: by mail-ee0-f42.google.com with SMTP id d17so6610949eek.1 for ; Mon, 14 Apr 2014 05:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=8VoLjVeYY1UIDCqGA0s68xOS7bXwo7C6gr0k0P77m+A=; b=TcMQLWBaKqTofq0Lot04u1FAYwcSqOn5HengdFYJnT+q+HkcTJ8eyy6HZCvII1B+dG aGEbbKSTcZv+J/RFu9ZJmVIQfauoJoWCONtf8+9FxH1UMCa73BuNwuW6qqJnQbxK6zHQ q3+hT+AhhZYIBt3wz+YljvksWagnbOy8pW3MoSbtmdMiPnqJe5Qhh7w7sfAClQgOTXrc hmtSumj40MgJToQej03fAL/PD3Lc1cffX8auzKHqrcNy8OYg+HI9UKnw0iFawBjOHDhH FHtlO+krBWP7MLHMhpbDVKWRv0hoDHUlfUCeLDqCj6zNL7sF+Oz7xXaP+vtpqJuS0Aj7 Q57g== X-Received: by 10.14.109.201 with SMTP id s49mr2184525eeg.88.1397479763671; Mon, 14 Apr 2014 05:49:23 -0700 (PDT) Received: from [192.168.126.3] ([193.0.236.64]) by mx.google.com with ESMTPSA id g3sm40796289eet.35.2014.04.14.05.49.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 05:49:22 -0700 (PDT) Message-ID: <534BD951.9000906@gmail.com> Date: Mon, 14 Apr 2014 14:49:21 +0200 From: Maciej Bogucki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: mod_cache thundering herd bug Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org > >> r1023398 for 2.2: >> >>http://people.apache.org/~covener/patches/httpd-2.2.x-thunder.diff >> >> The remove_url() prevents other threads from serving a stale cached >> file during refresh of a slow response, but it's unnecessary to have a >> separate path because the refresh has to deal with 200s already. When >> the remove_url was added, there as no thundering herd lock / no >> ability to serve stale content while one guy was reloading. > > covener, mrumph, and I looked at this today at ApacheCon. I updated the bug with some comments > and attached this patch. > >https://issues.apache.org/bugzilla/show_bug.cgi?id=50317 Hello, Thank You very much for the patch but*it doesn't works*. When I'm doing ab (/usr/bin/ab -k -c 5 -n 10http://host/url) test the application get more than one request 1.1.1.1 - - [14/Apr/2014:14:01:58 +0200] "GET /url HTTP/1.0" 200 42398 9A68DBA96CED90DC517F7D6302F5A748.gpi-app1 1163 1163 1.1.1.1 - - [14/Apr/2014:14:02:05 +0200] "GET /url HTTP/1.0" 200 42398 D378685BBD4FB87C63A3A867ABFAFB3E.gpi-app1 2931 2930 1.1.1.1 - - [14/Apr/2014:14:02:05 +0200] "GET /url HTTP/1.0" 200 42398 8B77A0C68FC6F16E0BA3A89C7A614E1A.gpi-app1 2992 2991 1.1.1.1 - - [14/Apr/2014:14:02:05 +0200] "GET /url HTTP/1.0" 200 42398 57A48B49FB6C52E28F1FA97DDFCDC0C8.gpi-app1 3007 3006 1.1.1.1 - - [14/Apr/2014:14:02:05 +0200] "GET /url HTTP/1.0" 200 42398 71573080388181B3C55E88CB4BFAB890.gpi-app1 3051 3051 1.1.1.1 - - [14/Apr/2014:14:02:06 +0200] "GET /url HTTP/1.0" 200 42398 38DA8533D4F9B4046A2F607071652E94.gpi-app1 1412 1412 Here are more information how to reproduce it. *Compilation* cd /tmp svn cohttp://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x cd 2.2.x/ svn cohttp://svn.apache.org/repos/asf/apr/apr/branches/1.4.x srclib/apr svn cohttp://svn.apache.org/repos/asf/apr/apr-util/branches/1.4.x srclib/apr-util ./buildconf ./configure --prefix=/etc/httpd --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --mandir=/usr/share/man --libdir=/usr/lib64 --sysconfdir=/etc/httpd/conf --includedir=/usr/include/httpd --libexecdir=/usr/lib64/httpd/modules --datadir=/var/www --with-installbuilddir=/usr/lib64/httpd/build --with-mpm=prefork --with-apr=/usr --with-apr-util=/usr --enable-suexec --with-suexec --with-suexec-caller=apache --with-suexec-docroot=/var/www --with-suexec-logfile=/var/log/httpd/suexec.log --with-suexec-bin=/usr/sbin/suexec --with-suexec-uidmin=500 --with-suexec-gidmin=100 --enable-pie --with-pcre --enable-mods-shared=all --enable-ssl --with-ssl --enable-proxy --enable-cache --enable-disk-cache --enable-ldap --enable-authnz-ldap --enable-cgid --enable-authn-anon --enable-authn-alias --disable-imagemap patch -p0 < /root/rpmbuild/SOURCES/httpd-2.2.x-thunder.patch make make install *Configuration** * ... ... ## Cache CacheRoot /tmp/cache CacheEnable disk / CacheDisable /static/ CacheMinFileSize 0 CacheMaxFileSize 1048576 CacheDirLevels 2 CacheDirLength 2 CacheLock on CacheLockPath /tmp/mod_cache-lock CacheLockMaxAge 5 CacheIgnoreHeaders ETag Set-Cookie Header unset Expires Header unset Cache-Control Header always set Cache-Control "max-age=30,stale-while-revalidate=15" Best Regards Maciej Bogucki