summaryrefslogtreecommitdiff
path: root/tools/slowdown/README
blob: 90f2b2c77ab6d98c013719202e85ab9a7b625eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
------------------------------------

If this directory doesn't contain the file 'configure', run

  autoreconf -ivf

before doing

  ./configure
  make install

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