You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by "Alan D. Cabrera" <li...@toolazydogs.com> on 2011/07/19 20:02:50 UTC

Never seem to get a cache hit

I reran my program twice which gets the same set of files but I'm getting 100% miss rate.  I have 1G cache in memory and 10G disk.  I'm downloading about 15M of files.

What should I be looking at to debug this?


Regards,
Alan


Re: Never seem to get a cache hit

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
Age:0
Connection:keep-alive
Content-Length:2964
Content-Type:application/x-ivy+xml
Date:Tue, 19 Jul 2011 20:37:14 GMT
ETag:bbaa7d28ef914ea81c40a7c16132459408854360
Last-Modified:Mon, 20 Jun 2011 23:52:26 GMT
Server:ATS/3.1.0-unstable
Via:http/1.1 acabrera-mn.local (ApacheTrafficServer/3.1.0-unstable [cMsSf ])

On Jul 19, 2011, at 12:04 PM, John Plevyak wrote:

> You can look at the VIA header or if use the debug tags : traffic_server
> -T"http.*"
> 
> Either way, you want to know why ATS thinks it can't cache the docs.
> 
> If you use the debug tags, try just hitting it with a single request and
> then
> repeating it again after a pause as it will print out a trace for each
> request.
> 
> john
> 
> On Tue, Jul 19, 2011 at 11:02 AM, Alan D. Cabrera <li...@toolazydogs.com>wrote:
> 
>> I reran my program twice which gets the same set of files but I'm getting
>> 100% miss rate.  I have 1G cache in memory and 10G disk.  I'm downloading
>> about 15M of files.
>> 
>> What should I be looking at to debug this?
>> 
>> 
>> Regards,
>> Alan
>> 
>> 


Re: Never seem to get a cache hit

Posted by John Plevyak <jp...@acm.org>.
You can look at the VIA header or if use the debug tags : traffic_server
-T"http.*"

Either way, you want to know why ATS thinks it can't cache the docs.

If you use the debug tags, try just hitting it with a single request and
then
repeating it again after a pause as it will print out a trace for each
request.

john

On Tue, Jul 19, 2011 at 11:02 AM, Alan D. Cabrera <li...@toolazydogs.com>wrote:

> I reran my program twice which gets the same set of files but I'm getting
> 100% miss rate.  I have 1G cache in memory and 10G disk.  I'm downloading
> about 15M of files.
>
> What should I be looking at to debug this?
>
>
> Regards,
> Alan
>
>

Re: Never seem to get a cache hit

Posted by Leif Hedstrom <zw...@apache.org>.
On 07/21/2011 12:11 PM, Alan D. Cabrera wrote:
>> Things were changed. However, headers should never be ignored, the old defaults used to be to require at least Last-Modified, which is per the 2616 specs, but it turns out even sites like amazon.com don't understand HTTP, and made private content (shopping carts) cacheable with that setting. So we tightened it down even further, and the default requires explicit Expires or Cache-Control: max-age headers.
> Cool.  Need to update the documentation then I guess.

Indeed, we'll take patches. Actually, talk to Igor if you are interested 
in helping out :).


>> Setting it to 0 lets it cache "anything" that's not explicitly disallowed to cache.
>>
>>> I set the
>>>
>>> CONFIG proxy.config.http.cache.required_headers INT 0
>>>
>>> and still nothing gets cached.
>> Hmmm, yeah, this is really difficult to debug with actually have either access to your configs (including URLs, how you remap etc.), or your system. All I can suggest is to debug with the -T tracer options (e.g. -T http.*) and examine why it's not caching it.
> How do I use this -T tracer option?  Is there a page I can read?


Note sure if it's documented (someone else should chime in), but the 
easiest is to simply do (after you shutdown everything with 
trafficserver stop):

     $ sudo traffic_server -T http.*


and send a request through the server and watch the action. What that 
says is to show all tracer data where the tag matches the regex "http.*".

-- Leif


Re: Never seem to get a cache hit

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
On Jul 21, 2011, at 10:00 AM, Leif Hedstrom wrote:

> On 07/20/2011 09:44 AM, Alan D. Cabrera wrote:
>> I have no control over the origin.
>> 
>> According to the documentation it says that headers are ignored by default and items are cached.  The records.config says otherwise.
> 
> Things were changed. However, headers should never be ignored, the old defaults used to be to require at least Last-Modified, which is per the 2616 specs, but it turns out even sites like amazon.com don't understand HTTP, and made private content (shopping carts) cacheable with that setting. So we tightened it down even further, and the default requires explicit Expires or Cache-Control: max-age headers.

Cool.  Need to update the documentation then I guess.

> Setting it to 0 lets it cache "anything" that's not explicitly disallowed to cache.
> 
>> I set the
>> 
>> CONFIG proxy.config.http.cache.required_headers INT 0
>> 
>> and still nothing gets cached.
> 
> Hmmm, yeah, this is really difficult to debug with actually have either access to your configs (including URLs, how you remap etc.), or your system. All I can suggest is to debug with the -T tracer options (e.g. -T http.*) and examine why it's not caching it.

How do I use this -T tracer option?  Is there a page I can read?


Regards,
Alan


Re: Never seem to get a cache hit

Posted by Leif Hedstrom <zw...@apache.org>.
On 07/20/2011 09:44 AM, Alan D. Cabrera wrote:
> I have no control over the origin.
>
> According to the documentation it says that headers are ignored by default and items are cached.  The records.config says otherwise.

Things were changed. However, headers should never be ignored, the old 
defaults used to be to require at least Last-Modified, which is per the 
2616 specs, but it turns out even sites like amazon.com don't understand 
HTTP, and made private content (shopping carts) cacheable with that 
setting. So we tightened it down even further, and the default requires 
explicit Expires or Cache-Control: max-age headers.

