-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaq.html
1123 lines (1117 loc) · 47.2 KB
/
faq.html
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body style="font-family: Verdana,sans-serif; color: rgb(255, 255, 255); background-color: rgb(0, 0, 110);"
vlink="#33cc00" link="#33ff33" alink="#66ff99">
<style>
pre {
font-size: 120%;
}
code {
color: #fd6614;
font-size: 120%;
}
</style>
<table style="width: 100%; height: 95px;" cellspacing="0" cellpadding="2" border="0">
<tbody>
<tr>
<td style="vertical-align: middle; text-align: left; width: 80%; background-repeat: repeat-x;" class="bandeau">
<img style="width: 375px; height: 157px;" alt="bandeau1" src="/bandeau11.jpg">
<img style="width: 333px; height: 156px;" alt="bandeau2" src="/bandeau22.jpg">
</td>
<td style="vertical-align: bottom; text-align: center;">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" value="_s-xclick" type="hidden">
<input name="hosted_button_id" value="45U6F9R73ESFQ" type="hidden">
<input src="https://www.paypalobjects.com/en_US/FR/i/btn/btn_donateCC_LG.gif"
name="submit" alt="PayPal - The safer, easier way to pay online!"
type="image">
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif"
width="1" height="1" border="0">
</form>
</td>
</tr>
<tr>
<td id="menuhaut" colspan="2" rowspan="1">
<hr style="height: 12px; width: 100%;">
<div style="text-align: center; color: rgb(51, 255, 51);">
<font size="+1">
<a href="/index.html">News</a>
|
<a href="/features.html">Features</a>
|
<a href="/dtd_xsd.html">DTD/XSD</a>
|
<a href="https://github.com/sysstat/sysstat" target="_blank">GitHub</a>
|
<a href="/versions.html">Download</a>
|
<a href="/faq.html">FAQ</a>
|
<a href="mailto:sysstat%20%3Cat%3E%20orange.fr">Contact</a>
</font>
</div>
</td>
</tr>
</tbody>
</table>
<br><br>
<span style="text-align: center; color: rgb(255, 255, 0);">
<h1>FAQ</h1>
</span>
<hr style="width: 100%; height: 2px;">
<h3>This is sysstat's Frequently Asked Questions!</h3>
Be sure to read this carefully before asking for help...<br>
If you don't find the solution to your problem here then
send me an email (please remember to include the
version numbers of sysstat and of your kernel).<br>
<br>
<span style="color: rgb(255, 255, 0);">
<p style="font-weight: bold;"><a href="#General">1. GENERAL QUESTIONS</a>
</p>
<a href="#General-1.1">1.1.</a> When I compile sysstat,
it fails with the following message: "make: msgfmt: Command not found". <br>
<a href="#General-1.2">1.2.</a> When I try to compile
sysstat, it fails and says it cannot find some include files. <br>
<a href="#General-1.3">1.3.</a> I don't understand why
sysstat displays the time sometimes as HH:MM:SS and sometimes as HH:MM:SS AM/PM...<br>
<a href="#General-1.4">1.4.</a> What are the units
actually used by sysstat commands?<br>
<a href="#General-1.5">1.5.</a> Does sysstat still use odd/even numbers for
development/stable versions?<br>
<br>
<p style="font-weight: bold;"><a href="#sar">2. QUESTIONS RELATING TO SAR/SADC/SADF</a>
</p>
<a href="#sar-2.1">2.1.</a> The sar command complains
with the following message: "Invalid system activity file: ...". <br>
<a href="#sar-2.2">2.2.</a> The sar command complains
with the following message: "Cannot append data to that file [...]". <br>
<a href="#sar-2.3">2.3.</a> The sar command complains
with the following message: "Invalid data format" / "Inconsistent input data". <br>
<a href="#sar-2.4">2.4.</a> I get the following error
message when I try to run sar: "Cannot open /var/log/sa/sa30: No such file or directory". <br>
<a href="#sar-2.5">2.5.</a> Are sar daily data files
fully compatible with Sun Solaris format sar files? <br>
<a href="#sar-2.6">2.6.</a> The "Average:" results from
the sar command are just rubbish... <br>
<a href="#sar-2.7">2.7.</a> My database (e.g. MySQL)
doesn't appear to understand the time zone displayed by 'sadf -d'... <br>
<a href="#sar-2.8">2.8.</a> I tried to use options -s
and -e with sadf. Unfortunately, I have nothing displayed at all / the output
doesn't match that of sar. <br>
<a href="#sar-2.9">2.9.</a> I cannot see all my disks
when I use the sar -d command... <br>
<a href="#sar-2.10">2.10.</a> Do you know a tool which
can graphically plot the data collected by sar? <br>
<a href="#sar-2.11">2.11.</a> When I launch sadc, I get
the error message: "flock: Resource temporarily unavailable". <br>
<a href="#sar-2.12">2.12.</a> How should I run sysstat / sar so
that I get a reading for 00:00:00? <br>
<a href="#sar-2.13">2.13.</a> The sar command complains
with the following message: "Requested activities not available in file [...]". <br>
<a href="#sar-2.14">2.14.</a> Does sar need a lot of resources to run? <br>
<a href="#sar-2.15">2.15.</a> Are the measurements
gathered by sadc cumulative or instantaneous? <br>
<a href="#sar-2.16">2.16.</a> Some fields are always
displayed as 0.00 when I use the sar -d command. <br>
<a href="#sar-2.17">2.17.</a> The sar command complains
with the following message: "Requested activities not available".<br>
<a href="#sar-2.18">2.18.</a> How can I keep sar data
for more than one month?<br>
<a href="#sar-2.19">2.19.</a> How can I load sar data
into an Oracle database for performance analysis and capacity planning?<br>
<a href="#sar-2.20">2.20.</a> The sar command displays some weird CPU values...<br>
<a href="#sar-2.21">2.21.</a> What happened to sar's options -h, -H, -x and -X?<br>
<a href="#sar-2.22">2.22.</a> What is the exact meaning
of the <count> parameter for sar and sadc?<br>
<a href="#sar-2.23">2.23.</a> Why doesn't sar deal with
sub-second sampling/monitoring?<br>
<a href="#sar-2.24">2.24.</a> Is it possible to make
sadc save only some specific activities in my binary daily data files?<br>
<a href="#sar-2.25">2.25.</a> The sar and/or sadf command
complain(s) with the following message: "End of system activity file unexpected"<br>
<br>
<p style="font-weight: bold;"><a href="#iostat">3. QUESTIONS RELATING TO IOSTAT</a>
</p>
<a href="#iostat-3.1">3.1.</a> I can't see all my disks when I use the iostat command... <br>
<a href="#iostat-3.2">3.2.</a> iostat -x doesn't report disk I/O statistics... <br>
<a href="#iostat-3.3">3.3.</a> Why can't iostat display
extended statistics for partitions with 2.6.x kernels? <br>
<a href="#iostat-3.4">3.4.</a> I don't understand the
output of iostat. It doesn't match what I expect it to be... <br>
<a href="#iostat-3.5">3.5.</a> Why values displayed by
iostat are so different in the first report from those displayed in subsequent ones? <br>
<a href="#iostat-3.6">3.6.</a> iostat -x displays huge numbers for some fields... <br>
<br>
<p style="font-weight: bold;"><a href="#pidstat">4. QUESTIONS RELATING TO PIDSTAT</a>
</p>
<a href="#pidstat-4.1">4.1.</a> pidstat -d doesn't report task I/O statistics...<br>
<a href="#pidstat-4.2">4.2.</a> The pidstat command
complains with the following message: "Requested activities not available".<br>
<a href="#pidstat-4.3">4.3.</a> pidstat doesn't display
statistics for process (task) xyz...<br>
<a href="#pidstat-4.4">4.4.</a> I noticed that the total
CPU utilization for threads running on an individual CPU can exceed 100%...<br>
<br>
<hr style="width: 100%; height: 2px;"></div>
</span>
<p style="font-weight: bold; text-decoration: underline;">
<a name="General"></a>1. GENERAL QUESTIONS
</p>
<span style="color: rgb(255, 255, 0);">
<a name="General-1.1"></a>
1.1. When I compile sysstat, it fails with the following message:
<pre>
make: msgfmt: Command not found
make: ***[locales] Error 127
</pre>
</span>
The <code>msgfmt</code> command belongs to the GNU <code>gettext</code> package.
If you don't have it on your system, just configure
sysstat with NLS disabled like this:<br>
<pre style="color: rgb(140, 200, 240);">
$ ./configure --disable-nls
</pre>
or answer 'y' (for "yes") to the question
<pre style="color: rgb(140, 200, 240);">
Disable National Language Support (NLS)? (y/n) [--disable-nls]
</pre>
if you use the Interactive Configuration script
(<code>iconfig</code>), then compile sysstat as usual (<code>make ; make install</code>).
<br>
Please read the <code>README-nls</code> file included in sysstat
source package to learn some more about National Language Support.
<br>
Note: With older versions of sysstat that don't have
autoconf support (up to v7.0.4), you have instead to
answer 'n' (for "no") to the question
<pre style="color: rgb(140, 200, 240);">
Enable National Language Support (NLS)? [y]
</pre>
during config stage (<code>make config</code>).
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="General-1.2"></a>
1.2. When I try to compile sysstat, it fails and says it cannot find some include files:<br>
<pre>
In file included from /usr/include/bits/errno.h:25,
from /usr/include/errno.h:36,
from common.c:26:
/usr/include/linux/errno.h:4: asm/errno.h: No such file or directory
<SNIP>
common.c: In function `get_kb_shift':
common.c:180: `PAGE_SIZE' undeclared (first use in this function)
common.c:178: warning: `size' might be used uninitialized in this function
make: *** [common.o] Error 1
</pre>
</span>
Make sure that you have the Linux kernel sources
installed in <code>/usr/src/linux</code>. Also make sure that the
symbolic link exists in the <code>/usr/src/linux/include</code>
directory and points to the right architecture, e.g.:
<br>
<pre style="color: rgb(140, 200, 240);">
# ll /usr/src/linux/include/asm
lrwxrwxrwx 1 root root 8 May 5 18:31 /usr/src/linux/include/asm -> asm-i386
</pre>
In fact, only the Linux kernel headers should be
necessary to be able to compile sysstat.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="General-1.3"></a>
1.3. I don't understand why sysstat displays the time sometimes as HH:MM:SS
and sometimes as HH:MM:SS AM/PM...
</span><br><br>
The time format used by sysstat tools depends on the
locale of your system. The locale is defined by several
environment variables, among which the <code>LANG</code> variable is
perhaps the most widely used. See the following example:
<br>
<pre style="color: rgb(140, 200, 240);">
$ export LANG=en_US
$ sar
Linux 2.4.9 (brooks.seringas.fr) 07/20/04
04:32:11 PM LINUX RESTART
05:00:00 PM CPU %user %nice %system %iowait %idle
05:10:00 PM all 0.24 0.00 89.64 0.00 10.12
Average: all 0.24 0.00 89.64 0.00 10.12
$ export LANG=fr_FR
$ sar
Linux 2.4.9 (brooks.seringas.fr) 20.07.2004
16:32:11 LINUX RESTART
17:00:00 CPU %user %nice %system %iowait %idle
17:10:00 all 0,24 0,00 89,64 0,00 10,12
Moyenne: all 0,24 0,00 89,64 0,00 10,12
</pre>
As you can notice, the time format but also the date,
the decimal point, and even some words (like "Average")
have changed according to the specified locale.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="General-1.4"></a>
1.4. What are the units actually used by sysstat commands?
</span><br><br>
Although sysstat commands use the following
abbreviations: kB, MB, etc. as part of the metrics names
(e.g. <code>kB_read/s</code>, <code>wkB/s</code>, or even sometimes with a lower
'b': <code>kbmemfree</code>, <code>kbavail</code>...), we always actually refer
to kibibytes (kiB), mebibytes (MiB),...<br>
A kibibyte is equal to 1024 bytes, and a mebibyte is
equal to 1024 kibibytes.<br>
Metrics names have been defined many years ago. We don't
modify them to avoid breaking third-party programs
parsing sysstat commands' output.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="General-1.5"></a>
1.5. Does sysstat still use odd/even numbers for development/stable versions?
</span><br><br>
No, starting with sysstat versions 12.7.x, sysstat no longer uses odd and even version
numbers to identify development and stable series. The latest sysstat release should
always be considered as a stable version that can be used for distribution packaging.
<br>
<br>
<br>
<hr style="width: 100%; height: 2px;"></div>
<p style="font-weight: bold; text-decoration: underline;">
<a name="sar"></a>2. QUESTIONS RELATING TO SAR/SADC/SADF
</p>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.1"></a>
2.1. The sar command complains with the following message:<br>
<pre>
Invalid system activity file: ...
</pre>
</span>
You are trying to use a file which is not a system
activity file, or whose format is no longer compatible
with that of files created by current version of <code>sar</code>.<br>
If you were trying to use the standard system activity
files located in the <code>/var/log/sa</code> directory then the
solution is easy: Just log in as root and remove by hand
all the files located in the <code>/var/log/sa</code> directory:<br>
<pre style="color: rgb(140, 200, 240);">
# rm /var/log/sa/sa??
</pre>
If you are using sysstat 11.1.1 and later, you can also
use the <code>sadf</code> command to convert an old system activity
binary datafile (version 9.1.6 and later) to current
up-to-date format. Use the following syntax:
<pre style="color: rgb(140, 200, 240);">
$ sadf -c old_datafile > new_datafile
</pre>
Note: Starting with sysstat version 8.1.1 and later, it
is possible to know which version of <code>sar</code> or <code>sadc</code> has
been used to create a data file. Just enter the
following command:
<pre style="color: rgb(140, 200, 240);">
$ sadf -H /your/datafile | grep sysstat
File created using sar/sadc from sysstat version 8.1.7
</pre>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.2"></a>
2.2. The sar command complains with the following message:<br>
<pre>
Cannot append data to that file [...]
</pre>
</span>
The internal structure of the data file does not allow
<code>sar</code> to append data to it. The data file may come from
another machine, or the components of the current box,
such as the number of processors, may have changed. Use
another data file, or delete the current daily data file, and try again.<br>
With sysstat version 10.1.3 and later, it is now
possible to append data to a data file even if the
number of processors has changed. But first, you have to
make the data file aware of this change by inserting a
restart mark (this is typically done when sadc is called
at system restart). You can then append data to the data file as usual.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.3"></a>
2.3. The sar command complains with the following message:<br>
<pre>
Invalid data format
</pre>
or:<br>
<pre>
Inconsistent input data
</pre>
</span>
This error message means that <code>sadc</code> (the system activity
data collector that <code>sar</code> is using) is not consistent with
the <code>sar</code> command. In most cases this is because the sar
and <code>sadc</code> commands do not belong to the same release of
the sysstat package. Remember that <code>sar</code> may search for
<code>sadc</code> in predefined directories (<code>/usr/local/lib/sa</code>,
<code>/usr/lib/sa</code>, ...) before looking in the current
directory! With sysstat version 11.1.5 and later, enter
<code>sar --sadc</code> to determine which data collector is
called by <code>sar</code>.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.4"></a>
2.4. I get the following error message when I try to run sar:<br>
<pre>
Cannot open /var/log/sa/sa30: No such file or directory
</pre>
</span>
Please read the <code>sar</code>(1) manual page! Daily data files are
created by default in the <code>/var/log/sa</code> directory using
the data collector (<code>sadc</code>) or using option <code>-o</code>
with <code>sar</code>.
Once they are created, <code>sar</code> can display statistics saved in those files.<br>
But <code>sar</code> can also display statistics collected "on the
fly": Just enter the proper options on the command line
to indicate which statistics are to be displayed, and
also specify <var>interval</var> and <var>count</var> numbers.<br>
E.g.:
<br><br>
<font style="font-family: Courier New,Courier,monospace; color: rgb(140, 200, 240);">
$ sar 2 5
</font>
--> will report CPU utilization every two seconds, five times.<br>
<font style="font-family: Courier New,Courier,monospace; color: rgb(140, 200, 240);">
$ sar -n DEV 3
</font>
--> will report network device utilization every 3 seconds, in an infinite loop.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.5"></a>
2.5. Are sar daily data files fully compatible with Sun Solaris format sar files?
</span><br><br>
No, the format of the binary data files created by
sysstat's <code>sar</code> command is not compatible with formats
from other Unixes, because it contains data which are
closely linked to Linux. For the same reason, sysstat
cannot work on platforms other than Linux...
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.6"></a>
2.6. The "Average:" results from the sar command are just rubbish...
<br>
E.g.:<br>
<pre>
11:00:00 AM CPU %user %nice %system %idle
11:10:00 AM all 0.54 0.00 0.89 98.57
11:20:01 AM all 3.02 8.05 22.85 66.08
11:30:01 AM all 8.15 0.00 2.31 89.54
11:40:01 AM all 8.03 0.00 2.42 89.55
11:50:01 AM all 16.04 0.00 2.81 81.16
12:00:00 PM all 21.11 0.00 3.23 75.66
03:40:01 PM all 100.01 100.01 100.01 0.00
04:40:00 PM all 100.00 0.00 100.00 0.00
04:50:00 PM all 5.87 0.00 1.26 92.87
05:00:00 PM all 4.70 0.00 1.48 93.82
05:10:00 PM all 4.93 0.00 1.29 93.78
Average: all 100.22 100.20 100.13 0.00
</pre>
</span>
Your <code>sar</code> command was not installed properly. Whenever
your computer is restarted (as it is the case here
between 12:00:00 PM and 03:40:01 PM), the 'sysstat'
shell script must be called by the system, so that the
<code>LINUX RESTART</code> message can be inserted into the daily
data file, indicating that the relevant kernel counters
have been reinitialized...<br>
You can install the 'sysstat' script by hand in the
relevant startup directory, or you can ask sysstat to do
it for you during configuration stage by entering:
<br>
<pre style="color: rgb(140, 200, 240);">
$ ./configure --enable-install-cron
</pre>
Or you can answer 'y' to the question
<pre style="color: rgb(140, 200, 240);">
Set crontab to start sar automatically? (y/n) [--enable-install-cron]
</pre>
if you use the Interactive Configuration script
(<code>iconfig</code>). Then compile sysstat as usual and run
<code>make install</code> as the last stage.<br>
Note: With older versions of sysstat that don't have
autoconf support (up to v7.0.4), you have to answer 'y'
to the question
<pre style="color: rgb(140, 200, 240);">
Set crontab to start sar automatically
</pre>
during config stage (<code>make config</code>).
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.7"></a>
2.7. My database (e.g. MySQL) doesn't appear to understand the time zone displayed
by 'sadf -d'...
</span><br><br>
The format includes the timezone detail in the output.
This is to make sure it is communicated clearly that UTC
is how the data is always converted and printed.
Moreover we don't depend on the <var>TZ</var> environment variable
and we don't have some data converted to a different
timezone for any reason, known or unknown. When you deal
with raw accounting data you always want it in UTC. Of
course, you want it to all be the same when loading into
a database. If your database can't deal with timezones,
you should write a short script to strip the "UTC"
characters from the data being loaded into the database.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.8"></a>
2.8. I tried to use options -s and -e with sadf. Unfortunately, I have nothing
displayed at all / the output doesn't match that of sar.
</span><br><br>
The way how options <code>-s</code> and <code>-e</code> are interpreted has
changed with sysstat's versions.<br>
First if you don't have any data displayed by <code>sadf</code>, this
is because no data belong to the specified time
interval! Up to sysstat version 12.1.4, the time
specified with options <code>-s</code> and <code>-e</code> was always considered
as being given in local time to be consistent with <code>sar</code>'s
default output. Yet <code>sadf</code> displays its timestamps in UTC
(Coordinated Universal Time) by default (and in local
time with option <code>-T</code>). This could lead to some
misunderstandings, as if <code>sadf</code>'s options <code>-s</code>
and <code>-e</code> didn't
work properly. So with sysstat version 12.1.5, the time
specified with options <code>-s</code> and <code>-e</code> is now consistent with
the timestamps displayed by <code>sadf</code> (either in UTC by
default or in local time with option <code>-T</code>), even if the
output doesn't match that of <code>sar</code>.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.9"></a>
2.9. I cannot see all my disks when I use the sar -d command...
</span><br><br>
See question 3.1 below.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.10"></a>
2.10. Do you know a tool which can graphically plot the data collected by sar?
</span><br><br>
You can now draw graphs with sysstat's standard tools!
SVG (Scalable Vector Graphics) is a new output format
that has been added to <code>sadf</code> in sysstat version 11.3.1.
Read <code>sadf</code>(1) manual page to learn some more about this new format.<br>
There are other tools lying around on the internet that
you can use to draw some graphs. I haven't tested all of
them and there must still be some way for
improvement... First, some of them are included in
the sysstat package although they are no longer
maintained: <code>isag</code> (a Perl script) or <code>sargraph</code> (a shell script).<br>
You can also find: <code>kSar</code> (a Java application capable of
visualizing a <code>sar</code> file with static graphs), <code>sarjitsu</code> (a
more sophisticated application producing dynamic
visualizations based on Grafana), <code>sarvant</code>, <code>sar2gp</code>,
<code>loadgraph</code>, <code>SysStat Charts</code>, <code>sarplot</code>...<br>
<a href="http://haroon.sis.utoronto.ca/rrd/scripts/" target="_blank">rrd.cgi</a>
is a perl front-end for rrdtool and can be used to make some graphs (see a demo
<a href="http://haroon.sis.utoronto.ca/perl/rrd.cgi/sar_stats/" target="_blank">here</a>).<br>
<a href="https://github.com/desbma/sysstat_mail_report" target="_blank">sysstat_mail_report</a>
is a script that automatically generates and sends an email report every day/week/month
with graphs generated from sysstat data.<br>
I've also heard of commercial tools which use sysstat: <code>PerfMan</code> comes to mind, among others.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.11"></a>
2.11. When I launch sadc, I get the error message:<br>
<pre>
flock: Resource temporarily unavailable
</pre>
</span>
You are launching <code>sadc</code> using <code>-L</code> option. With this
option, <code>sadc</code> tries to get an exclusive lock on the
output file. The above error message indicates that
another <code>sadc</code> process was running and had already locked
the same output file. Stop all <code>sadc</code> instances and try again.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.12"></a>
2.12. I have sysstat setup to run via cron:<br>
<pre>
0 * * * * /usr/local/lib/sa/sa1 600 6
</pre>
so that I get an activity report every 10 minutes. When I use sar to
get my output, there is no reading for 00:00:00. This
means that at midnight everynight there is a spike, or
dip, in the graphs. How should I run sysstat / sar so
that I get a reading for 00:00:00?
</span><br><br>
Sysstat does get its data at midnight, but two data
samples are needed to display the values.<br>
When there is a "file rotation" (beginning of a new
day), <code>sadc</code> writes its data at the end of the previous
daily data file (<code>/var/log/sa/sa<DD></code>) <b>and</b> at the
beginning of the new one (<code>/var/log/sa/sa<DD+1></code>).
Please note that '-' must be used to specify the output
file for <code>sadc</code> to be able to detect such a file rotation.
So a crontab like the following one should enable you to
get the data for midnight at the end of each daily data file:<br>
<pre style="color: rgb(140, 200, 240);">
# Activity reports every 10 minutes from 01:00:00 to 22:50:00
0 1-22 * * * /usr/local/lib/sa/sa1 600 6
# Activity reports every 10 minutes from 23:00:00 to 00:00:00
# Reporting until 00:00:00 ensures that a file rotation will be detected
# by sadc
0 23 * * * /usr/local/lib/sa/sa1 600 7
# Activity reports every 10 minutes from 00:10:00 to 00:50:00
10 0 * * * /usr/local/lib/sa/sa1 600 5
</pre>
Another possible crontab would be:<br>
<pre style="color: rgb(140, 200, 240);">
*/10 1-22 * * * /usr/lib/sa/sa1 1 1
0,10,20,30,40 23 * * * /usr/lib/sa/sa1 1 1
50 23 * * * /usr/lib/sa/sa1 600 2
10,20,30,40,50 0 * * * /usr/lib/sa/sa1 1 1
</pre>
Things are much easier with recent sysstat versions
(12.5.1 and later): You simply have to run <code>sa1</code> with its
option <code>--rotate</code> shortly after midnight to add a
statistics record to the system activity daily data file
of the previous day. So your full crontab could be:<br>
<pre style="color: rgb(140, 200, 240);">
# Rotate file at midnight
0 0 * * * /usr/lib/sa/sa1 --rotate
# Run system activity accounting tool every 10 minutes
0,10,20,30,40,50 * * * * /usr/lib/sa/sa1 1 1
# Generate a text summary of previous day process accounting at 00:07
7 0 * * * /usr/lib/sa/sa2 -A
</pre>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.13"></a>
2.13. The sar command complains with the following message:<br>
<pre>
Requested activities not available in file [...]
</pre>
</span>
This error message means that you are trying to extract
non-existent activities from the data file. Usually <code>sadc</code>
reads all the available activities from the system and
stores them in the data file. However, to prevent data
files from taking too much space on disk, some
activities must be explicitly set on the command line to
be read by <code>sadc</code>. To tell <code>sadc</code> that an optional activity
should be collected, use switch <code>-S</code> followed by the
keyword corresponding to that activity (see <code>sadc</code>(8)
manual page). As of this writing, optional activities
are: interrupts, disks, SNMP, IPv6 and power management statistics.<br>
IMPORTANT NOTES:<br>
1) The list of activities that are saved in a file can
no longer be modified once the file has been created. So
it is important to use the proper options the first time
sadc is called (whether via a crontab, a script like
<code>sa1</code>(8) or even the script used to insert a RESTART
message when the machine is rebooted).<br>
2) With versions of sysstat older than 8.1.3, multiple
switches (eg. <code>-I</code> and <code>-d</code>) had to be
used with <code>sadc</code> to
indicate which activities had to be collected. Other
activities could not be saved into a file at all even if
you specified the relevant options on the command line.
Process statistics (<code>-x</code> and <code>-X</code> options in old
sysstat versions) were such activities.<br>
3) If the <code>sar</code> command complains with the error message:
<pre style="color: rgb(140, 200, 240);">
Requested activities not available
</pre>
(without mentioning
"in file"), it means that you are trying to display
activities that the kernel itself is unable to provide
(please see question 2.17 below).
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.14"></a>
2.14. Does sar need a lot of resources to run?
</span><br><br>
No, <code>sar</code> doesn't need a lot of CPU to run, nor does it
make your system slow, contrary to what some people
think. In the first place, it only runs every ten
minutes by default. Secondly, when it does run, it is
over and done very quickly. Try:<br>
<pre style="color: rgb(140, 200, 240);">
$ time /usr/lib/sa/sa1
</pre>
to verify that for yourself. Nor do you have to be
concerned about using up all your disk space. <code>sar</code> will
use a few hundred kilobytes for a whole day's worth of
data, and it normally only stores one week worth (this
can be configured via the <var>HISTORY</var> variable in the
<code>/etc/sysconfig/sysstat</code> file). It is entirely self
limiting. Moreover, you can ask <code>sar</code> to compress its
datafiles older than a certain number of days: see the
<var>COMPRESSAFTER</var> parameter in the <code>/etc/sysconfig/sysstat</code>
configuration file.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.15"></a>
2.15. Are the measurements gathered by sadc cumulative or instantaneous values?
</span><br><br>
Each counter maintained by the kernel is cumulative
since system boot. As a consequence the measurements
gathered by <code>sadc</code> are cumulative values. Moreover all
per-second statistics displayed by <code>sar</code> are average
values on the given time interval. So the value for
counter foo at time T is calculated as:<br>
foo/s = [foo(T) - foo(T-dt)] / dt<br>
where dt is the interval given on the command line.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.16"></a>
2.16. Some fields are always displayed as 0.00 when I use the sar -d command.
</span><br><br>
See question 3.2 below.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.17"></a>
2.17. The sar command complains with the following message:<br>
<pre>
Requested activities not available
</pre>
</span>
This error message means that you are trying to display
activities that the kernel itself is unable to provide.<br>
When this error message is displayed while trying to
save the data into an existing file (<code>sar -o datafile
...</code>), this may also be because the target file cannot
accept the requested activities. In this case, just try
to use another file or create a new one. See also question 2.13 above.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.18"></a>
2.18. How can I keep sar data for more than one month?
</span><br><br>
By default <code>sar</code> saves its data in the standard system
activity data file, the <code>/var/log/sa/saDD</code> file, where DD
is the current day in the month. To prevent <code>sar</code> from
overwriting any existing files, just set the variable
<var>HISTORY</var> in <code>/etc/sysconfig/sysstat</code> to the number of days
during which data must be kept. When this variable has a
value greater than 28, <code>sa1</code> script uses a month-by-month
directory structure; datafiles are named <code>YYYYMM/saDD</code> and
the script maintains links to these datafiles to mimic
the standard sar datafile structure.<br>
However please note that pre-existing datafiles will be
deleted as links will be created and replace them.<br>
Beginning with sysstat version 11.0.0, this tree of
directories is no longer created. When <var>HISTORY</var> has a
value greater than 28, <code>sa1</code> now calls
<code>sadc</code> with option <code>-D</code>
set, telling it to use <code>saYYYYMMDD</code> instead of <code>saDD</code> as the
name for the standard system activity daily data files,
where YYYY stands for the current year, MM for the
current month and DD for the current day. All these
files are saved in the same directory (<code>/var/log/sa</code> by default).
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.19"></a>
2.19. How can I load sar data into an Oracle database for
performance analysis and capacity planning?
</span><br><br>
The simplest way for that is to use <code>sadf</code> (a command
included in sysstat package) with its option <code>-d</code>. It
displays <code>sar</code> data in a format that can easily be
ingested by a relational database system (fields are
separated by a semicolon). It should then be easy for a
tool like SQL*Loader to load the data into the Oracle database.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.20"></a>
2.20. The sar command displays some weird CPU values...<br>
E.g.:<br>
<pre>
10:50:01 AM CPU %user %nice %system %iowait %idle
11:00:01 AM all 90.90 0.00 5.17 3.93 0.00
11:00:01 AM 0 39.40 0.00 2.37 2.07 56.17
11:00:01 AM 1 29.71 0.00 1.73 1.17 67.39
11:00:01 AM 2 42.69 0.00 2.34 1.11 53.85
11:00:01 AM 3 26.24 0.00 1.41 1.61 70.74
...
</pre>
</span>
Sysstat may have met an overflow condition while reading
CPU usage from your <code>/proc/stat</code> file. This condition is
all the more likely to happen as your machine uptime is
high and/or there are many processors. Sysstat up to
version 5.0.6 uses 32-bit integer variables to store CPU
usage. Then, beginning with version 5.1.1, sysstat has
shifted to 64-bit variables, which has fixed the
problem. So try to upgrade your version of sysstat to
the latest stable release and check that the problem has gone.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.21"></a>
2.21. What happened to sar's options -h, -H, -x and -X?
</span><br><br>
These old options have been removed from <code>sar</code> because new
commands have been made available. You should now use
the <code>sadf</code> command instead of <code>sar -h</code> or <code>sar -H</code>, and the
<code>pidstat</code> command instead of <code>sar -x</code> or <code>sar -X</code>. Please read
their manual page to learn some more about their respective options.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.22"></a>
2.22. What is the exact meaning of the <count> parameter for sar and sadc?
</span><br><br>
For <code>sadc</code>, <var>count</var> is the number of data samples collected.<br>
For <code>sar</code>, <var>count</var> is the number of records to
display (a record contains the average values for
counters over the given time interval - See 2.15).<br>
<br>
Starting with an empty datafile:<br>
<br>
<font style="font-family: Courier New,Courier,monospace; color: rgb(140, 200, 240);">
$ sadc datafile 1 6
</font>
--> Write 6 data samples to datafile.<br>
<font style="font-family: Courier New,Courier,monospace; color: rgb(140, 200, 240);">
$ sar -f datafile 1 6
</font>
--> 6 is invalid because there are only 5 intervals.<br>
<br>
Based on the <var>count</var> value entered for <code>sadc</code> the
"valid" <var>count</var> values for <code>sar</code> are 1 through 5.
Any value greater than 5 for sar will give the same
output as 5 in this example. So entering <code>sar -f datafile1 2000</code>
for a file populated with the output of <code>sadc 1 6 datafile</code>
will give the same output as <code>sar -f datafile 1 5</code>.
Note that it all depends on the number of data
samples pre-existing in the data file. If the file is
empty when first running <code>sadc</code> then the above is true.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.23"></a>
2.23. Why doesn't sar deal with sub-second sampling/monitoring?
</span><br><br>
There are two reasons for <code>sar</code> to not handle sub-second intervals:<br>
<br>
1) This is not <code>sar</code>'s purpose. <code>sar</code> has been created to
give the sys admin a global overview of its machine
daily utilization so that when a problem happens, he has
a benchmark and can compare the statistics gathered by
<code>sar</code> with those saved before. For that reason an interval
of 10 minutes (which is the default for <code>sar</code>) is quite appropriate.<br>
<br>
2) Because this is just a dumb idea to try to gather a
huge amount of data on a sub-second interval basis (and
<code>sar</code> really collects a lot of data). This can be
resource-consuming and you are all the more prone to
have an influence on the data you are retrieving as the
interval of time is small.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.24"></a>
2.24. Is it possible to make sadc save only some specific
activities in my binary daily data files?
</span><br><br>
<code>sadc</code>'s option <code>-S</code> followed by one or more keywords
(<code>DISK</code>, <code>SNMP</code>...) can already be used to specify which
optional activities are to be collected. Without this
option, <code>sadc</code> collects a default set of activities (CPU
activity, memory activity, network activity, etc.) Yet
it is actually possible to specify explicitly which
activities should be collected by <code>sadc</code>! You have to use
<code>sadc</code>'s option <code>-S</code> followed by the report name
corresponding to the activity you want to collect (enter
<code>sar --help</code> to know the formal report names used by
<code>sadc</code>).<br>
<br>
<u>Example:</u>
To tell <code>sadc</code> to collect only temperature sensors activity
in addition to the default set of activities, enter:<br>
<pre style="color: rgb(140, 200, 240);">
$ sadc -S A_PWR_TEMP (...)
</pre>
followed by the other classic options (interval, count,
filename...) Now assume you want to collect temperature
sensors activity <b>without</b>
the other activities collected by default, add the
special report name <code>A_NULL</code> to the list passed to <code>sadc</code>, e.g.:<br>
<pre style="color: rgb(140, 200, 240);">
$ sadc -S A_NULL,A_PWR_TEMP (...)
</pre>
Of course you can enter as many report names as you want
to collect different activities.<br>
Last you can exclude a specific activity from a list by
prefixing its report name with a dash. For example, to
collect all possible activities <b>except</b>
statistics for interrupts, enter:<br>
<pre style="color: rgb(140, 200, 240);">
$ sadc -S XALL,-A_IRQ (...)
</pre>
This way you can tell <code>sadc</code> to collect only the desired activities.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="sar-2.25"></a>
2.25. The sar and/or sadf command complain(s) with the following message:<br>
<pre>
End of system activity file unexpected
</pre>
</span>
<code>sadc</code>, the data collector, was unable to write all its
data to the system activity data file (<code>/var/log/sa/saDD</code>
by default). This is probably because there was no space
left on the device where the data file is located.
Make sure there is enough free space on the device.
Sometimes it seems there is enough free space but there
may be some jobs run by crontab (particularly during the
night) that can temporarily consume all of your free
space, making <code>sadc</code> fail.<br>
<br>
Another reason could be linked to the system activity
daily data file being corrupted. This could possibly
happen when several instances of <code>sadc</code> are trying to
update the same data file, especially around midnight
when making a file rotation. See question 2.12 to know
how to make such a file rotation properly.<br>
<br>
Last this issue can also be triggered when the system is
rebooted forcibly without data in cache being written to
disk. You can use switch <code>-f</code> with <code>sadc</code> to make sure data
are written to disk immediately. Of course sync'ing each
data sample to disk implies a (probably slight)
performance penalty.
<br>
<br>
<br>
<hr style="width: 100%; height: 2px;"></div>
<p style="font-weight: bold; text-decoration: underline;">
<a name="sar"></a>3. QUESTIONS RELATING TO IOSTAT
</p>
<span style="color: rgb(255, 255, 0);">
<a name="iostat-3.1"></a>
3.1. I can't see all my disks when I use the iostat command...
</span><br><br>
Yes. This is a kernel limit. Old kernels (2.2.x for
instance) used to maintain stats for the first four devices.<br>
The accounting code has changed in 2.4 kernels, and the
result may (or may not) be better for your system.
Indeed, Linux 2.4 maintains the stats in a two
dimensional array, with a maximum of 16 devices
(DK_MAX_DISK in the kernel sources). Moreover, if the
device major number exceeds DK_MAX_MAJOR (whose value
also defaults to 16 in the kernel sources), then stats
for this device will not be collected.<br>
So, a solution may be simply to change the values of
these limits in <code>linux/include/linux/kernel_stat.h</code> and
recompile your kernel. You should no longer have any
problem with post 2.5 kernels, since statistics are
maintained by the kernel for all the devices. In the
particular case of iostat, also be sure to use the ALL
keyword on the command line to display statistical
information relating to every device, including those
that are defined but have never been used by the system.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="iostat-3.2"></a>
3.2. iostat -x doesn't report disk I/O statistics...
</span><br><br>
For <code>iostat -x</code> to be able to report extended disk I/O
statistics, it is better to use a recent version of the
Linux kernel (2.6.x). Indeed, <code>iostat</code> tries to read data
from the <code>/proc/diskstats</code> file or from the <code>sysfs</code>
filesystem for that. But <code>iostat</code> may also be able to
display extended statistics with older kernels (e.g.
2.4.x) providing that all the necessary statistical
information is available in the <code>/proc/partitions</code> file,
which requires that a patch be applied to the kernel
(this is often done on kernels included in various
distros). In recent 2.4.x kernels, the <code>/proc/partitions</code>
file has all the necessary data providing that the
kernel has been compiled with <code>CONFIG_BLK_STATS=y</code>.
<br>
<br>
<br>
<span style="color: rgb(255, 255, 0);">
<a name="iostat-3.3"></a>
3.3. Why can't iostat display extended statistics for partitions
with some 2.6.x kernels?
</span><br><br>
Because the kernel maintains these stats only for
devices, and not for partitions! Here is an excerpt from
the document iostats.txt written by Rick Lindsley
(ricklind@us.ibm.com) and included in the kernel source
documentation:
<br>
<span style="font-style: italic;">
"There were significant changes between 2.4 and 2.6 in the I/O
subsystem. As a result, some statistic information
disappeared. The translation from a disk address
relative to a partition to the disk address relative
to the host disk happens much earlier. All
merges and timings now happen at the disk level rather