On Jul 9, 2015 4:46 PM, "Mateusz Zajakala" <[email protected]> wrote:
> Hi everyone, > > I'd like to get some insight into how I can configure and fine-tune ATS to > eliminate flooding origin server with requests on TCP_MISS and to make sure > I undestand what I'm doing. > > I hope this is the right place to ask :) > > Case: we have origin server serving HLS video chunks + playlists. What > this means for ATS is: > - we know that exactly every request is cacheable > - expiry time for playlists is very short (10s), video chunks a little > longer (this is set by origin) > - we know the size of objects (1-2MB per video file) > - we do all of our caching in RAM > > We use ATS as reverse proxy with the following records config: > CONFIG proxy.config.http.cache.required_headers INT 0 > - does this make ATS cache everything? > CONFIG proxy.config.cache.enable_read_while_writer INT 1 > - we don't want to wait until chunk is served to one client, we want to > serve them in parallel > CONFIG proxy.config.http.background_fill_active_timeout INT 0 > CONFIG proxy.config.http.background_fill_completed_threshold FLOAT 0.000000 > - accoring to docs these allow download to cache to finish if client that > initiated disconnects > CONFIG proxy.config.http.cache.max_open_read_retries INT 5 > CONFIG proxy.config.http.cache.open_read_retry_time INT 100 > - this is KEY - we need to have collapsed forwarding! > CONFIG proxy.config.cache.ram_cache.size INT 20G > - put everything in RAM > > All others are defaults. Now with these settings we are getting a > respectable 99,1% hit ratio. However there are cases when increasing the > number of incoming requests to ATS causes it to flood origin on TCP_MISS > (origin responds with 200, so if-modified-since is not part of the request). > > Now, I would imagine that setting max_open_read_retries + > open_read_retry_time would make ALL clients requesting a file (but the > first one) wait until the first one retrieves headers and because of > enable_read_while_writer they would then serve the retrieved file. However > I'm seeing in squid.blog that sometimes during 100ms or more there are > multiple TCP_MISS and origin server requests for the same file. I tried > tweaking values of open_read timeout and retries but without sucess. > > Request serving time on TCP_MISS is usually less than 10ms. We have a good > link to origin. > > My goal would be to have a "perfect" collapsed forwarding. I don't care > about latency (I can make client wait even 5s if necessary), but I don't > want to hit origin. Is this possible? Do I need to adjust the settings? Or > is there some reason that this cannot be achieved on high number of > requests? > > I would greatly appreciate any suggestions! > > Thanks > Mateusz > > Ps. We are using CentOS 6 + Epel 6 official ATS 3.0.4 (ancient!) on > 40-core, 64-GB RAM machine with 2x10Gbps eth. No observable load problems > with >1K requests /s. >
