Forum Discussion

Darren_Person_2's avatar
Darren_Person_2
Icon for Nimbostratus rankNimbostratus
Oct 23, 2012

F5 RAMCache Limitations - V10.x

Hi All,

 

My team and I are trying to figure out some limitations with RAMCache - here is the problem statement. We have a dynamic site and we are trying to offload webbot traffic to RAMCache so that the crawler traffic can still access the dynamic content, but not impact production as heavily since crawler versions do not need to be as up to date as the user content.

 

First Challenge - we are trying to cache the same object in different ways (user version with a low TTL, no-cache, etc. and WebBot overriding and setting the expire time to 24hrs). In order to do this, we change the RAMCache profile to Ignoreheaders - All, and created an iRule that identifies a webbot by looking at the UserAgent and cache the page based on how we define a "bot" (class of matching values).

 

Solution: The following iRule

 

 

when HTTP_REQUEST {

 

if { [class match [string tolower [HTTP::header User-Agent]] contains UserAgent_cache_class]

 

CACHE::enable

 

log local0. "[IP::local_addr] {[HTTP::header User-Agent]} {CACHE::enable}"

 

} else {

 

CACHE::disable

 

log local0. "[IP::local_addr] {[HTTP::header User-Agent]} {CACHE::disable}"

 

}

 

}

 

when CACHE_REQUEST {

 

log local0. "[IP::local_addr] {[HTTP::header User-Agent]} {CACHE_REQUEST}"

 

}

 

when CACHE_RESPONSE {

 

log local0. "[IP::local_addr] {[HTTP::header User-Agent]} {CACHE_RESPONSE}"

 

}

 

when HTTP_RESPONSE {

 

log local0. "[IP::local_addr] {[HTTP::header User-Agent]} {HTTP_RESPONSE}

 

CACHE::enable

 

}

 

 

Second Challenge: We originally set the RAMCache to 1000Mb (1GB) since we have plenty of RAM on the box. However, as we traced through the requests, we noticed that none of the objects were getting cached nor were we seeing any calls into the CACHE_REQUEST or CACHE_RESPONSE events. We checked the event log and error logs, no errors were throw, it just refused to cache any requests. We eventually turned the RAMCache size down to 100Mb and started to see items finally getting into cache.

 

Need Help Here: What is the RAMCache size limit? I was told that we would have access to as much RAMCache as the device can hold minus some for overhead, etc. In version 9 of LTM, I was able to get a profile up to 1.8Gb of cache, in later versions of LTM v9.6+ that was knocked down to 1.4Gb, but mostly due to 32bit. I had expected by v10 of LTM to be able to access much more RAMCache? Does anyone know the specifics and how this applied with multiple profiles (e.g. does RAMCache get allocated for profiles even if those profiles are disabled?) I'm trying to determine how this feature works and if we can tweak other default profiles down to turn this one up.

 

Third Challenge: With the iRule working and now seeing cached results, we noticed that a copy of the same page is being save multiple times (once for each UserAgent as well as AcceptEncoding). We therefore needed to explicitly set the UserAgent to a strict value when putting the item in cache (e.g. CACHE::useragent "Unified UA"). This basically changes the CACHE key useragent to a static string. This now gives us two copies of any given object (one compressed and one uncompressed).

 

 

Need help - Is there a way to do this without an iRule? Something similar to IgnoreHeaders-all?

 

Appreciate any feedback you may have!

 

-Darren

 

 

 

No RepliesBe the first to reply