summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/slowdown/README37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/slowdown/README b/tools/slowdown/README
index d953640..90f2b2c 100644
--- a/tools/slowdown/README
+++ b/tools/slowdown/README
@@ -1,3 +1,11 @@
+What is slowdown
+----------------
+
+slowdown is a shared library implementing libc read(2) and write(3)
+with a configurable delay meant for testing programs behaviour when
+the disk behaves differently than normal.
+
+
How to build and install slowdown.so
------------------------------------
@@ -14,3 +22,32 @@ You will need the GNU auto-tools (Autoconf, Automake, Libool).
See INSTALL for more general information about building and
installing.
+
+
+How to use slowdown
+-------------------
+
+$ # slowdown.so not loaded, for reference
+$ dd if=/dev/zero of=/dev/null bs=1 count=100
+100+0 records in
+100+0 records out
+100 bytes (100 B) copied, 0.000269866 s, 371 kB/s
+
+$ # slowdown.so loaded but not configured to delay on purpose
+$ LD_PRELOAD=~/usr/lib/libslowdown.so dd if=/dev/zero of=/dev/null bs=1 count=100
+100+0 records in
+100+0 records out
+100 bytes (100 B) copied, 0.0265673 s, 3.8 kB/s
+
+# slowdown.so delaying writes with 1ms
+$ LD_PRELOAD=~/usr/lib/libslowdown.so SLOWDOWN_WRITE_DELAY_MS=1 dd if=/dev/zero of=/dev/null bs=1 count=100
+100+0 records in
+100+0 records out
+100 bytes (100 B) copied, 0.127009 s, 0.8 kB/s
+$
+
+# slowdown.so delaying both reads and writes with 1ms each
+$ LD_PRELOAD=~/usr/lib/libslowdown.so SLOWDOWN_READ_DELAY_MS=1 SLOWDOWN_WRITE_DELAY_MS=1 dd if=/dev/zero of=/dev/null bs=1 count=100
+100+0 records in
+100+0 records out
+100 bytes (100 B) copied, 0.227234 s, 0.4 kB/s