1tcptop(8) System Manager's Manual tcptop(8)
2
3
4
6 tcptop - Summarize TCP send/recv throughput by host. Top for TCP.
7
9 tcptop [-h] [-C] [-S] [-p PID] [--cgroupmap MAPPATH]
10 [--mntnsmap MAPPATH] [interval] [count]
11
13 This is top for TCP sessions.
14
15 This summarizes TCP send/receive Kbytes by host, and prints a summary
16 that refreshes, along other system-wide metrics.
17
18 This uses dynamic tracing of kernel TCP send/receive functions, and
19 will need to be updated to match kernel changes.
20
21 The traced TCP functions are usually called at a lower rate than per-
22 packet functions, and therefore have lower overhead. The traced data is
23 summarized in-kernel using a BPF map to further reduce overhead. At
24 very high TCP event rates, the overhead may still be measurable. See
25 the OVERHEAD section for more details.
26
27 Since this uses BPF, only the root user can use this tool.
28
30 CONFIG_BPF and bcc.
31
33 -h Print USAGE message.
34
35 -C Don't clear the screen.
36
37 -S Don't print the system summary line (load averages).
38
39 -p PID Trace this PID only.
40
41 --cgroupmap MAPPATH
42 Trace cgroups in this BPF map only (filtered in-kernel).
43
44 --mntnsmap MAPPATH
45 Trace mount namespaces in this BPF map only (filtered in-ker‐
46 nel).
47
48 interval
49 Interval between updates, seconds (default 1).
50
51 count Number of interval summaries (default is many).
52
54 Summarize TCP throughput by active sessions, 1 second refresh:
55 # tcptop
56
57 Don't clear the screen (rolling output), and 5 second summaries:
58 # tcptop -C 5
59
60 Trace PID 181 only, and don't clear the screen:
61 # tcptop -Cp 181
62
63 Trace a set of cgroups only (see special_filtering.md from bcc sources
64 for more details):
65 # tcptop --cgroupmap /sys/fs/bpf/test01
66
68 loadavg:
69 The contents of /proc/loadavg
70
71 PID Process ID.
72
73 COMM Process name.
74
75 LADDR Local address (IPv4), and TCP port
76
77 RADDR Remote address (IPv4), and TCP port
78
79 LADDR6 Source address (IPv6), and TCP port
80
81 RADDR6 Destination address (IPv6), and TCP port
82
83 RX_KB Received Kbytes
84
85 TX_KB Transmitted Kbytes
86
88 This traces all send/receives in TCP, high in the TCP/IP stack (close
89 to the application) which are usually called at a lower rate than per-
90 packet functions, lowering overhead. It also summarizes data in-kernel
91 to further reduce overhead. These techniques help, but there may still
92 be measurable overhead at high send/receive rates, eg, ~13% of one CPU
93 at 100k events/sec. use funccount to count the kprobes in the tool to
94 find out this rate, as the overhead is relative to the rate. Some sam‐
95 ple production servers tested found total TCP event rates of 4k to 15k
96 per second, and the CPU overhead at these rates ranged from 0.5% to
97 2.0% of one CPU. If your send/receive rate is low (eg, <1000/sec) then
98 the overhead is expected to be negligible; Test in a lab environment
99 first.
100
102 This is from bcc.
103
104 https://github.com/iovisor/bcc
105
106 Also look in the bcc distribution for a companion _examples.txt file
107 containing example usage, output, and commentary for this tool.
108
110 Linux
111
113 Unstable - in development.
114
116 Brendan Gregg
117
119 top(1) by William LeFebvre
120
122 tcpconnect(8), tcpaccept(8)
123
124
125
126USER COMMANDS 2020-03-08 tcptop(8)