Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Temporary Save.

While the default configuration values for ATS will get you up and running,
they they're somewhat designed for regression testing and not real-world applications.

This page documents what I've discovered myself through a fair amount of experimentation
and experimentation and real-world experience.

The following lists the steps involved in taking a generic configuration,
and  and modifying it for my own needs. Yours may vary, however, and I'll do my best
to indicate which settings should be sized based on your install.

NOTE: My goal here is to give myself pretty aggressive caching at the highest throughput possible.

All three Wiki pages use configuration examples from my running home Traffic Server setup.

...

Please keep in mind the following only applies to creating a forward-only web proxy caching setup.

The following lists the initial steps involved in getting a generic Traffic Server install up and running.

NOTE:  Please use the following with Apache Traffic Server v5.0.0 and higher.

 Home Machine

  • Make/Model: Apple iMac Mid 2011
  • CPU: 3.4 Ghz Intel Core i7 (quad-core w/Hyperthreading)
  • Memory: 16GB
  • Disk: 1TB
  • OS: Mac OS X v10.9.3
  • Cache Size: 8GB

...

  • Browser: Google Chrome v35

Testing Regimen

The following settings have been tested against the following:

  • IPv4 websites
  • IPv6 websites
  • Explicitly difficult web pages (i.e. Bing Image Search)
  • Explicitly SSL web sites (i.e. Facebook)
  • Internet Radio (various types)
  • )
  • Internet Radio (HTTP streaming, as well as iTunes Radio & Pandora)

The following settings are all located in /usr/local/etc/trafficserver/records.config.

Since Traffic Server v5.0.0 has reorganized this file, I'll go through the relevant sections here.  When adding configurations, simply add the settings below the existing ones.

Thread Configuration

As I'm using Traffic Server on a personal basis, I decided to explicitly configure it to not consume as many CPU cores as it might do otherwise.

Code Block
CONFIG proxy.config.exec_thread.autoconfig INT 0
CONFIG proxy.config.exec_thread.limit INT 1

HTTP Connection Timeouts

I'm using Traffic Server on a pretty speedy broadband connection.  As such, I've configured it to be somewhat impatient in terms of timeouts.

Some of these are also borrowed from Mozilla Firefox.

Code Block
CONFIG proxy.config.http.keep_alive_no_activity_timeout_in INT 600
CONFIG proxy.config.http.keep_alive_no_activity_timeout_out INT 115
CONFIG proxy.config.http.transaction_no_activity_timeout_in INT 10
CONFIG proxy.config.http.transaction_no_activity_timeout_out INT 10
CONFIG proxy.config.http.transaction_active_timeout_in INT 43200
CONFIG proxy.config.http.transaction_active_timeout_out INT 43200
CONFIG proxy.config.http.accept_no_activity_timeout INT 10
CONFIG proxy.config.net.default_inactivity_timeout INT 10

Origin Server Connect Attempts

I had a similar experience tuning Squid in this regard.  This first setting controls how many connections ATS can make outbound to various Internet servers,
on a per-server basis. The default allows for unlimited connections, and while that may be useful on a heavily loaded server I find that it actually slows things down a bit.

I decided to go with 32 connections per origin server simultaneously.

The second setting controls how often Traffic Server will internally poll to process network events.  As I'm on a machine that can't easily handle 2-3% CPU load constantly, I reduced this.

Code Block
CONFIG proxy.config.http.origin_max_connections 32
CONFIG proxy.config.net.poll_timeout INT 50

Cache Control

The following configurations tell Traffic Server to be more aggressive than it would otherwise, with regard to caching overall as well as some speed-ups.

Code Block
CONFIG proxy.config.http.chunking.size INT 128K
CONFIG proxy.config.http.server_session_sharing.match STRING host
CONFIG proxy.config.http.cache.ignore_client_no_cache INT 0
CONFIG proxy.config.http.cache.ims_on_client_no_cache INT 0
CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1

Heuristic Cache Expiration

The default config for Traffic Server specifies that after 1 day(86,400 seconds), any object without a specific expiration cannot be cached.

I'd prefer that they stick around for between 1-3 months. This setting is contentious in that what it should be is debatable.

The goal here is to enforce a window of between 1 and 3 months to keep objects in the cache, using Traffic Server's built-in heuristics.

Code Block
CONFIG proxy.config.http.cache.heuristic_min_lifetime INT 2592000
CONFIG proxy.config.http.cache.heuristic_max_lifetime INT 7776000
CONFIG proxy.config.http.cache.heuristic_lm_factor FLOAT 0.50

RAM And Disk Cache Configuration

The default config for Traffic Server specifies a few things here that can be tuned.

First, I decided to explicitly set my RAM cache settings.

Second, I observed my cache running via the "traffic_top" utility and have set the average object size accordingly.

One should always halve the setting for that configuration, as it allows "headroom" within Traffic Server such that one will never run out of slots in which to store objects.

Third, I've explicitly tuned the average disk fragment setting as well as disabled a feature that for me slows down the cache a bit.

Code Block
CONFIG proxy.config.cache.ram_cache.size INT 64M
CONFIG proxy.config.cache.ram_cache_cutoff INT 8M
CONFIG proxy.config.cache.min_average_object_size INT 64K
CONFIG proxy.config.cache.target_fragment_size INT 262144
CONFIG proxy.config.cache.enable_read_while_writer INT 0

Logging Configuration

The defaults for Traffic Server specify a squid-compatible logfile that's binary in nature.  I prefer to have the file readable so I'm overriding this.

Code Block
CONFIG proxy.config.log.squid_log_is_ascii INT 1

 

 

 The following settings are all located in /usr/local/etc/trafficserver/records.config.
When adding lines, simply organize them in alphabetic sequence.

Step 1 – Configure

You may or may not wish to enable these configuration options.
They essentially make ATS more aggressive in caching than its default configuration would allow.

...

Code Block
CONFIG proxy.config.http.share_server_sessions INT 1

HTTP Connection Timeouts

I decided to use some of Mozilla Firefox's values here, along with some of my own.
It turns out proxy.config.http.transaction_active_timeout_in was essentially shutting down my
streaming Internet Radio connections. I increased that setting from 15 minutes to 12 hours.

...

I had a similar experience tuning Squid in this regard.
This  This setting controls how many connections ATS can make outbound to various Internet servers,
on a per-server basis. The default allows for unlimited connections, and while that may be
useful on a heavily loaded server I find that it actually slows things down a bit.

...