/dev/mmcblk0: HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 132 MB in 3.02 seconds = 43.65 MB/sec
root@raspbian:~# hdparm -tT /dev/mmcblk0
/dev/mmcblk0: Timing cached reads: 1914 MB in 2.00 seconds = 958.37 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 132 MB in 3.03 seconds = 43.63 MB/sec
查找命令在哪个软件包
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# 比如说我需要iostat root@raspbian:~# apt-cache search iostat dstat - versatile resource statistics tool ganglia-modules-linux - Ganglia extra modules for Linux (IO, filesystems, multicpu) ifstat - InterFace STATistics Monitoring nicstat - print network traffic statistics pcp-import-iostat2pcp - Tool for importing data from iostat into PCP archive logs r-cran-epi - GNU R epidemiological analysis r-cran-epibasix - GNU R Elementary Epidemiological Functions r-cran-kmi - GNU R Kaplan-Meier Multiple Imputation r-cran-rms - GNU R regression modeling strategies by Frank Harrell sysstat - system performance tools for Linux
root@raspbian:~# sar -u 2 5 Linux 5.10.78-Release-OPENFANS+20211111-v8 (raspbian) 09/04/2022 _aarch64_ (4 CPU)
10:32:27 AM CPU %user %nice %system %iowait %steal %idle 10:32:29 AM all 1.38 0.00 1.00 0.00 0.00 97.62 10:32:31 AM all 7.50 0.00 1.38 0.00 0.00 91.12 10:32:33 AM all 0.25 0.00 0.87 0.00 0.00 98.88 10:32:35 AM all 0.25 0.00 0.00 0.00 0.00 99.75 10:32:37 AM all 0.50 0.00 0.13 0.00 0.00 99.37 Average: all 1.97 0.00 0.67 0.00 0.00 97.35
root@raspbian:~# last root pts/0 127.0.0.1 Sun Sep 4 09:43 still logged in root pts/0 127.0.0.1 Sun Sep 4 09:16 - 09:36 (00:20) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 still running root pts/0 10.8.3.28 Sat Sep 3 10:07 - 10:07 (00:00) root pts/0 127.0.0.1 Sat Sep 3 09:13 - 09:15 (00:01) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 still running root pts/0 10.8.3.28 Fri Sep 2 13:17 - crash (-19237+05:17) root pts/1 127.0.0.1 Thu Sep 1 10:42 - 10:51 (00:08) root pts/0 10.8.3.28 Thu Sep 1 10:10 - 13:45 (03:35) root pts/1 10.71.22.140 Thu Sep 1 08:55 - 09:33 (00:38) root pts/1 10.71.22.140 Thu Sep 1 08:40 - 08:54 (00:14) root pts/0 10.71.22.140 Thu Sep 1 08:38 - 09:33 (00:55) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 still running root pts/0 10.8.3.28 Wed Aug 31 23:58 - crash (-19235+15:58) root pts/1 10.8.3.28 Wed Aug 31 23:13 - crash (-19235+15:13) root pts/0 127.0.0.1 Wed Aug 31 23:11 - 23:50 (00:38) root pts/0 127.0.0.1 Wed Aug 31 23:06 - 23:11 (00:04) root pts/0 127.0.0.1 Wed Aug 31 23:03 - 23:06 (00:02) root pts/0 127.0.0.1 Wed Aug 31 23:02 - 23:02 (00:00) root pts/0 127.0.0.1 Wed Aug 31 23:00 - 23:02 (00:02) root pts/0 127.0.0.1 Wed Aug 31 22:57 - 22:58 (00:01) root pts/0 127.0.0.1 Wed Aug 31 22:54 - 22:56 (00:02) root pts/0 127.0.0.1 Wed Aug 31 22:31 - 22:52 (00:21) root pts/0 10.73.159.18 Wed Aug 31 14:28 - 14:29 (00:00) root pts/0 10.73.159.18 Wed Aug 31 14:28 - 14:28 (00:00) root pts/0 10.73.159.18 Wed Aug 31 14:19 - 14:19 (00:00) root pts/0 10.73.159.18 Wed Aug 31 14:19 - 14:19 (00:00) root pts/0 10.73.159.18 Wed Aug 31 14:16 - 14:19 (00:02) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 still running root pts/0 10.73.159.18 Wed Aug 31 14:14 - down (00:00) root pts/0 10.73.159.18 Wed Aug 31 14:13 - 14:14 (00:00) root pts/0 10.73.159.18 Wed Aug 31 14:10 - 14:13 (00:02) root pts/0 127.0.0.1 Tue Aug 30 22:26 - 14:10 (15:43) root pts/0 127.0.0.1 Tue Aug 30 20:46 - 22:26 (01:39) root pts/0 127.0.0.1 Tue Aug 30 20:42 - 20:45 (00:02) root pts/2 10.67.44.114 Tue Aug 30 20:11 - 20:13 (00:01) root pts/2 127.0.0.1 Tue Aug 30 20:09 - 20:10 (00:01) root pts/0 127.0.0.1 Tue Aug 30 18:33 - 20:31 (01:58) root pts/0 127.0.0.1 Tue Aug 30 17:31 - 18:33 (01:01) root pts/0 127.0.0.1 Tue Aug 30 16:49 - 16:58 (00:09) root pts/0 127.0.0.1 Tue Aug 30 15:57 - 16:27 (00:30) root pts/0 127.0.0.1 Tue Aug 30 14:56 - 15:06 (00:10) root pts/0 127.0.0.1 Tue Aug 30 14:48 - 14:51 (00:02) root pts/0 127.0.0.1 Tue Aug 30 14:36 - 14:44 (00:08) root pts/0 127.0.0.1 Tue Aug 30 14:21 - 14:24 (00:02) root pts/0 127.0.0.1 Tue Aug 30 13:34 - 14:20 (00:45) root pts/0 127.0.0.1 Tue Aug 30 13:13 - 13:14 (00:00) root pts/0 127.0.0.1 Tue Aug 30 12:43 - 13:13 (00:29) root pts/0 127.0.0.1 Tue Aug 30 12:31 - 12:39 (00:08) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 - 14:14 (19235+06:14) root pts/1 127.0.0.1 Tue Aug 30 12:12 - down (00:17) root pts/1 127.0.0.1 Tue Aug 30 12:12 - 12:12 (00:00) root pts/0 127.0.0.1 Tue Aug 30 12:10 - down (00:19) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 - 12:30 (19234+04:30) root pts/0 127.0.0.1 Mon Aug 29 08:57 - 10:01 (01:04) root pts/0 127.0.0.1 Mon Aug 29 08:49 - 08:57 (00:08) root pts/0 127.0.0.1 Mon Aug 29 08:16 - 08:17 (00:01) root pts/0 127.0.0.1 Mon Aug 29 08:16 - 08:16 (00:00) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 - 12:30 (19234+04:30) root pts/0 10.8.3.28 Sun Aug 28 21:53 - 22:10 (00:17) root pts/0 10.8.3.28 Sun Aug 28 20:17 - 21:44 (01:27) root pts/0 10.8.3.28 Sun Aug 28 20:12 - 20:12 (00:00) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 - 12:30 (19234+04:30) root pts/0 192.168.1.100 Sun Aug 28 13:27 - crash (-19232+05:27) pi pts/0 192.168.1.100 Sun Aug 28 01:10 - 01:15 (00:04) root pts/1 127.0.0.1 Sun Aug 28 00:45 - 00:45 (00:00) root pts/1 127.0.0.1 Sun Aug 28 00:45 - 00:45 (00:00) pi pts/0 192.168.1.100 Sun Aug 28 00:30 - 01:09 (00:38) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 - 12:30 (19234+04:30) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 - 18:13 (17941+10:13) reboot system boot 5.10.78-Release- Thu Jan 1 08:00 - 18:12 (17941+10:12)
wtmp begins Thu Jan 1 08:00:03 1970
ulimit
Too many open files是Linux系统中常见的错误,从字面意思上看就是说程序打开的文件数过多,不过这里的files不单是文件的意思,也包括打开的通讯链接(比如socket),正在监听的端口等等,所以有时候也可以叫做句柄(handle),这个错误通常也可以叫做句柄数超出系统限制。引起的原因就是进程在某个时刻打开了超过系统限制的文件数量以及通讯链接数。
通过命令ulimit -a可以查看当前系统设置的最大句柄数是多少
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31767 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 31767 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited