1SPAUSEDD(8) BSD System Manager's Manual SPAUSEDD(8)
2
4 spausedd — Utility to detect and log scheduler pause
5
7 spausedd [-dDfhp] [-m steal_threshold] [-t timeout]
8
10 The spausedd utility is used for detecting and logging scheduler pause.
11 This means, when process should have been scheduled, but it was not. It's
12 also able to use steal time (time spent in other operating systems when
13 running in a virtualized environment) so it is (to some extend) able to
14 detect if problem is on the VM or host side. spausedd is able to read
15 information about steal time ether from kernel or (if compiled in) also
16 use VMGuestLib. Internally spausedd works as following pseudocode:
17
18 repeat:
19 store current monotonic time
20 store current steal time
21 sleep for (timeout / 3)
22 set time_diff to (current monotonic time - stored monotonic time)
23 if time_diff > timeout:
24 display error
25 set steal_time_diff to (current steal time - stored steal time)
26 if (steal_time_diff / time_diff) * 100 > steal_threshold:
27 display steal time error
28
29 spausedd arguments are as follows:
30
31 -d Display debug messages (specify twice to display also trace mes‐
32 sages).
33
34 -D Run on background (daemonize).
35
36 -f Run on foreground (do not demonize - default).
37
38 -h Show help.
39
40 -p Do not set RR scheduler.
41
42 -P Do not move process to root cgroup.
43
44 -m steal_threshold
45 Set steal threshold percent. (default is 10 if kernel information
46 is used and 100 if VMGuestLib is used).
47
48 -t timeout
49 Set timeout value in milliseconds (default 200).
50
51 If spausedd receives a SIGUSR1 signal, the current statistics are show.
52
54 To generate CPU load yes(1) together with chrt(1) is used in following
55 examples:
56
57 chrt -r 99 yes >/dev/null &
58
59 If chrt fails it may help to use cgexec(1) like:
60
61 cgexec -g cpu:/ chrt -r 99 yes >/dev/null &
62
63 First example is physical or virtual machine with 4 CPU threads so yes(1)
64 was executed 4 times. In a while spausedd should start logging messages
65 similar to:
66
67 Mar 20 15:01:54 spausedd: Running main poll loop with maximum
68 timeout 200 and steal threshold 10%
69 Mar 20 15:02:15 spausedd: Not scheduled for 0.2089s (threshold is
70 0.2000s), steal time is 0.0000s (0.00%)
71 Mar 20 15:02:16 spausedd: Not scheduled for 0.2258s (threshold is
72 0.2000s), steal time is 0.0000s (0.00%)
73 ...
74
75 This means that spausedd didn't got time to run for longer time than
76 default timeout. It's also visible that steal time was 0% so spausedd is
77 running ether on physical machine or VM where host machine is not over‐
78 loaded (VM was scheduled on time).
79
80 Second example is a host machine with 2 CPU threads running one VM. VM is
81 running an instance of spausedd. Two instancies of yes(1) was executed on
82 the host machine. After a while spausedd should start logging messages
83 similar to:
84
85 Mar 20 15:08:20 spausedd: Not scheduled for 0.9598s (threshold is
86 0.2000s), steal time is 0.7900s (82.31%)
87 Mar 20 15:08:20 spausedd: Steal time is > 10.0%, this is usually
88 because of overloaded host machine
89 ...
90
91 This means that spausedd didn't got the time to run for almost one sec‐
92 ond. Also because steal time is high, it means that spausedd was not
93 scheduled because VM wasn't scheduled by host machine.
94
96 The spausedd utility exits 0 on success, and >0 if an error occurs.
97
99 The spausedd utility was written by Jan Friesse <jfriesse@redhat.com>.
100
102 - OS is not updating steal time as often as monotonic clock. This means
103 that steal time difference can be (and very often is) bigger than
104 monotonic clock difference, so steal time percentage can be bigger
105 than 100%. It's happening very often for highly overloaded host
106 machine when spausedd is called with small timeout. This problem is
107 even bigger when VMGuestLib is used.
108
109 - VMGuestLib seems to randomly block.
110
111BSD Nov 11, 2020 BSD