tcpconnlat(8)
β¨ tcpconnlat(8) β¨
System Manager's Manual π
this is the page for tcpconnlat, and it's giving main character energy π
π«Ά NAME
tcpconnlat - Trace TCP active connection latency. Uses Linux eBPF/bcc. π¦
π SYNOPSIS
tcpconnlat [-h] [-t] [-p PID] [-L] [-4 | -6] [-v] [min_ms]
π DESCRIPTION
okay so tcpconnlat traces active TCP connections (think connect() syscalls) and shows the latency for each one, as measured locally. That's the time from when the SYN gets sent to when the response packet comes back πΈ It's a super useful performance metric, because it usually covers kernel TCP/IP processing plus the network round trip. It does not count how long your app spends running, so don't blame the app for network stuff π
Every connection attempt gets traced, even the ones that ultimately fail (an RST packet coming back in response) β¨
Lowkey, the tool works through kernel dynamic tracing of TCP/IP functions, so it'll need updating whenever those functions change. It should switch to static tracepoints in the future, once they're available π§
π Since this uses BPF, only the root user can use this tool. No exceptions, bestie.
π REQUIREMENTS
You'll need CONFIG_BPF and bcc π₯
β¨ OPTIONS β¨
-hβ Prints the usage message π-tβ Adds a timestamp column π°οΈ-p PIDβ Only traces this process ID, filtered in-kernel π―-Lβ Adds an LPORT column π-4β IPv4 family only πΈ-6β IPv6 family only π¦-vβ Prints the resulting BPF program, for debugging π- min_ms β The minimum duration to trace, in milliseconds β
π EXAMPLES
Trace all active TCP connections and show connection latency (SYN->response round trip):
# tcpconnlat
Include timestamps:
# tcpconnlat -t
Trace PID 181 only:
# tcpconnlat -p 181
Trace connects and include LPORT:
# tcpconnlat -L
Trace IPv4 family only:
# tcpconnlat -4
Trace IPv6 family only:
# tcpconnlat -6
Trace connects with latency longer than 10 ms:
# tcpconnlat 10
Print the BPF program:
# tcpconnlat -v
π₯ FIELDS
TIME(s)β When the response packet showed up, in seconds β°PIDβ The process ID that started the connection π§COMMβ The process name that started the connection πIPβ The IP address family (4 or 6) πSADDRβ Source IP address π«ΆDADDRβ Destination IP address πLPORTβ Source port π¦DPORTβ Destination port πΈLAT(ms)β The time from when a TCP connect was issued (measured in-kernel) until a response packet came back for that connection. That response can be SYN,ACK, RST, etc. This spans kernel-to-kernel latency, so it includes kernel TCP/IP processing and the network round trip in between. It usually does not include time the application spends handling the new connection β¨
π OVERHEAD
This traces the kernel tcp_v[46]_connect functions and prints output for each event. Since the rate is generally expected to be low (< 1000/s), the overhead should be negligible π
But if you've got an app making a high rate of connect()s, like a proxy server, test and understand the overhead before using it π
π SOURCE
This is from bcc π«Ά
https://github.com/iovisor/bcc
Also check out the bcc distribution for a companion _examples.txt file. It has example usage, output, and commentary for this tool π
π₯οΈ OS
Linux π§
π§ STABILITY
Unstable, still in development π
π AUTHOR
Brendan Gregg π
π¦ SEE ALSO
tcpconnect(8), tcpaccept(8), funccount(8), tcpdump(8) π
Okay bestie that's the whole tea βπ This page came from the USER COMMANDS set, dated 2016-02-19, and it's all about tcpconnlat(8). Stay iconic, and don't forget your root privileges πβ¨
π¦ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms