[#1060] blobstor: allow to disable compression based on content-type

For some data compression makes little sense, as it is already compressed.
This commit allows to leave such data unchanged based on `Content-Type`
attribute. Currently exact, prefix and suffix matching are supported.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-10 15:46:01 +03:00 committed by Alex Vanin
parent 0f1eb743af
commit 0d969d7a06
11 changed files with 133 additions and 8 deletions

View file

@ -90,6 +90,7 @@ NEOFS_STORAGE_SHARD_0_METABASE_PERM=0644
NEOFS_STORAGE_SHARD_0_BLOBSTOR_PATH=tmp/0/blob
NEOFS_STORAGE_SHARD_0_BLOBSTOR_PERM=0644
NEOFS_STORAGE_SHARD_0_BLOBSTOR_COMPRESS=true
NEOFS_STORAGE_SHARD_0_BLOBSTOR_COMPRESSION_EXCLUDE_CONTENT_TYPES="audio/* video/*"
NEOFS_STORAGE_SHARD_0_BLOBSTOR_DEPTH=5
NEOFS_STORAGE_SHARD_0_BLOBSTOR_SMALL_OBJECT_SIZE=102400
### Blobovnicza config

View file

@ -136,6 +136,9 @@
"path": "tmp/0/blob",
"perm": "0644",
"compress": true,
"compression_exclude_content_types": [
"audio/*", "video/*"
],
"depth": 5,
"small_object_size": 102400,
"blobovnicza": {

View file

@ -146,6 +146,9 @@ storage:
blobstor:
path: tmp/0/blob # blobstor path
compress: true # turn on/off zstd(level 3) compression of stored objects
compression_exclude_content_types:
- audio/*
- video/*
gc:
remover_batch_size: 150 # number of objects to be removed by the garbage collector