1tcptop(8)                   System Manager's Manual                  tcptop(8)
2
3
4

NAME

6       tcptop - Summarize TCP send/recv throughput by host. Top for TCP.
7

SYNOPSIS

9       tcptop [-h] [-C] [-S] [-p PID] [--cgroupmap MAPPATH]
10                 [--mntnsmap MAPPATH] [interval] [count] [-4 | -6]
11

DESCRIPTION

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

REQUIREMENTS

30       CONFIG_BPF and bcc.
31

OPTIONS

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
53       -4     Trace IPv4 family only.
54
55       -6     Trace IPv6 family only.
56

EXAMPLES

58       Summarize TCP throughput by active sessions, 1 second refresh:
59              # tcptop
60
61       Don't clear the screen (rolling output), and 5 second summaries:
62              # tcptop -C 5
63
64       Trace PID 181 only, and don't clear the screen:
65              # tcptop -Cp 181
66
67       Trace a set of cgroups only (see special_filtering.md from bcc  sources
68       for more details):
69              # tcptop --cgroupmap /sys/fs/bpf/test01
70
71       Trace IPv4 family only:
72              # tcptop -4
73
74       Trace IPv6 family only:
75              # tcptop -6
76

FIELDS

78       loadavg:
79              The contents of /proc/loadavg
80
81       PID    Process ID.
82
83       COMM   Process name.
84
85       LADDR  Local address (IPv4), and TCP port
86
87       RADDR  Remote address (IPv4), and TCP port
88
89       LADDR6 Source address (IPv6), and TCP port
90
91       RADDR6 Destination address (IPv6), and TCP port
92
93       RX_KB  Received Kbytes
94
95       TX_KB  Transmitted Kbytes
96

OVERHEAD

98       This  traces  all send/receives in TCP, high in the TCP/IP stack (close
99       to the application) which are usually called at a lower rate than  per-
100       packet  functions, lowering overhead. It also summarizes data in-kernel
101       to further reduce overhead. These techniques help, but there may  still
102       be  measurable overhead at high send/receive rates, eg, ~13% of one CPU
103       at 100k events/sec.  use funccount to count the kprobes in the tool  to
104       find  out this rate, as the overhead is relative to the rate. Some sam‐
105       ple production servers tested found total TCP event rates of 4k to  15k
106       per  second,  and  the  CPU overhead at these rates ranged from 0.5% to
107       2.0% of one CPU. If your send/receive rate is low (eg, <1000/sec)  then
108       the  overhead  is  expected to be negligible; Test in a lab environment
109       first.
110

SOURCE

112       This is from bcc.
113
114              https://github.com/iovisor/bcc
115
116       Also look in the bcc distribution for a  companion  _examples.txt  file
117       containing example usage, output, and commentary for this tool.
118

OS

120       Linux
121

STABILITY

123       Unstable - in development.
124

AUTHOR

126       Brendan Gregg
127

INSPIRATION

129       top(1) by William LeFebvre
130

SEE ALSO

132       tcpconnect(8), tcpaccept(8)
133
134
135
136USER COMMANDS                     2020-03-08                         tcptop(8)
Impressum