From dev-return-95891-archive-asf-public=cust-asf.ponee.io@httpd.apache.org Wed Jun 16 11:02:13 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id E8BCA18063B for ; Wed, 16 Jun 2021 13:02:12 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id BFC6541940 for ; Wed, 16 Jun 2021 11:02:08 +0000 (UTC) Received: (qmail 753 invoked by uid 500); 16 Jun 2021 11:02:07 -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 735 invoked by uid 99); 16 Jun 2021 11:02:07 -0000 Received: from spamproc1-he-de.apache.org (HELO spamproc1-he-de.apache.org) (116.203.196.100) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jun 2021 11:02:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-de.apache.org (ASF Mail Server at spamproc1-he-de.apache.org) with ESMTP id 1F97D1FF4B7 for ; Wed, 16 Jun 2021 11:02:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-de.apache.org X-Spam-Flag: NO X-Spam-Score: -0.2 X-Spam-Level: X-Spam-Status: No, score=-0.2 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamproc1-he-de.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=suse.cz header.b=YCdKgUP9; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=suse.cz header.b=huTvpML/; dkim=pass (1024-bit key) header.d=suse.cz header.b=YCdKgUP9; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=suse.cz header.b=huTvpML/ Received: from mx1-he-de.apache.org ([116.203.227.195]) by localhost (spamproc1-he-de.apache.org [116.203.196.100]) (amavisd-new, port 10024) with ESMTP id 7H4x3tzP18h8 for ; Wed, 16 Jun 2021 11:02:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=195.135.220.29; helo=smtp-out2.suse.de; envelope-from=pgajdos@suse.cz; receiver= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 89EF07FFCC for ; Wed, 16 Jun 2021 11:02:06 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 498F71FD6F for ; Wed, 16 Jun 2021 11:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623841320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=DSoKxO9VYG5MbcO4CF9h00A7C/dztiQL0XvOa9jr93E=; b=YCdKgUP90KjPzIcPOi2bUy2m/l8ukNfNQOkUujf7CZg0Rz05HIMQwbKzv3hPv9Fhqqs754 zclpEr6h7ERUvY9nrw7hBshz3Ll1BymGOwPfHY64wI7hNaVdqi6cghfrX93uEIN6Ig+8mm NjHx6y7xVDkvFyC0XnzwhAFtVA9G1DE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623841320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=DSoKxO9VYG5MbcO4CF9h00A7C/dztiQL0XvOa9jr93E=; b=huTvpML/lQPWi+U+EfqJo1Wzy93jUXLUI37YE+FZ/cpX/H/mHP/LYWfCZzplmV5v/oM7AX CrjTeclALm781HDg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 301C2118DD for ; Wed, 16 Jun 2021 11:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623841320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=DSoKxO9VYG5MbcO4CF9h00A7C/dztiQL0XvOa9jr93E=; b=YCdKgUP90KjPzIcPOi2bUy2m/l8ukNfNQOkUujf7CZg0Rz05HIMQwbKzv3hPv9Fhqqs754 zclpEr6h7ERUvY9nrw7hBshz3Ll1BymGOwPfHY64wI7hNaVdqi6cghfrX93uEIN6Ig+8mm NjHx6y7xVDkvFyC0XnzwhAFtVA9G1DE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623841320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=DSoKxO9VYG5MbcO4CF9h00A7C/dztiQL0XvOa9jr93E=; b=huTvpML/lQPWi+U+EfqJo1Wzy93jUXLUI37YE+FZ/cpX/H/mHP/LYWfCZzplmV5v/oM7AX CrjTeclALm781HDg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id X9PMCyjayWCzYAAALh3uQQ (envelope-from ) for ; Wed, 16 Jun 2021 11:02:00 +0000 Date: Wed, 16 Jun 2021 13:01:59 +0200 From: pgajdos To: dev@httpd.apache.org Subject: often mod_proxy cache revalidates Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, from 2.4.48 on, mod_proxy-cache example [1] begins to fail for me. Unfortunately I can not manage to expose this issue outside apache-rex framework sofar. With 2.4.46, I can not see this at all. $ git clone https://github.com/pgajdos/apache-rex.git $ cd apache-rex $ ./run-rex mod_proxy-cache [..] [1] reverse proxy with cache < X-Cache: MISS from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test 1 misses, 0 revalidates and 9 hits [2] forward proxy with cache < X-Cache: MISS from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test < X-Cache: REVALIDATE from test 1 misses, 9 revalidates and 0 hits Example FAILED (subexample #2): [..] $ Former behavior for 2.4.46: [1] reverse proxy with cache < X-Cache: MISS from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test 1 misses, 0 revalidates and 9 hits [2] forward proxy with cache < X-Cache: MISS from test < X-Cache: REVALIDATE from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test < X-Cache: HIT from test 1 misses, 1 revalidates and 8 hits Roughly: the example config (/tmp/apache-rex/mod_proxy-cache/httpd.conf) looks like: ------------------------------8<------------------------------------ ServerName test User abuild Group abuild Listen 60080 PidFile /tmp/apache-rex/mod_proxy-cache/pid ErrorLog /tmp/apache-rex/mod_proxy-cache/error_log LoadModule auth_basic_module /usr/lib64/apache2-prefork/mod_auth_basic.so LoadModule dir_module /usr/lib64/apache2-prefork/mod_dir.so LoadModule authz_host_module /usr/lib64/apache2-prefork/mod_authz_host.so LoadModule proxy_module /usr/lib64/apache2-prefork/mod_proxy.so LoadModule proxy_http_module /usr/lib64/apache2-prefork/mod_proxy_http.so LoadModule cache_module /usr/lib64/apache2-prefork/mod_cache.so LoadModule log_config_module /usr/lib64/apache2-prefork/mod_log_config.so LoadModule authz_core_module /usr/lib64/apache2-prefork/mod_authz_core.so LoadModule cache_socache_module /usr/lib64/apache2-prefork/mod_cache_socache.so LoadModule socache_shmcb_module /usr/lib64/apache2-prefork/mod_socache_shmcb.so DocumentRoot /tmp/apache-rex/mod_proxy-cache/htdocs DirectoryIndex index.html ### example configuration LogFormat "%s %{cache-status}e" cache_format Listen 60081 ErrorLog "/tmp/apache-rex/mod_proxy-cache/error_log-backend" DocumentRoot "/tmp/apache-rex/mod_proxy-cache/htdocs-backend" Require local Listen 60082 ErrorLog "/tmp/apache-rex/mod_proxy-cache/error_log-reverse-proxy" ProxyPass "http://localhost:60081/" CacheSocache shmcb CacheSocacheMaxSize 102400 CacheEnable socache "/" CacheHeader on CustomLog "/tmp/apache-rex/mod_proxy-cache/reverse-proxy-uncached.log" cache_format env=cache-miss CustomLog "/tmp/apache-rex/mod_proxy-cache/reverse-proxy-cached.log" cache_format env=cache-hit CustomLog "/tmp/apache-rex/mod_proxy-cache/reverse-proxy-revalidated.log" cache_format env=cache-revalidate Listen 60083 ErrorLog "/tmp/apache-rex/mod_proxy-cache/error_log-forward-proxy" ProxyRequests On Require local CacheSocache shmcb CacheSocacheMaxSize 102400 # http://httpd.apache.org/docs/current/mod/mod_cache.html#cacheenable CacheEnable socache http://localhost:60081/ CacheHeader on CustomLog "/tmp/apache-rex/mod_proxy-cache/forward-proxy-uncached.log" cache_format env=cache-miss CustomLog "/tmp/apache-rex/mod_proxy-cache/forward-proxy-cached.log" cache_format env=cache-hit CustomLog "/tmp/apache-rex/mod_proxy-cache/forward-proxy-revalidated.log" cache_format env=cache-revalidate ------------------------------>8------------------------------------ And the script runs 10 requests on the server: for i in $(seq 1 10); do curl -s -v --proxy http://localhost:60083/ http://localhost:60081/ 2>&1 | grep 'X-Cache' sleep 0.1 done And again, I cannot reproduce for example with httpd run with fx. -f /tmp/apache-rex/mod_proxy-cache/httpd.conf and running requests manually. I will try harder, I just want to know first whether this is something known or whether I have something completely wrong in the configuration. Thanks for your attention, Petr [1] https://github.com/pgajdos/apache-rex/tree/master/mod_proxy-cache -- Have a lot of fun!