PHP 高并发日志丢失问题

2021-06-17 10:54:30 +08:00
 cs5117155

我使用的 thinkphp5.0 框架,发现有时候某一个时刻的日志丢失了,但是数据库更新都是正确的。而且我自已封装的日志函数也存在日志丢了的情况,我是否设置文件锁的方式写日志呢,比如flock($fp, LOCK_EX),有什么办法可以解决日志不丢失的做法

function log($folder = 'debug', $msg)
    {
        $path = LOG_PATH . $folder;
        if (!is_dir($path)) {
            mkdir($path, 0777, true);
        }
        $filename = $path . '/' . date('Ymd') . '.txt';
        $content = date("Y-m-d H:i:s") . "\r\n" . print_r($msg, 1) . "\r\n \r\n \r\n ";
        if (!is_file($filename)) {
            touch($filename);
            chmod($filename, 0777);
        }
        file_put_contents($filename, $content, FILE_APPEND);
    }
3357 次点击
所在节点    PHP
29 条回复
l4ever
2021-06-17 11:04:06 +08:00
io 瓶颈了
cs5117155
2021-06-17 11:35:35 +08:00
@l4ever 那这个 io,我需要怎么测试才知道最大处理是多少 mb 的
simapple
2021-06-17 12:23:47 +08:00
加个锁 试试 file_put_contents 第三个参数可以加锁,另外上面几行,检查文件 创建 权限,有什么意义?
crynocry
2021-06-17 12:45:15 +08:00
队列写日志
onion83
2021-06-17 12:46:04 +08:00
一点建议:

$path = LOG_PATH . $folder;
if (!is_dir($path)) {
mkdir($path, 0777, true);
}

建议在框架初始化,或者索性部署项目的时候直接将文件夹建好,并保证目录对可写。

if (!is_file($filename)) {
touch($filename);
chmod($filename, 0777);
}

上述代码完全多余,并且 777 权限不符合 linux 最佳安全实践。

写时注意加锁

file_put_contents($filename, $content, FILE_APPEND | LOCK_EX);
iyaozhen
2021-06-17 13:00:11 +08:00
高并发是多少并发?当时机器状态怎么样? IO 怎么样
啥也没说呀

只看代码虽然写的挫,问题多,但大面上没问题

感觉不是丢了,应该是 IO 高,内容多,一次 buffer 写不完串行了。LOCK_EX 能行,但也可能影响性能
Seanfuck
2021-06-17 13:39:59 +08:00
加个缓存算了,redis 之类的。
cs5117155
2021-06-17 14:24:14 +08:00
@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
```
cbasil
2021-06-17 14:46:20 +08:00
用 error_log 写日志就好了
cs5117155
2021-06-17 17:17:51 +08:00
@cbasil 我是看 thinkphp5 的文件日志驱动类
```php
protected function write($message, $destination, $apart = false)
{
//检测日志文件大小,超过配置大小则备份日志文件重新生成
if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) {
rename($destination, dirname($destination) . DS . time() . '-' . basename($destination));
$this->writed[$destination] = false;
}

if (empty($this->writed[$destination]) && !IS_CLI) {
if (App::$debug && !$apart) {
// 获取基本信息
if (isset($_SERVER['HTTP_HOST'])) {
$current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
} else {
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
}

$runtime = round(microtime(true) - THINK_START_TIME, 10);
$reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞';
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
$memory_str = ' [内存消耗:' . $memory_use . 'kb]';
$file_load = ' [文件加载:' . count(get_included_files()) . ']';

$message = '[ info ] ' . $current_uri . $time_str . $memory_str . $file_load . "\r\n" . $message;
}
$now = date($this->config['time_format']);
$server = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '0.0.0.0';
$remote = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'CLI';
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$message = "---------------------------------------------------------------\r\n[{$now}] {$server} {$remote} {$method} {$uri}\r\n" . $message;

$this->writed[$destination] = true;
}

if (IS_CLI) {
$now = date($this->config['time_format']);
$message = "[{$now}]" . $message;
}

return error_log($message, 3, $destination);
}

