8

为什么 openwrt 上本地的 io 操作会严重影响整体性能?

 2 years ago
source link: https://www.v2ex.com/t/826588
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Linux

为什么 openwrt 上本地的 io 操作会严重影响整体性能?

  vigidroid · 3 天前 · 2443 次点击
我给路由器插了外置硬盘做 samba 服务。发现传输数据的时候(指局域网的设备读、写路由器硬盘数据,和路由器硬盘本地做数据 copy ),路由器性能会整体下降,具体体现在:
1. Load Average 增长到 3+( cpu 为单核)
2. iostat 命令显示: cpu %idle 为 0 ,cpu %iowait 很高,硬盘设备的%util 接近 100
3. ps 命令显示:smbd 进程 STAT 为 D

网上查了一圈,大概理解为 cpu 在干等 io 操作返回( iowait 高),极少腾出空闲处理其他事情,导致得卡顿。那我理解这种情况应该是有方法优化的。io 操作出现了瓶颈,cpu 应该放手 io 进程,转而积极处理其他进程。为什么现在不是这样?
这个和路由器的内存少有没有关系,是不是搞个 swap 会有效(现在没有 swap ,内存 60MB )?
还有个问题,为什么同样是 io copy ,局域网设备之间的传输就不会导致路由器 cpu 的 iowait 升高。

本人 linux 小白,请教一下,有没有什么思路解决这种问题?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK