You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by J David <j....@gmail.com> on 2014/10/21 02:01:43 UTC

ATS not caching anything?

Hello all,

After taking some first steps into ATS as a potential replacement for
an aging squid reverse proxy infrastructure, things appear to be going
mostly pretty well.  The first test server is at least up and running,
and with a one-line remap.config, is able to properly handle requests.

However, it does not appear to be caching anything.  The Age: header
is always 0, and the Via: header (with appropriate verbosity) reports
[cMsSf ].  With debugging logs turned on, confirmation appears in the
traffic.out log:

[Oct 20 23:25:43.146] Server {0x803808c00} DEBUG: (http) [88]
perform_cache_write_action CACHE_DO_NO_ACTION


The origin server is serving an ancient static text file:

HTTP/1.1 200 OK

Date: Mon, 20 Oct 2014 23:56:14 GMT

Server: Apache/2.2

Last-Modified: Sat, 02 Dec 2006 08:09:00 GMT

ETag: "b543-7e-4239aa1015f00"

Accept-Ranges: bytes

Content-Length: 126

Connection: close

Content-Type: text/html


That should be the very soul of cachability, but for some reason it
isn't.  Why not?

The cache is configured with 32GiB of RAM and 32GiB of disk (but
ideally I would like to disable the disk cache entirely, ala squid's
"cache_dir null /null" setting, and cache entirely from RAM).  The
cache appears to be working, as diags.log reports:

[Oct 20 23:12:04.608] Server {0x803809400} NOTE: cache enabled


So I'm not sure what's going on. What else should I check?

Thanks for any help!

Re: ATS not caching anything?

Posted by J David <j....@gmail.com>.
On Mon, Oct 20, 2014 at 8:39 PM, Leif Hedstrom <zw...@apache.org> wrote:
> Thanks, yeah that should be changed. If you are up for it, you should make the changes and send us a pull request via Github :-).

:) It may be awhile yet before that resulted in a net increase of
accuracy, but I will work toward that goal.

> Yes, that’s typically what people would do, setup a disk cache on e.g. /dev/shm. If you do, you probably (but always) want to turn off the RAM cache in ATS.

Yup, that seems to work just fine.

It looks like things are all set to start working through the module
development docs. :)

Thanks for the help!

Re: ATS not caching anything?

Posted by Leif Hedstrom <zw...@apache.org>.
> On Oct 20, 2014, at 5:25 PM, J David <j....@gmail.com> wrote:
> 
> On Mon, Oct 20, 2014 at 8:07 PM, James Peach <jp...@apache.org> wrote:
>> You probably need to set proxy.config.http.cache.required_headers ...
> 
> Got it in one!  Thanks!
> 
> It would be swell if that were mentioned from
> https://docs.trafficserver.apache.org/en/latest/admin/http-proxy-caching.en.html
> as the default behaviors described there are very different:
> 
> "By default, Traffic Server caches all objects (including objects with
> no headers); you should change the default setting only for
> specialized proxy situations. “


Thanks, yeah that should be changed. If you are up for it, you should make the changes and send us a pull request via Github :-).

> 
>> Pretty sure you can't disable the disk cache. Objects only get pulled into RAM after coming through the disk cache
> 
> Hmm, what can we do to avoid the disk turning into a bottleneck?
> Should we configure a memory filesystem?


Yes, that’s typically what people would do, setup a disk cache on e.g. /dev/shm. If you do, you probably (but always) want to turn off the RAM cache in ATS. You can also use some of the tricks Comcast did with the hosting.config, to put some content unto the RAM disks, and other content unto e.g. a rotational disk.

— Leif


Re: ATS not caching anything?

Posted by J David <j....@gmail.com>.
On Mon, Oct 20, 2014 at 8:07 PM, James Peach <jp...@apache.org> wrote:
> You probably need to set proxy.config.http.cache.required_headers ...

Got it in one!  Thanks!

It would be swell if that were mentioned from
https://docs.trafficserver.apache.org/en/latest/admin/http-proxy-caching.en.html
as the default behaviors described there are very different:

"By default, Traffic Server caches all objects (including objects with
no headers); you should change the default setting only for
specialized proxy situations. "

> Pretty sure you can't disable the disk cache. Objects only get pulled into RAM after coming through the disk cache

Hmm, what can we do to avoid the disk turning into a bottleneck?
Should we configure a memory filesystem?

Thanks!

Re: ATS not caching anything?

Posted by James Peach <jp...@apache.org>.
On Oct 20, 2014, at 5:01 PM, J David <j....@gmail.com> wrote:
> 
> Hello all,
> 
> After taking some first steps into ATS as a potential replacement for
> an aging squid reverse proxy infrastructure, things appear to be going
> mostly pretty well.  The first test server is at least up and running,
> and with a one-line remap.config, is able to properly handle requests.
> 
> However, it does not appear to be caching anything.  The Age: header
> is always 0, and the Via: header (with appropriate verbosity) reports
> [cMsSf ].  With debugging logs turned on, confirmation appears in the
> traffic.out log:
> 
> [Oct 20 23:25:43.146] Server {0x803808c00} DEBUG: (http) [88]
> perform_cache_write_action CACHE_DO_NO_ACTION
> 
> 
> The origin server is serving an ancient static text file:
> 
> HTTP/1.1 200 OK
> 
> Date: Mon, 20 Oct 2014 23:56:14 GMT
> 
> Server: Apache/2.2
> 
> Last-Modified: Sat, 02 Dec 2006 08:09:00 GMT
> 
> ETag: "b543-7e-4239aa1015f00"
> 
> Accept-Ranges: bytes
> 
> Content-Length: 126
> 
> Connection: close
> 
> Content-Type: text/html
> 
> 
> That should be the very soul of cachability, but for some reason it
> isn't.  Why not?

You probably need to set proxy.config.http.cache.required_headers ...

https://trafficserver.readthedocs.org/en/latest/reference/configuration/records.config.en.html#proxy-config-http-cache-required-headers

> 
> The cache is configured with 32GiB of RAM and 32GiB of disk (but
> ideally I would like to disable the disk cache entirely, ala squid's
> "cache_dir null /null" setting, and cache entirely from RAM).  The
> cache appears to be working, as diags.log reports:
> 
> [Oct 20 23:12:04.608] Server {0x803809400} NOTE: cache enabled

Pretty sure you can't disable the disk cache. Objects only get pulled into RAM after coming through the disk cache

J