Slowfs

(5 comments)

I have just encountered a bug in Gnome that is much more visible when the hard drive is slow or overloaded and responds slowly. This gave me an idea - how about a simple transparent FUSE filesystem that does nothing else than delay, slow down and possibly reorder filesystem requests? Such a filesystem would be very useful for debugging. We developers tend to have high-performance systems and that hides many bugs, but if we could have a slower system on-demand, it will give us the ability to debug our applications better.

Even better would be a virtual machine where one could arbitrarily slow down any specific aspects of the system - slower CPU, slower hard drive, slower RAM, slower network, ...

I know that engineers of network hardware have special devices that emulate long distance and noise - you take two wireless network cards and plug cables into their antennae sockets and then plug those cables into the device. The device then makes a connection between those cables, but with emulation of a variable distance, variable antennae and variable environmental noise, so the wireless cards can be tested for distance and noise resistance right in the lab. We could do the same in software for HDD, CPU, RAM and networking - imagine having two Xen instances and putting an emulated network between them with 10 hops, 1 second latency, 20% average packet drop traffic shaping and limited top bandwidth of 100 kbit/s. Now that is a real test platform for any kinds of applications that have anything to do with networking (or HDD, CPU or RAM).

Anyone up to making that? Could someone of you use a system like that?

Currently unrated

Comments

Gunnar 8 years, 10 months ago

Your idea is neat, and I guess a FUSE implementation would make it very cleanly implementable. However, you can do it today, specially if you are willing to mix in virtualized hosts. Give your VM a block device which is available over the network, and use traffic shaping... That should do.
I remember there was a Linux kernel module which implemented an interface with artificial errors, for testing, but cannot find it. Not that I tried too hard, though

Link | Reply

ssam 8 years, 10 months ago

I'd like to see apps tested over a high latency X11 tunnel.

Link | Reply

Simon Farnsworth 8 years, 10 months ago

Netem provides the networking part of this; see http://www.linuxfoundation.org/en/Net:Netem. There's the "error" target for device mapper (man dmsetup) to produce disk errors, but, as yet, there's no interface for disk throttling to build a Diskem on top of - this is being worked on upstream, as part of containers work.

Link | Reply

Steve Kemp 8 years, 10 months ago

I recently wrote an introduction to using FUSE via ruby:

http://www.debian-administration.org/articles/619

That actually has inspired me to do a few things, one of which is a simple slowdown module. In ruby.

It currently just supports directory lists with a random sleep or two thrown in - but it'd be pretty easy to extend.

Of course what I've written is so minimal it'd be trivial to recreate from scratch. If there is any interest though I'm willing to post it online for comment/improvements...

Link | Reply

Steve Kemp 8 years, 10 months ago

Uploaded here:

http://www.steve.org.uk/Software/tmp/slowfs/

Link | Reply

New Comment

required

required (not published)

optional

Recent Posts

Archive

2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005

Categories

Authors

Feeds

RSS / Atom