flamegraphs: Improve the title page
[libguestfs-talks.git] / 2019-fosdem / nbdview / README
1 nbdview
2 -------
3
4 nbdview is a small Tcl/Tk program that lets you visualize reads and
5 writes happening to an nbdkit server in real time.
6
7 To use it you will need to start your nbdkit server with the log
8 filter.  For example, using the memory plugin (but any plugin may be
9 used):
10
11   size=$((64 * 1024 * 1024))
12   delay=40ms
13   nbdkit --filter=log --filter=delay \
14          memory \
15          size=$size \
16          logfile=/tmp/log \
17          rdelay=$delay wdelay=$delay &
18
19 In this example I have also added a delay which helps to make the
20 stuff happening on screen easier to see and more "animated", but it is
21 not required.
22
23 Then start nbdview.tcl specifying the log file and virtual size:
24
25   ./nbdview.tcl /tmp/log $size &
26
27 Note that only small disk sizes really work (larger sizes would
28 require too many pixels!)  With the defaults compiled into
29 nbdview.tcl: 4K block size, 128 x 128 pixel canvas, you can display at
30 most 64MB.
31
32 Then you can write to the NBD server using ordinary tools such as
33 qemu, qemu-io, guestfish, etc. and observe the reads and writes to the
34 disk.
35
36 nbdraid
37 -------
38
39 As above but allowing you to display operations to multiple (RAID)
40 devices.
41
42 Start N copies of nbdkit like this:
43
44   size=$((64 * 1024 * 1024))
45   delay=40ms
46   rm /tmp/error$i
47   rm /tmp/sock$i
48   nbdkit -U /tmp/sock$i \
49          --filter=error --filter=log --filter=delay \
50          memory \
51          size=$size \
52          logfile=/tmp/log$i \
53          rdelay=$delay wdelay=$delay \
54          error-rate=1 error-file=/tmp/error$i &
55
56 Then start nbdraid.tcl:
57
58   ./nbdraid $N $size /tmp/log%d /tmp/error%d