1nbdkit-xz-plugin(1) NBDKIT nbdkit-xz-plugin(1)
2
3
4
6 nbdkit-xz-plugin - nbdkit xz plugin
7
9 nbdkit xz [file=]FILENAME.xz
10
12 The xz plugin is deprecated in nbdkit ≥ 1.9.2 and will be removed in
13 nbdkit 1.12. It has been replaced with a filter with the same
14 functionality, see nbdkit-xz-filter(1). You can use the filter like
15 this:
16
17 nbdkit --filter=xz file file.xz
18
20 "nbdkit-xz-plugin" is a file serving plugin for nbdkit(1).
21
22 It serves the named "FILENAME.xz" over NBD, uncompressing it on the
23 fly. The plugin only supports read-only connections.
24
25 GETTING BEST RANDOM ACCESS PERFORMANCE FROM XZ
26 xz(1) files are split into streams and blocks. Most xz files contain
27 only one stream which contains one or more blocks. You can find out
28 how many streams and blocks are in an xz file by doing:
29
30 $ xz --list winxp.img.xz
31 Strms Blocks Compressed Uncompressed Ratio Check Filename
32 1 1 2,100.0 MiB 6,144.0 MiB 0.342 CRC64 winxp.img.xz
33 ↑↑↑ ↑↑↑
34 streams blocks
35
36 xz files are seekable on block boundaries only. Seeking is done by
37 seeking directly to the lower block boundary, then uncompressing data
38 until the precise byte is reached. As uncompressing xz data is slow,
39 to get best random access performance, you must prepare your xz files
40 with many small blocks.
41
42 Use the --block-size option with a small-ish block size. For example
43 this is the same image compressed with a 16 MB block size:
44
45 $ xz --best --block-size=16777216 winxp.img
46 ─────────────────────
47 $ xz --list winxp.img.xz
48 Strms Blocks Compressed Uncompressed Ratio Check Filename
49 1 384 2,120.1 MiB 6,144.0 MiB 0.345 CRC64 winxp.img.xz
50 ↑↑↑
51 blocks
52
53 This file can be accessed randomly. At most 16 MB will have to be
54 uncompressed to seek to any byte.
55
56 As you would expect, xz cannot compress as efficiently when using a
57 smaller block size. The space penalty in the above example is < 1% of
58 the compressed file size.
59
61 [file=]FILENAME.xz
62 Serve the file named "FILENAME.xz".
63
64 This parameter is required.
65
66 "file=" is a magic config key and may be omitted in most cases.
67 See "Magic parameters" in nbdkit(1).
68
69 maxblock=SIZE
70 The maximum block size that the plugin will read. The plugin will
71 refuse to read xz files that contain any block larger than this
72 size.
73
74 See the discussion above about creating xz files with small block
75 sizes in order to reduce memory usage and increase performance.
76
77 This parameter is optional. If not specified it defaults to 512M.
78
79 maxdepth=N
80 Maximum number of blocks stored in the LRU block cache.
81
82 This parameter is optional. If not specified it defaults to 8.
83
84 The plugin may allocate up to maximum block size in file * maxdepth
85 bytes of memory per connection.
86
88 nbdkit(1), nbdkit-plugin(3), xz(1).
89
91 Richard W.M. Jones
92
94 Copyright (C) 2013 Red Hat Inc.
95
97 Redistribution and use in source and binary forms, with or without
98 modification, are permitted provided that the following conditions are
99 met:
100
101 · Redistributions of source code must retain the above copyright
102 notice, this list of conditions and the following disclaimer.
103
104 · Redistributions in binary form must reproduce the above copyright
105 notice, this list of conditions and the following disclaimer in the
106 documentation and/or other materials provided with the
107 distribution.
108
109 · Neither the name of Red Hat nor the names of its contributors may
110 be used to endorse or promote products derived from this software
111 without specific prior written permission.
112
113 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
114 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
115 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
116 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
117 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
118 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
119 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
120 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
121 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
122 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
123 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
124
125
126
127nbdkit-1.11.11 2019-03-29 nbdkit-xz-plugin(1)