forked from Atoptool/atop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
127 lines (87 loc) · 4.28 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
COPYRIGHT NOTICE
----------------
For all files that are not marked differently:
Copyright Gerlof Langeveld 2007-2021 and licensed under the GPL v2 (or any later version).
DEPENDENCIES
------------
Install the following packages to be able to build atop (package name
can be different depending on the Linux distro):
* zlib-devel or libz-dev or zlib1g-dev
* ncurses-devel or libncurses5-dev/libncursesw5-dev
Install the following packages to be able to execute atop (package name
can be different depending on the Linux distro):
* zlib or zlib1g
* ncurses or libncurses5/libncursesw5
INSTALLING AND USING ATOP
-------------------------
For interactive use, it is sufficient to install ATOP with the command
(as root):
make install (systemd based)
or
make sysvinstall (System V init based)
For automatic logging in compressed binary format, see the
description in the manual-page.
The kernel module 'netatop' can be downloaded and installed separately
from www.atoptool.nl/downloadnetatop.php
This module is optional and can be used to gather network statistics
per process/thread as described in www.atoptool.nl/netatop.php
PROCESS ACCOUNTING WITH PSACCT/ACCT PACKAGE
-------------------------------------------
Preferably, process accounting should be handled by the atopacctd daemon
which is implicitly installed when installing atop. This daemon takes
care that process accounting is only active when at least one atop
process is running. Besides, when process accounting is activated,
atopacctd takes care that the disk utilization is minimal.
See the man page of atopacctd for further details.
When the psacct or acct package is installed in parallel with the
atop package and you want to enable/start the (ps)acct service for
permanent process accounting, take care that the atopacct will be
disabled. The atopacct service and the (ps)acct service mutually
exclude one another.
When the (ps)acct service is enabled, atop automatically uses the
process accounting file that is used by this package.
See also the section PROCESS ACCOUNTING in the man page of atop.
KERNEL ISSUES WITH PROCESS ACCOUNTING
-------------------------------------
Newer upstream kernels (e.g. 4.8 and 4.9) have two issuess
with process accounting:
1) Sometimes process accounting does not work at all¹. Atopacctd tries to
work around this issue, by retrying to initialize process accounting
several times.
2) When using the NETLINK inface, the command TASKSTATS_CMD_GET
consequently returns -EINVAL². Atopacctd needs NETLINK to be able to
be triggered that some process in the system has finished. In this way,
atopacctd can be in a blocking state as long as no processes terminate.
When atopacctd detects that NETLINK fails, it switches into a polling
mode to periodically try if it can read process accounting records as
a workaround. This issue has to do with cpumasks and you can work-around
it by building a kernel that has CONFIG_NR_CPUS configured to exactly
the amount of CPUs (logical CPUs) in the system the kernel runs on. You
can find this kernel option under "Processor type and features" -->
"Maximum number of CPUs".
[1] Bug 190271 - process accounting sometimes does not work
https://bugzilla.kernel.org/show_bug.cgi?id=190271
[2] Bug 190711 - Process accounting: Using the NETLINK interface,
the command TASKSTATS_CMD_GET returns -EINVAL
https://bugzilla.kernel.org/show_bug.cgi?id=190711
Linux kernel mailing list thread:
[REGRESSION] Two issues that prevent process accounting (taskstats) from
working correctly
https://lkml.org/lkml/2016/12/19/182
SERVICE ACTIVATION AFTER INSTALLATION
-------------------------------------
After the package has been installed, be sure that the related services
are activated.
To support handling of terminated processes using process accounting,
enable the atopacct service:
systemctl enable --now atopacct
Notice that this service should not be enabled when the package
psacct or acct (depends on the Linux distribution) has been installed
and enabled. In that case atop uses the daily process accounting file
created via that package.
To support maintaining daily log files to keep track of long-term analysis
information, enable the atop service and the related timer:
systemctl enable --now atop
systemctl enable --now atop-rotate.timer
Gerlof Langeveld
gerlof.langeveld@atoptool.nl