You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Omid Kosari <om...@yahoo.com> on 2013/11/05 09:01:47 UTC

Rare HIT

I am trying to test ATS performance . In a normal test i checked several urls
with three browsers and looking in /var/log/trafficserver/squid.log .
for example i loaded following url one time with firefox , another time with
google chrome and another time with IE .
http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg

but image does not come from cache and squid.log shows this

1383637874.187 37778 123.123.123.123 TCP_MISS/200 2738848 GET
http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg -
DIRECT/upload.wikimedia.org image/jpeg -
1383637952.337 29747 123.123.123.123 TCP_MISS/200 2738857 GET
http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg -
DIRECT/upload.wikimedia.org image/jpeg -
1383638049.731 80367 123.123.123.123 TCP_MISS/200 2738797 GET
http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg -
DIRECT/upload.wikimedia.org image/jpeg -

I also checked small images , downloading exe files , checking several
different urls etc .

The only HITs i can see are TCP_IMS_HIT/304  and TCP_REFRESH_HIT/304 



--
View this message in context: http://apache-traffic-server.24303.n7.nabble.com/Rare-HIT-tp11.html
Sent from the Apache Traffic Server mailing list archive at Nabble.com.

Re: Rare HIT

Posted by Reindl Harald <h....@thelounge.net>.

Am 05.11.2013 16:34, schrieb Leif Hedstrom:
> On Nov 5, 2013, at 12:01 AM, Omid Kosari <om...@yahoo.com> wrote:
> 
>> I am trying to test ATS performance . In a normal test i checked several urls
>> with three browsers and looking in /var/log/trafficserver/squid.log .
>> for example i loaded following url one time with firefox , another time with
>> google chrome and another time with IE .
>> http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg
> 
> A guess would be that you get hit by this:
> 
> 	https://issues.apache.org/jira/browse/TS-2245
> 
> I just landed this on master, so give it a test. You would need to set the configs to “2” for it to be safe. What I suspect happens in your case is that the various browsers are differing on what they send for Accept-Language: or one of the other Accept-* headers.
> 
> I’m thinking for v5.0.0, we want to make at least these three configurations the default:
> 
> 	CONFIG proxy.config.http.cache.ignore_accept_language_mismatch INT 2
> 	CONFIG proxy.config.http.cache.ignore_accept_encoding_mismatch INT 2
> 	proxy.config.http.cache.ignore_accept_charset_mismatch INT 2
> 
> There are use cases for both the “0” setting and the “1” setting, but the most sane behavior IMO is the above. 
> But we can’t make this change in the v4.x release cycle, since it’s technically an incompatible configuration change 
> (it does change the behavior)

i am not sure now if 2 is still supported and only the default will change
looking at the description and my explicit origin-config "2" will ineed
be the best option because i remove "Vary" explicit for static files and
for extensions which are handeled with mod_deflate after hat add a vary
for "Accept-Encoding"

currently the settings are at "1" here because "Cache-Control: public, proxy-revalidate"
and ETAG-headers on each dynamic page, but "2" would be perfect

* images are never gzip-compressed -> only one version needs to be cached
* static documents which may be compressed -> Vary on encdoing but not user-agent
* php-files -> Vary: Accept-Encoding,User-Agent because they may generate different content
___________________________________________________________________

I'm thinking we could turn the existing configuration options to trie-state configs:

0 - Client header is used / honored even in the absence of Vary: header from origin (this is default behavior)
1 - Client header is never used when performing the default alternate selection.
2 - Client header is not used in alternate selection if there is no Vary: from origin specifying to use it
___________________________________________________________________

# Properly handle requests behind proxies
<IfModule mod_headers.c>
 <FilesMatch "\.(php)$">
  Header append "Vary" "User-Agent"
 </FilesMatch>
 <FilesMatch
"\.(gif|jpe?g|png|htm|html|xml|sgm|sgml|css|js|txt|htc|ico|flv|mp4|m4v|wmv|mov|mpg|ogv|webm|mp3|wav|ogg|oga|swf|doc|docx|xls|xlsx|ppt|pptx|pdf|eot|ttf|otf|woff)$">
  Header unset "Vary"
 </FilesMatch>
 <FilesMatch "\.(htm|html|xml|sgm|sgml|css|js|txt|htc|wav|doc|docx|xls|xlsx|ppt|pptx|pdf|eot|ttf|otf|woff)$">
  Header set "Vary" "Accept-Encoding"
 </FilesMatch>
</IfModule>


Re: Rare HIT

