Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / radosgw / compression.rst
1 ===========
2 Compression
3 ===========
4
5 .. versionadded:: Kraken
6
7 The Ceph Object Gateway supports server-side compression of uploaded objects,
8 using any of Ceph's existing compression plugins.
9
10
11 Configuration
12 =============
13
14 Compression can be enabled on a Zone's placement target by providing the
15 ``--compression=<type>`` option to the ``radosgw-admin zone placement modify``
16 command.
17
18 The compression ``type`` refers to the name of the compression plugin to use
19 when writing new object data. Each compressed object remembers which plugin
20 was used, so changing this setting does not hinder the ability to decompress
21 existing objects, not does it force existing objects to be recompressed.
22
23 This compression setting applies to all new objects uploaded to buckets using
24 this placement target. Compression can be disabled by setting the ``type`` to
25 an empty string or ``none``.
26
27 For example::
28
29   $ radosgw-admin zone placement modify --rgw-zone=default --placement-id=default-placement --compression=zlib
30   {
31   ...
32       "placement_pools": [
33           {
34               "key": "default-placement",
35               "val": {
36                   "index_pool": "default.rgw.buckets.index",
37                   "data_pool": "default.rgw.buckets.data",
38                   "data_extra_pool": "default.rgw.buckets.non-ec",
39                   "index_type": 0,
40                   "compression": "zlib"
41               }
42           }
43       ],
44   ...
45   }
46
47 .. note:: A ``default`` zone is created for you if you have not done any
48    previous `Multisite Configuration`_.
49
50
51 Statistics
52 ==========
53
54 While all existing commands and APIs continue to report object and bucket
55 sizes based their uncompressed data, compression statistics for a given bucket
56 are included in its ``bucket stats``::
57
58   $ radosgw-admin bucket stats --bucket=<name>
59   {
60   ...
61       "usage": {
62           "rgw.main": {
63               "size": 1075028,
64               "size_actual": 1331200,
65               "size_utilized": 592035,
66               "size_kb": 1050,
67               "size_kb_actual": 1300,
68               "size_kb_utilized": 579,
69               "num_objects": 104
70           }
71       },
72   ...
73   }
74
75 The ``size_utilized`` and ``size_kb_utilized`` fields represent the total
76 size of compressed data, in bytes and kilobytes respectively.
77
78
79 .. _`Multisite Configuration`: ../multisite