Which cache algorithm is used for disk cache of ATS and how to decide an object to be cached by disk or RAM in ATS?
Version: 8.0.3 The docs of ATS does not introduce how the disk cache admits and evicts objects. Also, When an object is received, how ATS decides whether the disk or the RAM caches it? Are the two type of cache work independently?
By the way , I'm looking for somewhere to discuss the usage details of ATS. I already subscribed [email protected], and sent email to [email protected], but the reply is helpless.
I also log in slack with my email address, but I'm not dmitted to join the traffic-server channel.
Probably https://docs.trafficserver.apache.org/developer-guide/cache-architecture/architecture.en.html would be what you are looking for.
The docs of ATS does not introduce how the disk cache admits and evicts objects.
- Think of the disk cache as a circular buffer. Roughly, as it gets objects to cache, it writes it at the current spot on the circle. Eg, once the disk is full, a new object will overwrite an existing one. (There is a setting to help keep frequent accessed docs in cache -- if a requested object is about to be overwritten, it can be kept.)
Also, When an object is received, how ATS decides whether the disk or the RAM caches it? Are the two type of cache work independently? First an object is written to disk cache. If it's seen frequently enough, it gets promoted to RAM cache.
Thanks for your careful answer. But I'm confused of the log. I request the same object "http://127.0.0.1:9000/1" for 4 times consecutively. The "cwr" field in the log file shows "FIN" (indicating cache write successful), "FIN", "-", and "-" respectively, and the "chm" field in the log file shows "MISS", "MISS", "HIT", and "HIT_RAM" respectively. Why the first request results in successful caching write but the second request still misses the cache?
could you show the response headers both from origin and from ats? eg,
curl -sD- -o/dev/null "http://127.0.0.1:9000/1"
curl -sD- -o/dev/null "http://$origin/1"
ATS listens at port 6000, and origin listens at port 9000. "Curl -sD" prints nothing, while curl -v prints something. Also, when I curl -sD from ats, the log file of ATS does not present new lines. Responses from port 6000 (ATS) are:
Responses from port 9000 (origin) are:
They seem to be the same.
Curls’ -D (dump headers) needs a dash after to display on screen.
I’d start with adding cache headers on the origin— Cache-Control or Expires.
Thanks much! I first adds the Cache control and Expire headers, which doesn't work. Later I change the disk cache location from "/var/cache/ats_storage" to "/opt/ts/var/trafficserver", and the second request can hit the cache successfully. By the way, does ATS provides available interface to design customized disk cache algorithm?
By the way, does ATS provides available interface to design customized disk cache algorithm?
No, ATS does not provide any such configuration.