Posted by Leif Hedstrom <zw...@apache.org>.
On Nov 5, 2013, at 12:01 AM, Omid Kosari <om...@yahoo.com> wrote:

> I am trying to test ATS performance . In a normal test i checked several urls
> with three browsers and looking in /var/log/trafficserver/squid.log .
> for example i loaded following url one time with firefox , another time with
> google chrome and another time with IE .
> http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg

A guess would be that you get hit by this:

	https://issues.apache.org/jira/browse/TS-2245

I just landed this on master, so give it a test. You would need to set the configs to “2” for it to be safe. What I suspect happens in your case is that the various browsers are differing on what they send for Accept-Language: or one of the other Accept-* headers.

I’m thinking for v5.0.0, we want to make at least these three configurations the default:

	CONFIG proxy.config.http.cache.ignore_accept_language_mismatch INT 2
	CONFIG proxy.config.http.cache.ignore_accept_encoding_mismatch INT 2
	proxy.config.http.cache.ignore_accept_charset_mismatch INT 2


There are use cases for both the “0” setting and the “1” setting, but the most sane behavior IMO is the above. But we can’t make this change in the v4.x release cycle, since it’s technically an incompatible configuration change (it does change the behavior).

— Leif


Re: Rare HIT

Posted by Leif Hedstrom <zw...@apache.org>.
On Nov 5, 2013, at 7:48 AM, Yongming Zhao <mi...@gmail.com> wrote:

> hmm, I don’t know if you have changed the default  proxy.config.http.cache.required_headers  from 2 to 1 or 0.
> if you don’t change it, your content is not save-able.


Indeed, forget what i said (I misread your description). You have to make sure the content is cacheable by the intermediary.

— Leif


Re: Rare HIT

Posted by Yongming Zhao <mi...@gmail.com>.
hmm, I don’t know if you have changed the default  proxy.config.http.cache.required_headers  from 2 to 1 or 0.
if you don’t change it, your content is not save-able.

FYI:
  # required headers: three options:
  #   0 - No required headers to make document cachable
  #   1 - "Last-Modified:", "Expires:", or "Cache-Control: max-age" required
  #   2 - explicit lifetime required, "Expires:" or "Cache-Control: max-age"
CONFIG proxy.config.http.cache.required_headers INT 2

according to your response headers, there is only Last-Modified header there.

HTTP/1.1 200 OK
X-Object-Meta-Sha1base36: 9kc3dr2c3fh1hycxgf801zqrce1tpxp
Last-Modified: Sat, 14 Jul 2012 06:53:57 GMT
Etag: 6d71a06de183c0852e6381167d24da54
X-Timestamp: 1342248837.75819
Content-Type: image/jpeg
X-Varnish: 3794896966, 2272015735
Via: 1.1 varnish, 1.1 varnish
Content-Length: 2738295
Accept-Ranges: bytes
Date: Tue, 05 Nov 2013 15:39:56 GMT
Age: 1
Connection: keep-alive
X-Cache: cp1049 miss (0), cp1048 frontend miss (0)
Access-Control-Allow-Origin: *




在 2013年11月5日,下午4:01,Omid Kosari <om...@yahoo.com> 写道:

> I am trying to test ATS performance . In a normal test i checked several urls
> with three browsers and looking in /var/log/trafficserver/squid.log .
> for example i loaded following url one time with firefox , another time with
> google chrome and another time with IE .
> http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg
> 
> but image does not come from cache and squid.log shows this
> 
> 1383637874.187 37778 123.123.123.123 TCP_MISS/200 2738848 GET
> http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg -
> DIRECT/upload.wikimedia.org image/jpeg -
> 1383637952.337 29747 123.123.123.123 TCP_MISS/200 2738857 GET
> http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg -
> DIRECT/upload.wikimedia.org image/jpeg -
> 1383638049.731 80367 123.123.123.123 TCP_MISS/200 2738797 GET
> http://upload.wikimedia.org/wikipedia/commons/2/28/Clouds_Blue_Sky_001.jpg -
> DIRECT/upload.wikimedia.org image/jpeg -
> 
> I also checked small images , downloading exe files , checking several
> different urls etc .
> 
> The only HITs i can see are TCP_IMS_HIT/304  and TCP_REFRESH_HIT/304 
> 
> 
> 
> --
> View this message in context: http://apache-traffic-server.24303.n7.nabble.com/Rare-HIT-tp11.html
> Sent from the Apache Traffic Server mailing list archive at Nabble.com.