Discussion:
optimize ram_cache.size and ram disk size for live content
ezko
2017-12-05 14:59:04 UTC
Permalink
Hi.
I'm trying to optimize ATS reverse proxy configuration.
My origin is serving live HLS so all objects are short term lived.

My typical HLS live channel has 4 profiles (0.2Mbit , 0.6 Mbit , 1.2Mbit and
2Mbit).
The playlist has 15 segments , each 4 seconds in length. So the total memory
needed to cache one HLS channel is at worst (0.2+0.6+1.2+2) * 4 * 15 = 30
Mbytes + a few more bytes for the playlist (i'm using header_rewite plugin
with READ_RESPONSE_HDR_HOOK (thanks to Miles Libbey) to set the max-age for
the segments to 60 seconds , so hopefully ATS will evict old segments in
step with the playlist sliding window)

Anyway ideally I would like ATS to use RAM cache only , but i understand
that's currently not an option with ATS , so RAM disk is the best
alternative.

Should i use ATS cache ram (proxy.config.cache.ram_cache.size) , and if yes
what size should i set ?
How does ATS prevent its own cache ram from being swapped to disk ?

For the cache file in storage.config , what type of ram disk should i use ?
tmpfs or ramfs ?
tmpfs seems more controlled , but it could be swapped out.

thanks in advance.



--
Sent from: http://apache-traffic-server.24303.n7.nabble.com/
Shu Kit Chan
2017-12-06 01:04:30 UTC
Permalink
I have been using tmpfs as ram disk for ATS disk cache setup in storage.config.
And it is running fine for me.
It do can get swapped out so i have to monitor my memory consumption
very closely all the time.

Kit
Post by ezko
Hi.
I'm trying to optimize ATS reverse proxy configuration.
My origin is serving live HLS so all objects are short term lived.
My typical HLS live channel has 4 profiles (0.2Mbit , 0.6 Mbit , 1.2Mbit and
2Mbit).
The playlist has 15 segments , each 4 seconds in length. So the total memory
needed to cache one HLS channel is at worst (0.2+0.6+1.2+2) * 4 * 15 = 30
Mbytes + a few more bytes for the playlist (i'm using header_rewite plugin
with READ_RESPONSE_HDR_HOOK (thanks to Miles Libbey) to set the max-age for
the segments to 60 seconds , so hopefully ATS will evict old segments in
step with the playlist sliding window)
Anyway ideally I would like ATS to use RAM cache only , but i understand
that's currently not an option with ATS , so RAM disk is the best
alternative.
Should i use ATS cache ram (proxy.config.cache.ram_cache.size) , and if yes
what size should i set ?
How does ATS prevent its own cache ram from being swapped to disk ?
For the cache file in storage.config , what type of ram disk should i use ?
tmpfs or ramfs ?
tmpfs seems more controlled , but it could be swapped out.
thanks in advance.
--
Sent from: http://apache-traffic-server.24303.n7.nabble.com/
ezko
2017-12-07 08:28:55 UTC
Permalink
thanks Kit.
in my setup ATS gradually consumes the ram disk , and eventually is it fully
used.
is that expected ?
Post by Shu Kit Chan
I have been using tmpfs as ram disk for ATS disk cache setup in storage.config.
And it is running fine for me.
It do can get swapped out so i have to monitor my memory consumption
very closely all the time.
Kit
On Tue, Dec 5, 2017 at 6:59 AM, ezko <
Post by ezko
Hi.
I'm trying to optimize ATS reverse proxy configuration.
My origin is serving live HLS so all objects are short term lived.
My typical HLS live channel has 4 profiles (0.2Mbit , 0.6 Mbit , 1.2Mbit and
2Mbit).
The playlist has 15 segments , each 4 seconds in length. So the total memory
needed to cache one HLS channel is at worst (0.2+0.6+1.2+2) * 4 * 15 = 30
Mbytes + a few more bytes for the playlist (i'm using header_rewite plugin
with READ_RESPONSE_HDR_HOOK (thanks to Miles Libbey) to set the max-age for
the segments to 60 seconds , so hopefully ATS will evict old segments in
step with the playlist sliding window)
Anyway ideally I would like ATS to use RAM cache only , but i understand
that's currently not an option with ATS , so RAM disk is the best
alternative.
Should i use ATS cache ram (proxy.config.cache.ram_cache.size) , and if yes
what size should i set ?
How does ATS prevent its own cache ram from being swapped to disk ?
For the cache file in storage.config , what type of ram disk should i use ?
tmpfs or ramfs ?
tmpfs seems more controlled , but it could be swapped out.
thanks in advance.
--
Sent from: http://apache-traffic-server.24303.n7.nabble.com/
--
Sent from: http://apache-traffic-server.24303.n7.nabble.com/
Shu Kit Chan
2017-12-07 09:14:45 UTC
Permalink
That's the same for me. We use the ram disk as disk cache for ATS and
if you have more entries than the cache can hold. And they all come
through different requests. Eventually the cache will fill up and
evict other entries to make room for the next cacheable response.

Kit
Post by ezko
thanks Kit.
in my setup ATS gradually consumes the ram disk , and eventually is it fully
used.
is that expected ?
Post by Shu Kit Chan
I have been using tmpfs as ram disk for ATS disk cache setup in storage.config.
And it is running fine for me.
It do can get swapped out so i have to monitor my memory consumption
very closely all the time.
Kit
On Tue, Dec 5, 2017 at 6:59 AM, ezko <
Post by ezko
Hi.
I'm trying to optimize ATS reverse proxy configuration.
My origin is serving live HLS so all objects are short term lived.
My typical HLS live channel has 4 profiles (0.2Mbit , 0.6 Mbit , 1.2Mbit and
2Mbit).
The playlist has 15 segments , each 4 seconds in length. So the total memory
needed to cache one HLS channel is at worst (0.2+0.6+1.2+2) * 4 * 15 = 30
Mbytes + a few more bytes for the playlist (i'm using header_rewite plugin
with READ_RESPONSE_HDR_HOOK (thanks to Miles Libbey) to set the max-age for
the segments to 60 seconds , so hopefully ATS will evict old segments in
step with the playlist sliding window)
Anyway ideally I would like ATS to use RAM cache only , but i understand
that's currently not an option with ATS , so RAM disk is the best
alternative.
Should i use ATS cache ram (proxy.config.cache.ram_cache.size) , and if yes
what size should i set ?
How does ATS prevent its own cache ram from being swapped to disk ?
For the cache file in storage.config , what type of ram disk should i use ?
tmpfs or ramfs ?
tmpfs seems more controlled , but it could be swapped out.
thanks in advance.
--
Sent from: http://apache-traffic-server.24303.n7.nabble.com/
--
Sent from: http://apache-traffic-server.24303.n7.nabble.com/
Loading...