当我使用sysbench测试mysql时,我使用iotop监控io,我发现只有DiSH WRITE速度,DISK READ速度总是0。然后我使用free -h,我发现缓冲区/缓存增加了,这是否意味着sysbench的测试数据不是写入磁盘,而是写入缓冲区,并且没有自动更新到磁盘?
非常感谢!
发布于 2020-10-28 02:25:16
mysql在哪里运行??我不知道iotop和它测量的是什么,但即使是很小的sysbench运行也会产生大量的IO。这可能是用户问题,也可能是mysql在不同的用户下生成io,而不是被选中。
# you can isolate the db into a container and run sysbench against this to see
# if/when/how much IO there is.
docker run --rm -it --name mdb105 --network host -e MYSQL_ALLOW_EMPTY_PASSWORD=on mariadb:10.5 --port=10306
# in another terminal run
docker stats
# now run sysbench, and you will see enormous IO
# you can get another shell in container named mdb105 by:
docker exec -it --user root mdb105 bash
# mariadb:10.5 is based on ubuntu:20.04
# you could maybe run iotop inside the container更新:我能够使用树莓派复制类似于零IO的情况。事实上,docker的统计数据显示没有IO,而很明显数据正被保存到磁盘。我最初的反应是,也许一些内核/发行版缺少某些功能,但它看起来不是内核/发行版,因为我在使用disk/fs即扩展U盘时看到了IO……我认为这更多的是因为microSD卡和它的控制器/驱动程序不支持这种统计数据。由于你的tps非常低,我怀疑你也在使用类似于micro sd的东西。
这可能不会发生在ec2实例中。
https://stackoverflow.com/questions/63386978
复制相似问题