optimize ram_cache.size and ram disk size for live content

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

optimize ram_cache.size and ram disk size for live content

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/
Reply | Threaded
Open this post in threaded view
|

Re: optimize ram_cache.size and ram disk size for live content

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 <[hidden email]> wrote:

> 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/
Reply | Threaded
Open this post in threaded view
|

Re: optimize ram_cache.size and ram disk size for live content

ezko
thanks Kit.
in my setup ATS gradually consumes the ram disk , and eventually is it fully
used.
is that expected ?


Shu Kit Chan wrote
> 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 &lt;

> erez.koler@

> &gt; wrote:
>> 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/
Reply | Threaded
Open this post in threaded view
|

Re: optimize ram_cache.size and ram disk size for live content

Shu Kit Chan
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

On Thu, Dec 7, 2017 at 12:28 AM, ezko <[hidden email]> wrote:

> thanks Kit.
> in my setup ATS gradually consumes the ram disk , and eventually is it fully
> used.
> is that expected ?
>
>
> Shu Kit Chan wrote
>> 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 &lt;
>
>> erez.koler@
>
>> &gt; wrote:
>>> 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/