@
iyaozhen 我添加一些详细的信息,服务器是 2 核心,4GB,40GB 硬盘。系统是 CentOS 7.7.1908,运行环境是宝塔,而且有一个 Mysql 表会不断更新硬件心跳,250 台机器左右,每 40s 会更新一次心跳。但平时用户比较少,只有晚上高峰期才会出现不同用户在同一时刻下单,而且现在用户才 2000 个,怎么也想不出这点用户,会在哪里情况下某时刻日志会丢的。
然后我通过 命令查看`pidstat -d 1`查看平时的 IO
```bash
# pidstat -d 1
Linux 3.10.0-1062.18.1.el7.x86_64 (iZwz9638raamc1mnqs77lgZ) 06/17/2021 _x86_64_ (2 CPU)
01:51:21 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:22 PM 0 332 0.00 3.96 0.00 jbd2/vda1-8
01:51:22 PM 1002 1528 0.00 47.52 0.00 redis-server
01:51:22 PM 1003 1878 3.96 122.77 79.21 mysqld
01:51:22 PM 1000 1920 0.00 3.96 0.00 nginx
01:51:22 PM 1000 2248 0.00 3.96 0.00 php-fpm
01:51:22 PM 1000 2253 0.00 3.96 0.00 php-fpm
01:51:22 PM 1000 31997 0.00 3.96 0.00 php-fpm
01:51:22 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:23 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:23 PM 1003 1878 0.00 72.00 48.00 mysqld
01:51:23 PM 1000 15198 0.00 4.00 0.00 php-fpm
01:51:23 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:24 PM 0 332 0.00 12.00 0.00 jbd2/vda1-8
01:51:24 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:24 PM 1003 1878 4.00 76.00 48.00 mysqld
01:51:24 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:24 PM 1000 15200 0.00 4.00 0.00 php-fpm
01:51:24 PM 1000 19628 0.00 8.00 0.00 php-fpm
01:51:25 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:26 PM 0 332 0.00 4.00 0.00 jbd2/vda1-8
01:51:26 PM 1002 1528 0.00 24.00 0.00 redis-server
01:51:26 PM 1003 1878 0.00 2140.00 32.00 mysqld
01:51:26 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:26 PM 1000 2254 0.00 4.00 0.00 php-fpm
01:51:30 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:31 PM 1002 1528 0.00 56.00 0.00 redis-server
01:51:31 PM 1003 1878 4.00 148.00 96.00 mysqld
01:51:31 PM 1000 2250 0.00 4.00 0.00 php-fpm
01:51:31 PM 1000 15703 0.00 4.00 0.00 php-fpm
01:51:33 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:34 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:35 PM 0 332 0.00 88.00 0.00 jbd2/vda1-8
01:51:35 PM 1002 1528 0.00 48.00 0.00 redis-server
01:51:35 PM 1003 1878 4.00 128.00 80.00 mysqld
01:51:35 PM 1000 1920 0.00 4.00 0.00 nginx
01:51:35 PM 1000 1921 0.00 8.00 0.00 nginx
01:51:35 PM 1000 2249 0.00 4.00 0.00 php-fpm
01:51:35 PM 1000 2251 0.00 4.00 0.00 php-fpm
01:51:35 PM 1000 2254 0.00 4.00 0.00 php-fpm
01:51:35 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:36 PM 1002 1528 0.00 104.00 0.00 redis-server
01:51:36 PM 1003 1878 4.00 2452.00 176.00 mysqld
01:51:36 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:36 PM 1000 2253 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 14284 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 15200 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 15209 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 19628 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 19629 0.00 4.00 0.00 php-fpm
01:51:36 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:37 PM 1002 1528 0.00 40.00 0.00 redis-server
01:51:37 PM 1003 1878 4.00 100.00 64.00 mysqld
01:51:37 PM 1000 16440 0.00 4.00 0.00 php-fpm
01:51:37 PM 1000 19627 0.00 4.00 0.00 php-fpm
01:51:37 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:38 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:38 PM 1003 1878 0.00 72.00 48.00 mysqld
01:51:38 PM 1000 31997 0.00 8.00 0.00 php-fpm
01:51:38 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:39 PM 1002 1528 0.00 20.00 0.00 redis-server
01:51:39 PM 1003 1878 4.00 52.00 32.00 mysqld
01:51:39 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:39 PM 1000 15332 0.00 4.00 0.00 php-fpm
01:51:39 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:40 PM 1002 1528 0.00 24.00 0.00 redis-server
01:51:40 PM 1003 1878 0.00 72.00 48.00 mysqld
01:51:40 PM 1000 2248 0.00 4.00 0.00 php-fpm
01:51:42 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:43 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:43 PM 1003 1878 0.00 76.00 48.00 mysqld
01:51:43 PM 1000 2247 0.00 4.00 0.00 php-fpm
01:51:43 PM 1000 19629 0.00 4.00 0.00 php-fpm
01:51:43 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:44 PM 1002 1528 0.00 108.00 0.00 redis-server
01:51:44 PM 1003 1878 8.00 296.00 192.00 mysqld
01:51:44 PM 1000 1921 0.00 4.00 0.00 nginx
01:51:44 PM 1000 2253 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 2254 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 14284 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 14285 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 15199 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 15332 0.00 4.00 0.00 php-fpm
01:51:44 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:45 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:45 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:46 PM 0 332 0.00 8.00 0.00 jbd2/vda1-8
01:51:46 PM 1002 1528 0.00 20.00 0.00 redis-server
01:51:46 PM 1003 1878 0.00 2332.00 32.00 mysqld
01:51:46 PM 1000 2250 0.00 4.00 0.00 php-fpm
01:51:46 PM 1000 15198 0.00 4.00 0.00 php-fpm
01:51:46 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:47 PM 1002 1528 0.00 20.00 0.00 redis-server
01:51:47 PM 1003 1878 4.00 52.00 32.00 mysqld
01:51:47 PM 1000 15703 0.00 4.00 0.00 php-fpm
01:51:47 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:48 PM 1002 1528 0.00 56.00 0.00 redis-server
01:51:48 PM 1003 1878 4.00 148.00 96.00 mysqld
01:51:48 PM 1000 2249 0.00 4.00 0.00 php-fpm
01:51:48 PM 1000 15199 0.00 4.00 0.00 php-fpm
01:51:48 PM 1000 19628 0.00 4.00 0.00 php-fpm
01:51:48 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:49 PM 1002 1528 0.00 12.00 0.00 redis-server
01:51:49 PM 1003 1878 0.00 24.00 16.00 mysqld
01:51:49 PM 1000 2251 0.00 4.00 0.00 php-fpm
```