Disk I/O Monitoring on the Asus RT-AC66U Router

asus-rt-ac66uThe Asus RT-AC66U, like many home routers that are on the market today, allow you to connect a USB drive to one of its onboard USB ports and share this disk out to your network.  Via the RT-ACC66U, you can share your NAS disk via CIFS or NFS. My configuration has a 1TB unmirrored drive used for temporary scratch storage, and as a network landing area for files that I want to backup.

Note that this is my 4th article on hacking the RT-AC66U. You can check out my other articles below if you are interested.

As you must already know, the Asus RT-AC66U runs Busybox, which is a very small but powerful embedded Linux distro. Because of this there are a lot of familiar commands available via the CLI. However, don’t get to comfortable, as this is still a very foreign land.

Note that this article assumes that you have ssh or telnet working and can log into your RT-AC66U via the CLI.

As I have stated before, you can use the ipgk command to search for and install packages. In the example below I searched for iostat, but found dstat instead. Either one was fine for my purposes…. at least initially.

admin@RT-AC66U:/tmp/home/root# ipkg list | grep iostat
dstat – 0.7.0-1 – dstat is a versatile replacement for vmstat, iostat, netstat, nfsstat, and ifstat

Now that I know what to install, I need to install it.

admin@RT-AC66U:/tmp/home/root# ipkg install dstat
Installing dstat (0.7.0-1) to /opt/…
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/dstat_0.7.0-1_mipsel.ipk
Configuring dstat
Successfully terminated.

Now that dstat is installed lets run it. The switches “rad” enable i/o stats and enable disk stats. The “-D” option allows us to specify a disk by name.

admin@RT-AC66U:/tmp/home/root# dstat -rad -D sda

The command above output what you see below.

dstat-screen-shot

As I mentioned above, dstat is most definitely, a very useful command. However, so far I have not been able to figure out how to get it to display the percentage utilized for a drive, which is rather easy to do with iostat.

Advertisements

Redhat I/O Scheduler Configuration in a Virtual Machine.

Dali-melting-time-wall-clock The Linux kernel controls disk I/O scheduling, and is responsible for its optimization. One of the ways that it does this is via an I/O elevator to reorder and schedule pending I/O requests in order to minimize the time spent moving the
disk head. This reduction in movement results in a reduction in disk seek time which in turn,  maximizes hard
disk throughput.

However, because of the fact that ESX is its own built in elevator, the Linux kernel’s elevator is not needed, and in fact can hurt disk performance. So its best to disable the elevator inside your linux VMs.

One way to do this is to edit your /etc/grub.conf and add “elevator=noop” as seen below. This will require a reboot to take affect.

title CentOS (2.6.18-53.el5)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-53.el5 ro root=LABEL=/ noapic acpi=off rhgb quiet notsc elevator=noop
        initrd /boot/initrd-2.6.18-53.el5.img

To make the change on the fly to a running Linux VM run the command below, where device is your boot disk

echo noop > /sys/block/DEVICE/queue/scheduler

Additional Information:

http://www.redhat.com/magazine/008jun05/features/schedulers/

http://kbase.redhat.com/faq/docs/DOC-7539

http://lonesysadmin.net/2008/02/21/elevatornoop/

http://www.redhat.com/docs/wp/performancetuning/iotuning/iosubsystem-scheduler-selection.html

http://www.linuxjournal.com/article/6931