Setting it to 0 lets it cache "anything" that's not explicitly 
disallowed to cache.

> I set the
>
> CONFIG proxy.config.http.cache.required_headers INT 0
>
> and still nothing gets cached.

Hmmm, yeah, this is really difficult to debug with actually have either 
access to your configs (including URLs, how you remap etc.), or your 
system. All I can suggest is to debug with the -T tracer options (e.g. 
-T http.*) and examine why it's not caching it.

-- Leif


Re: Never seem to get a cache hit

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
I have no control over the origin.  

According to the documentation it says that headers are ignored by default and items are cached.  The records.config says otherwise.

I set the 

CONFIG proxy.config.http.cache.required_headers INT 0

and still nothing gets cached.


Regards,
Alan



On Jul 19, 2011, at 3:57 PM, Leif Hedstrom wrote:

> If I read that right, that response is not cacheable with default ATS configs. Look for required headers config in records.config, or ideally modify the origin to send cache-control headers.
> 
> -- leif
> 
> On Jul 19, 2011, at 1:11 PM, "Alan D. Cabrera" <li...@toolazydogs.com> wrote:
> 
>> 
>> On Jul 19, 2011, at 12:06 PM, Igor Galić wrote:
>> 
>>> 
>>> 
>>> ----- Original Message -----
>>>> I reran my program twice which gets the same set of files but I'm
>>>> getting 100% miss rate.  I have 1G cache in memory and 10G disk.
>>>> I'm downloading about 15M of files.
>>>> 
>>>> What should I be looking at to debug this?
>>> 
>>> What do the headers of your back-ends look like?
>> 
>> Request URL:http://foo.com:8081/artifactory/release/com/foo/bar/bar/bar-api/6.6.6/bar-api-6.6.6.jar.sha1
>> Request Method:GET
>> Status Code:200 OK
>> Request Headers
>> Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
>> Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
>> Accept-Encoding:gzip,deflate,sdch
>> Accept-Language:en-US,en;q=0.8
>> Connection:keep-alive
>> Cookie:bcookie="v=1&";
>> Host:foo.com:8081
>> User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30
>> Response Headers
>> Content-Length:40
>> Content-Type:application/x-checksum
>> Date:Tue, 19 Jul 2011 20:06:43 GMT
>> Last-Modified:Tue, 19 Jul 2011 20:06:44 GMT
>> Server:Artifactory/2.3.1
>> 


Re: Never seem to get a cache hit

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> If I read that right, that response is not cacheable with default ATS
> configs. Look for required headers config in records.config, or
> ideally modify the origin to send cache-control headers.

ETag is needlessly expensive. You're better off with Expires headers.
Or, as Leif says, with cache-control headers.

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 571B 8B8A FC97 266D BDA3  EF6F 43AD 80A4 5779 3257

Re: Never seem to get a cache hit

Posted by Leif Hedstrom <zw...@apache.org>.
If I read that right, that response is not cacheable with default ATS configs. Look for required headers config in records.config, or ideally modify the origin to send cache-control headers.

-- leif

On Jul 19, 2011, at 1:11 PM, "Alan D. Cabrera" <li...@toolazydogs.com> wrote:

> 
> On Jul 19, 2011, at 12:06 PM, Igor Galić wrote:
> 
>> 
>> 
>> ----- Original Message -----
>>> I reran my program twice which gets the same set of files but I'm
>>> getting 100% miss rate.  I have 1G cache in memory and 10G disk.
>>> I'm downloading about 15M of files.
>>> 
>>> What should I be looking at to debug this?
>> 
>> What do the headers of your back-ends look like?
> 
> Request URL:http://foo.com:8081/artifactory/release/com/foo/bar/bar/bar-api/6.6.6/bar-api-6.6.6.jar.sha1
> Request Method:GET
> Status Code:200 OK
> Request Headers
> Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
> Accept-Encoding:gzip,deflate,sdch
> Accept-Language:en-US,en;q=0.8
> Connection:keep-alive
> Cookie:bcookie="v=1&";
> Host:foo.com:8081
> User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30
> Response Headers
> Content-Length:40
> Content-Type:application/x-checksum
> Date:Tue, 19 Jul 2011 20:06:43 GMT
> Last-Modified:Tue, 19 Jul 2011 20:06:44 GMT
> Server:Artifactory/2.3.1
> 

Re: Never seem to get a cache hit

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
On Jul 19, 2011, at 12:06 PM, Igor Galić wrote:

> 
> 
> ----- Original Message -----
>> I reran my program twice which gets the same set of files but I'm
>> getting 100% miss rate.  I have 1G cache in memory and 10G disk.
>> I'm downloading about 15M of files.
>> 
>> What should I be looking at to debug this?
> 
> What do the headers of your back-ends look like?

Request URL:http://foo.com:8081/artifactory/release/com/foo/bar/bar/bar-api/6.6.6/bar-api-6.6.6.jar.sha1
Request Method:GET
Status Code:200 OK
Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:bcookie="v=1&";
Host:foo.com:8081
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30
Response Headers
Content-Length:40
Content-Type:application/x-checksum
Date:Tue, 19 Jul 2011 20:06:43 GMT
Last-Modified:Tue, 19 Jul 2011 20:06:44 GMT
Server:Artifactory/2.3.1


Re: Never seem to get a cache hit

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> I reran my program twice which gets the same set of files but I'm
> getting 100% miss rate.  I have 1G cache in memory and 10G disk.
>  I'm downloading about 15M of files.
> 
> What should I be looking at to debug this?

What do the headers of your back-ends look like?

> Regards,
> Alan



-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 571B 8B8A FC97 266D BDA3  EF6F 43AD 80A4 5779 3257