diff options
author | Simon Rettberg | 2018-03-15 22:03:36 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-03-15 22:03:36 +0100 |
commit | 09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82 (patch) | |
tree | a2e936ba7e199badad7b18efa71576203bf5b48b /src/server/globals.h | |
parent | [SERVER] Make TSAN happy (diff) | |
download | dnbd3-09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82.tar.gz dnbd3-09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82.tar.xz dnbd3-09dbfb968c4ef469f4a43dad3b9818fd2ed4ef82.zip |
[SERVER] Experimental support for sparse files in proxy mode
Will not preallocate images in this mode. Old images are only
deleted if the disk is full, determined by write() calls to
the cache file yielding ENOSPC or EDQUOT. In such a case,
the least recently used image(s) will be deleted to free
up at least 256MiB, and then the write() call will be repeated.
This *should* work somewhat reliably unless the cache partition
is ridiculously small. Performance might suffer a little, and
disk fragmentation might occur much faster than in prealloc
mode. Testing is needed.
Diffstat (limited to 'src/server/globals.h')
-rw-r--r-- | src/server/globals.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/server/globals.h b/src/server/globals.h index c1d5d78..d43878f 100644 --- a/src/server/globals.h +++ b/src/server/globals.h @@ -214,6 +214,20 @@ extern bool _backgroundReplication; extern bool _lookupMissingForProxy; /** + * Should we preallocate proxied images right at the start to make + * sure we can cache it entirely, or rather create sparse files + * with holes in them? With sparse files, we just keep writing + * cached blocks to disk until it is full, and only then will we + * start to delete old images. This might be a bit flaky so use + * only in space restricted environments. Also make sure your + * file system actually supports sparse files / files with holes + * in them, or you might get really shitty performance. + * This setting will have no effect if background replication is + * turned on. + */ +extern bool _sparseFiles; + +/** * Port to listen on (default: #define PORT (5003)) */ extern int _listenPort; |