Forum Discussion

juan_salinas_47's avatar
juan_salinas_47
Icon for Nimbostratus rankNimbostratus
Jul 14, 2010

cache age per extensions and server side traffic


hi devcentral community,
i have this situation:
1.-an irule in production handling 5gbps of traffic at peak time in the client side:

when CACHE_REQUEST timing on {
 set httppath [string tolower [HTTP::path]]
  log local0. "mycache $httppath" 
 if { $httppath ends_with ".jpg" } {
  set TTL 240
 }
 elseif { $httppath ends_with ".swf" } {
set TTL 660 
 }
 else {
set TTL 3610
 }

 if { [CACHE::age] > $TTL } {
    CACHE::expire
if { $TTL == 3610 } {
log "mycache ttl $TTL expired $httppath "
}
  } 
}

2.-in the server side LTM has two 1gbps links in etherchannel or link agreggation with  200mbps utilization.
3.-the content files on the pool servers are jpg,gif,flv,swf,mp3 (1-2GBytes).
4.-all content is publlshed at the the same time(aprox) in the servers and overwrited if a previous version exist.

The problem is....
when i use the command CACHE::expire the traffic grow and limit to 2gbps .
this peaks appears in intervals defined in the irule,
each 240s and 660s i have 900mbps server side peaks.
each 3610s the LinkAggregation collapse because the server side is traffic is too high (>2gbps).

My questions are...
when a object is expired (using irules) simultaneous request wait for the first request is complete and then serve the content from cache? 
or 
all requests are served from the pool until the first request complete?
any idea how to solve? (add more links is not possible, we need save server side bandwidth)

thanks and excuse my english.

2 Replies

  • Hi Juan,

     

     

    I believe that all requests would be sent to the pool if there isn't a matching object in RAM cache. I don't see any efficient way around this except adding more links to the trunk on the server side. If you're on v10.x, you might be able to:

     

     

    check whether the item doesn't exist in cache

     

    track the first request for each object (using the table command)

     

    if the current request isn't the first request going to the pool for that object, use HTTP::collect to hold the HTTP

     

    use the 'after' command to wait x seconds and release the HTTP using HTTP::reelease

     

     

    I'm skeptical that this can be done. And if it can be done, I'm not sure it will be efficient. It would be a lot simpler to add more links to the trunk.

     

     

    Aaron
  • hi Aaron,

     

    i'll try the table command solution when the new LTM 8950 pair arrive to my office.

     

    my company bougth this hardware to replace a cisco ACE pair...because cisco ACE module don't support cache, so i have to make work the solution reducing the server side bandwidth.

     

    i think in other solution...

     

    1.configure the HTTP profile to honor the Cache Headers

     

    2.Modify the Cache headers (based on the extension...jpg,flv,etc) in the HTTP_RESPONSE event...when the content...enter to LTM Cache.

     

     

    what you think about that?

     

    could it work?

     

     

    thanks