TCPInfo Plugin¶
This global plugin logs TCP metrics at various points in the HTTP processing pipeline. The TCP information is retrieved by the getsockopt(2) function using the TCP_INFO option. This is only supported on systems that support the TCP_INFO option, currently Linux and BSD.
Plugin Options¶
The following options may be specified in plugin.config:
--hooks=NAMELIST | |||||||||||||||||||||||||||||||||||||||||||||||
This option specifies when TCP information should be logged. The argument is a comma-separated list of the event names listed below. TCP information will be sampled and logged each time the specified set of events occurs.
| |||||||||||||||||||||||||||||||||||||||||||||||
--log-file=NAME | |||||||||||||||||||||||||||||||||||||||||||||||
This specifies the base name of the file where TCP information should be logged. If this option is not specified, the name tcpinfo is used. Traffic Server will automatically append the .log suffix. | |||||||||||||||||||||||||||||||||||||||||||||||
--log-level=LEVEL | |||||||||||||||||||||||||||||||||||||||||||||||
The log level can be either 1 to log only the round trip time estimate, or 2 to log the complete set of TCP information. The following fields are logged when the log level is 1:
The following fields are logged when the log level is 2:
| |||||||||||||||||||||||||||||||||||||||||||||||
--sample-rate=COUNT | |||||||||||||||||||||||||||||||||||||||||||||||
This is the number of times per 1000 requests that the data will be logged. A pseudo-random number generator is used to determine if a request will be logged. The default value is 1000 and this option is not required to be in the configuration file. To achieve a log rate of 1% you would set this value to 10. |
Examples:¶
This example logs the simple TCP information to tcp-metrics.log at the start of a TCP connection and once for each HTTP transaction thereafter:
tcp_info.so --log-file=tcp-metrics --log-level=1 --hooks=ssn_start,txn_start
The file tcp-metrics.log will contain the following log format:
timestamp event client server rtt
20140414.17h40m14s ssn_start 127.0.0.1 127.0.0.1 4000
20140414.17h40m14s txn_start 127.0.0.1 127.0.0.1 4000
20140414.17h40m16s ssn_start 127.0.0.1 127.0.0.1 4000
20140414.17h40m16s txn_start 127.0.0.1 127.0.0.1 4000
20140414.17h40m16s ssn_start 127.0.0.1 127.0.0.1 4000
20140414.17h40m16s txn_start 127.0.0.1 127.0.0.1 4000