```
最后也是用 error_log 写入的,但是我就是 TP5 提供的 sql.log 日志,也漏某一个时刻的
iyaozhen
2021-06-17 18:44:46 +08:00
@cs5117155 有可能是 MySQL IO 操作比较大,php 服务迁移出这个实例观察下呢
alexkkaa
2021-06-17 19:12:40 +08:00
加锁试一下就知道了 就算是石头盘这点流量也不会出现 io 瓶颈啊
elevioux
2021-06-17 19:18:01 +08:00
用队列吧。用文件锁的话会阻塞,反而降低了并发,得不偿失。
Senorsen
2021-06-17 21:47:56 +08:00
接个 logstash 或者其他的日志服务吧,然后尽量异步进行日志记录操作
wellsc
2021-06-17 21:48:22 +08:00
@cs5117155 iotop iostat
akira
2021-06-17 23:14:01 +08:00
服务器监控呢,云服务器应该都有提供硬件资源指标监控的,拉出来看一眼 大概就能知道是什么环节出了问题了
qq1340691923
2021-06-18 10:23:58 +08:00
换 java
cs5117155
2021-06-18 11:00:20 +08:00
@qq1340691923 这有点不实际阿,公司没有招 java 的
fenglangjuxu
2021-06-18 11:01:25 +08:00
测试的话 试试同时开多个 比如 1000 个进程来跑这个代码(写个 shell 文件 里面调用 php 文件),每个写入 10 行日志 同时写入文件 看下并发的时候 会不会覆盖日志之类的 正确的话 到时候是 1000*10 行.

当然上面的参数 都可以自己再改改
cs5117155
2021-06-18 11:02:47 +08:00
@wellsc
这样看写入的不多阿
[root@idgs21 ~]# iostat 2
Linux 3.10.0-1062.18.1.el7.x86_64 (iZwz9638raamc1mnqs77lgZ) 06/18/2021 _x86_64_ (2 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
1.70 0.00 1.13 2.52 0.00 94.65

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 38.77 1236.77 750.54 24477578143 14854213348

avg-cpu: %user %nice %system %iowait %steal %idle
1.75 0.00 1.00 2.00 0.00 95.25

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 29.85 0.00 274.63 0 552

avg-cpu: %user %nice %system %iowait %steal %idle
2.78 0.00 3.54 2.53 0.00 91.16

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 158.00 776.00 1616.00 1552 3232

avg-cpu: %user %nice %system %iowait %steal %idle
0.75 0.00 0.25 0.00 0.00 98.99

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 0.00 0.00 0.00 0 0

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.51 4.27 0.00 91.96

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 66.50 2.00 616.00 4 1232

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 1.01 3.28 0.00 94.19

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 76.00 4.00 698.00 8 1396

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.75 4.01 0.00 91.98

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 61.50 2.00 584.00 4 1168

avg-cpu: %user %nice %system %iowait %steal %idle
1.01 0.00 0.76 2.02 0.00 96.21

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 31.50 2.00 282.00 4 564

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.01 3.02 0.00 94.22

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 45.00 2.00 422.00 4 844

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 1.01 3.28 0.00 94.19

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 69.00 2.00 1878.00 4 3756

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 0.76 3.30 0.00 94.42

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 440.00 4 880

avg-cpu: %user %nice %system %iowait %steal %idle
1.50 0.00 0.75 1.50 0.00 96.24

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 24.00 0.00 216.00 0 432

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.26 3.53 0.00 93.45

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 50.50 2.00 462.00 4 924

avg-cpu: %user %nice %system %iowait %steal %idle
0.50 0.00 0.25 0.00 0.00 99.25

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 0.00 0.00 0.00 0 0

avg-cpu: %user %nice %system %iowait %steal %idle
1.51 0.00 1.01 3.27 0.00 94.22

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 63.00 2.00 1360.00 4 2720

avg-cpu: %user %nice %system %iowait %steal %idle
1.26 0.00 0.76 2.27 0.00 95.72

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 30.50 2.00 276.00 4 552

avg-cpu: %user %nice %system %iowait %steal %idle
2.02 0.00 1.01 3.27 0.00 93.70

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 436.00 4 872

avg-cpu: %user %nice %system %iowait %steal %idle
0.75 0.00 1.01 1.26 0.00 96.98

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 45.50 2.00 286.00 4 572

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.51 4.77 0.00 91.46

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 71.50 2.00 662.00 4 1324

avg-cpu: %user %nice %system %iowait %steal %idle
0.76 0.00 0.51 2.53 0.00 96.20

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 54.00 2.00 1508.00 4 3016

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 1.26 3.54 0.00 93.69

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 54.50 2.00 488.00 4 976

avg-cpu: %user %nice %system %iowait %steal %idle
20.80 0.00 2.51 7.77 0.00 68.92

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 63.50 4.00 16120.00 8 32240

avg-cpu: %user %nice %system %iowait %steal %idle
16.20 0.00 3.29 8.35 0.00 72.15

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 94.00 2.00 15182.00 4 30364

avg-cpu: %user %nice %system %iowait %steal %idle
1.50 0.00 1.00 2.01 0.00 95.49

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 30.50 2.00 268.00 4 536

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.76 5.53 0.00 90.45

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 86.50 6.00 1698.00 12 3396

avg-cpu: %user %nice %system %iowait %steal %idle
1.01 0.00 0.75 1.51 0.00 96.73

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 25.00 2.00 238.00 4 476

avg-cpu: %user %nice %system %iowait %steal %idle
2.02 0.00 1.26 3.02 0.00 93.70

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 446.00 4 892

avg-cpu: %user %nice %system %iowait %steal %idle
1.00 0.00 0.50 0.50 0.00 97.99

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 6.00 0.00 60.00 0 120

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.51 4.27 0.00 92.46

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 60.50 2.00 544.00 4 1088

avg-cpu: %user %nice %system %iowait %steal %idle
1.26 0.00 0.75 1.76 0.00 96.23

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 45.50 2.00 1336.00 4 2672

avg-cpu: %user %nice %system %iowait %steal %idle
2.27 0.00 1.26 4.55 0.00 91.92

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 69.50 2.00 658.00 4 1316

avg-cpu: %user %nice %system %iowait %steal %idle
1.00 0.00 1.00 1.50 0.00 96.49

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 24.00 2.00 200.00 4 400

avg-cpu: %user %nice %system %iowait %steal %idle
2.53 0.00 3.54 2.53 0.00 91.41

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 63.00 2.00 464.00 4 928

avg-cpu: %user %nice %system %iowait %steal %idle
1.25 0.00 1.00 1.75 0.00 95.99

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 24.00 0.00 222.00 0 444

avg-cpu: %user %nice %system %iowait %steal %idle
2.02 0.00 0.76 3.78 0.00 93.45

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 72.00 2.00 1558.00 4 3116

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.26 2.51 0.00 94.47

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 42.50 2.00 390.00 4 780

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.26 3.27 0.00 93.72

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 448.00 4 896

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 0.76 2.78 0.00 94.95

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/783908

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX