Docker的常用命令

1、查询当前目录下每个文件的大小

du -sh */ | awk '{printf "%-7s %s\n", ($1 ~ /[GMK]/ ? $1 : "0G"), $2}'

2、清除docker 的空景象

docker image ls|grep none |awk '{print $3}'|xargs docker rmi

2. 使用 mongotop 查看集合级读写

docker exec -it mongodb-latest mongotop --host=localhost -u admin -p yourpassword --authenticationDatabase=admin

输出示例:

ns              total    read    write
test.users      105ms     25ms     80ms
test.orders     80ms      60ms     20ms

3. 使用 mongostat 工具(推荐)

# 进入容器执行
docker exec -it mongodb-latest mongostat --host=localhost --username=admin --password=yourpassword --authenticationDatabase=admin

# 或直接从宿主机执行(需安装mongo-tools)
mongostat --host=localhost:27017 -u admin -p yourpassword --authenticationDatabase=admin

输出示例(关键指标说明):

insert query update delete getmore command dirty used flushes vsize res qrw arw net_in net_out conn time
   0    10      5      0       0     1|0  0.0% 0.0%       0 1.21G 1.21G 0|0 1|0   12k   156k    5 14:02:01

4、MySql查询正在执行的Sql

select * from information_schema.processlist where command!='sleep';
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

西西o

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值