Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
CONFIG proxy.config.http.cache.fuzz.min_time INT 0

Step 3 – Optimize

Accept & Execution Threads

The default config for ATS supports as many CPU cores as you have in your machine.
Typically, ATS will configure 1.5 threads per CPU and automatically scale upwards.

I have 4, but discovered over time that using all of them causes problems with iTunes, and World of Warcraft.
In the hopes of avoiding problems like that, I decided to configure my ATS to use two cores where possibleI get a decent performance boost by assigning slightly more threads than ATS would otherwise.

Code Block
CONFIG proxy.config.exec_thread.autoconfig INT 0
CONFIG proxy.config.exec_thread.limit INT 8
CONFIG proxy.config.accept_threads INT 2

HTTP Chunking

The default config for ATS specifies that the proxy itself use data "chunks" of 4KB each.
Being that I'm on a high-speed Internet link at home, I decided to increase this.
I'm currently using a setting of 64KB. If you find yourself annoyed with how long
streaming Internet Radio takes when rebuffering, try setting this to 16KB instead.

...

HTTP Connection Timeouts

I decided to use some of Mozilla Firefox's values here, along with one 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.

Code Block
CONFIG proxy.config.http.keep_alive_no_activity_timeout_in INT 115
CONFIG proxy.config.http.keep_alive_no_activity_timeout_out INT 115
CONFIG proxy.config.http.transaction_no_activity_timeout_in INT 9010
CONFIG proxy.config.http.transaction_no_activity_timeout_out INT 9010
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 3010

HTTP Origin Server Connections

...

As it turns out, my original thoughts on this were a bit misguided.

For my purposes, I first monitored ATS with the command-line tool "traffic_top".  After letting the cache run for quite some time, I discovered the Average Internet Object Size was much larger than I'd guessed.

As it turns out, the "average internet , I decided an "average Internet object" is roughly 32KB 80KB in size, and so we can do the following math:

Average Internet Object Size: 32KB80KB

Directory Entries Required Per Object(headroom): 2
Cache Minimum Average Object Size: 16384  40960 (32768 81920 / 2)

Code Block
CONFIG proxy.config.cache.min_average_object_size INT 16K40K

NOTE: This setting requires clearing the disk cache and restarting ATS to properly take effect.

...

The default config for ATS leaves enables some buffering between ATS and the client.  While I believe some inbound buffering to be useful for HTTP streaming applications such as Internet Radio and YouTube, unfortunately the cache will slowdown overall if these are set too highI eventually decided this simply isn't necessary.

Code Block
CONFIG proxy.config.net.sock_send_buffer_size_in INT 0
CONFIG proxy.config.net.sock_recv_buffer_size_in INT 0
CONFIG proxy.config.net.sock_send_buffer_size_out INT 0
CONFIG proxy.config.net.sock_recv_buffer_size_out INT 128K0

Step 4 - Secure

Maximum Inbound Concurrent Connections

...