fellow_tune: Remove objsize_hint tunable

The potential impact of changing this parameter to a wrong value is too
high, so we better rely on changes to automatically adjust it (coming
up).

Ref #54
parent d1ef255f
......@@ -32,8 +32,10 @@ struct stvfe_tune {
t n
#include "tbl/fellow_tunables.h"
size_t memsz;
// constructor arguments
size_t dsksz;
size_t memsz;
size_t objsize_hint;
};
const char * stvfe_tune_init(struct stvfe_tune *tune,
......
......@@ -45,7 +45,6 @@ TUNE(uint8_t, wait_table_exponent, 10, 6, 32);
TUNE(uint8_t, lru_exponent, 0, 0, 6);
TUNE(unsigned, dsk_reserve_chunks, 4, 2, UINT_MAX);
TUNE(unsigned, mem_reserve_chunks, 1, 0, UINT_MAX);
TUNE(size_t, objsize_hint, 256 * 1024, 4096, SIZE_MAX);
TUNE(size_t, objsize_max, 0, 0, SIZE_MAX);
TUNE(size_t, discard_immediate, 256 * 1024, 4096, SIZE_MAX);
// 31 is safe max for stack usage, further limited by memsz
......
......@@ -51,7 +51,7 @@ vcl storage objects and methods
new xfellow = slash.fellow(STRING filename, BYTES dsksize, BYTES memsize, BYTES objsize_hint, BOOL delete)
STRING xfellow.tune([INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_hint], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
STRING xfellow.tune([INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
STEVEDORE xfellow.storage()
......@@ -68,7 +68,7 @@ vcl functions
STRING tune_buddy(STEVEDORE storage, [INT chunk_exponent], [BYTES chunk_bytes], [INT reserve_chunks], [INT cram])
STRING tune_fellow(STEVEDORE storage, [INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_hint], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
STRING tune_fellow(STEVEDORE storage, [INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
vcl loadmasters (storage routers)
---------------------------------
......@@ -237,9 +237,9 @@ argument.
Memory Cache Sharing
~~~~~~~~~~~~~~~~~~~~
When memory cache sharing with the ``<memsize>[=<storage>]``
syntax is configured, *<memsize>* is used for sanity checking
only. The actual memory size is always that of the referenced storage.
When memory cache sharing with the ``<memsize>[=<storage>]`` syntax is
configured, *<memsize>* is ignored. The actual memory size is always
that of the referenced storage.
LRU with memory cache sharing is cooperative. Whenever memory is
needed by any storage, all storages using the shared cache are asked
......@@ -473,10 +473,16 @@ actual figures are output at startup as ``fellow: metadata (bitmap)
memory``.
*objsize_hint* (default 256KB) is used to sanity check *memsize* in
relation to *dsksize*. It should be set to a value lower than the
average object size (actual or expected). If *memsize* is configured
too low with respect to *dsksize* and *objsize_hint*, a higher value
will be used (which might fail of insufficient memory is available).
relation to *dsksize* and to size the fixed log regions. It should be
set to a value **lower** than the expected average object size. If
*memsize* is configured too low with respect to *dsksize* and
*objsize_hint*, a higher *memsize* value will be used (which might
fail if insufficient memory is available).
For an already populated storage, the configured *memsize* is checked
against the minimum amount of memory required for the actual average
object size. If it is too low, fellow will not start and emit a fatal
error with sizing requirements.
*delete* specifies if the storage is to be emptied.
......@@ -571,8 +577,8 @@ Decreasing ``dsksize``
.. _xfellow.tune():
STRING xfellow.tune([INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT wait_table_exponent], [INT lru_exponent], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_hint], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
STRING xfellow.tune([INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT wait_table_exponent], [INT lru_exponent], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
::
......@@ -586,7 +592,6 @@ STRING xfellow.tune([INT logbuffer_size], [DURATION logbuffer_flush_interval], [
[INT lru_exponent],
[INT dsk_reserve_chunks],
[INT mem_reserve_chunks],
[BYTES objsize_hint],
[BYTES objsize_max],
[INT cram],
[INT readahead],
......@@ -735,16 +740,6 @@ fellow storage can be fine tuned:
The value is capped suck that the number of reserved chunks times
the chunk size does not exceed 1/8 of the memory size.
* *objsize_hint*
- unit: bytes
- default: 256KB
- minimum: 4KB
specifies an estimate of the average object size in cache. It is
used to (re)size the fixed log space. The value should be chosen as
a safe *lower* bound of average object size.
* *objsize_max*
- unit: bytes
......@@ -953,8 +948,8 @@ Restricted to: ``vcl_init``.
.. _slash.tune_fellow():
STRING tune_fellow(STEVEDORE storage, [INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT wait_table_exponent], [INT lru_exponent], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_hint], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
STRING tune_fellow(STEVEDORE storage, [INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT wait_table_exponent], [INT lru_exponent], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
::
......@@ -969,7 +964,6 @@ STRING tune_fellow(STEVEDORE storage, [INT logbuffer_size], [DURATION logbuffer_
[INT lru_exponent],
[INT dsk_reserve_chunks],
[INT mem_reserve_chunks],
[BYTES objsize_hint],
[BYTES objsize_max],
[INT cram],
[INT readahead],
......
......@@ -36,7 +36,7 @@ vcl storage objects and methods
new xfellow = slash.fellow(STRING filename, BYTES dsksize, BYTES memsize, BYTES objsize_hint, BOOL delete)
STRING xfellow.tune([INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_hint], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
STRING xfellow.tune([INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
STEVEDORE xfellow.storage()
......@@ -53,7 +53,7 @@ vcl functions
STRING tune_buddy(STEVEDORE storage, [INT chunk_exponent], [BYTES chunk_bytes], [INT reserve_chunks], [INT cram])
STRING tune_fellow(STEVEDORE storage, [INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_hint], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
STRING tune_fellow(STEVEDORE storage, [INT logbuffer_size], [DURATION logbuffer_flush_interval], [REAL log_rewrite_ratio], [INT chunk_exponent], [BYTES chunk_bytes], [INT dsk_reserve_chunks], [INT mem_reserve_chunks], [BYTES objsize_max], [INT cram], [INT readahead], [BYTES discard_immediate], [INT io_batch_min], [INT io_batch_max], [ENUM hash_obj], [ENUM hash_log], [ENUM ioerr_obj], [ENUM ioerr_log], [ENUM allocerr_obj], [ENUM allocerr_log])
vcl loadmasters (storage routers)
---------------------------------
......@@ -525,13 +525,13 @@ $Method STRING .tune( [ INT logbuffer_size ], [ DURATION
chunk_exponent ], [ BYTES chunk_bytes ], [ INT
wait_table_exponent ], [ INT lru_exponent ], [ INT
dsk_reserve_chunks ], [ INT mem_reserve_chunks ], [ BYTES
objsize_hint ], [ BYTES objsize_max ], [ INT cram ], [ INT
readahead ], [ BYTES discard_immediate ], [ INT io_batch_min
], [ INT io_batch_max ], [ ENUM { sha256, xxh32, xxh3_64,
xxh3_128 } hash_obj ], [ ENUM { sha256, xxh32, xxh3_64,
xxh3_128 } hash_log ], [ ENUM { panic, purge } ioerr_obj ], [
ENUM { panic, fail } ioerr_log ], [ ENUM { panic, purge }
allocerr_obj ], [ ENUM { panic, fail } allocerr_log ])
objsize_max ], [ INT cram ], [ INT readahead ], [ BYTES
discard_immediate ], [ INT io_batch_min ], [ INT io_batch_max
], [ ENUM { sha256, xxh32, xxh3_64, xxh3_128 } hash_obj ], [
ENUM { sha256, xxh32, xxh3_64, xxh3_128 } hash_log ], [ ENUM {
panic, purge } ioerr_obj ], [ ENUM { panic, fail } ioerr_log
], [ ENUM { panic, purge } allocerr_obj ], [ ENUM { panic,
fail } allocerr_log ])
Using the `xfellow.tune()`_ method, the following parameters of the
fellow storage can be fine tuned:
......@@ -667,16 +667,6 @@ fellow storage can be fine tuned:
The value is capped suck that the number of reserved chunks times
the chunk size does not exceed 1/8 of the memory size.
* *objsize_hint*
- unit: bytes
- default: 256KB
- minimum: 4KB
specifies an estimate of the average object size in cache. It is
used to (re)size the fixed log space. The value should be chosen as
a safe *lower* bound of average object size.
* *objsize_max*
- unit: bytes
......@@ -881,7 +871,6 @@ $Function STRING tune_fellow(
[ INT lru_exponent ],
[ INT dsk_reserve_chunks ],
[ INT mem_reserve_chunks ],
[ BYTES objsize_hint ],
[ BYTES objsize_max ],
[ INT cram ],
[ INT readahead ],
......
......@@ -38,10 +38,6 @@ varnish v1 \
set resp.http.e = slash.tune_fellow(storage.fellow, mem_reserve_chunks =
std.integer(req.http.mem-reserve-chunks));
}
else if (req.http.objsize-hint) {
set resp.http.e = slash.tune_fellow(storage.fellow, objsize_hint =
std.bytes(req.http.objsize-hint));
}
else {
set resp.http.e = "Unknown tunable header";
}
......@@ -243,24 +239,12 @@ client c6 -repeat 1 {
expect resp.body == "Value of mem_reserve_chunks must not be negative"
} -start
client c7 -repeat 1 {
txreq -url "/tune" -hdr "objsize-hint: 1MB"
rxresp
expect resp.status == 200
expect resp.body == ""
txreq -url "/tune" -hdr "objsize-hint: 1KB"
rxresp
expect resp.status == 400
expect resp.body == "Value of objsize_hint is too small, minimum is 4096"
} -start
client c1 -wait
client c2 -wait
client c3 -wait
client c4 -wait
client c5 -wait
client c6 -wait
client c7 -wait
varnish v1 -vcl {
backend none none;
......
......@@ -39,10 +39,6 @@ varnish v1 \
set resp.http.e = slash.tune_fellow(storage.fellow, mem_reserve_chunks =
std.integer(req.http.mem-reserve-chunks));
}
else if (req.http.objsize-hint) {
set resp.http.e = slash.tune_fellow(storage.fellow, objsize_hint =
std.bytes(req.http.objsize-hint));
}
else {
set resp.http.e = "Unknown tunable header";
}
......@@ -248,24 +244,12 @@ client c6 -repeat 1 {
expect resp.body == "Value of mem_reserve_chunks must not be negative"
} -start
client c7 -repeat 1 {
txreq -url "/tune" -hdr "objsize-hint: 1MB"
rxresp
expect resp.status == 200
expect resp.body == ""
txreq -url "/tune" -hdr "objsize-hint: 1KB"
rxresp
expect resp.status == 400
expect resp.body == "Value of objsize_hint is too small, minimum is 4096"
} -start
client c1 -wait
client c2 -wait
client c3 -wait
client c4 -wait
client c5 -wait
client c6 -wait
client c7 -wait
varnish v1 -vcl {
backend none none;
......
......@@ -40,10 +40,6 @@ varnish v1 -arg "-jnone -p debug=+vclrel -p vsl_mask=+expkill" -vcl {
set resp.http.e = fellow.tune(mem_reserve_chunks =
std.integer(req.http.mem-reserve-chunks));
}
else if (req.http.objsize-hint) {
set resp.http.e = fellow.tune(objsize_hint =
std.bytes(req.http.objsize-hint));
}
else {
set resp.http.e = "Unknown tunable header";
}
......@@ -251,21 +247,9 @@ client c6 -repeat 1 {
expect resp.body == "Value of mem_reserve_chunks must not be negative"
} -start
client c7 -repeat 1 {
txreq -url "/tune" -hdr "objsize-hint: 1MB"
rxresp
expect resp.status == 200
expect resp.body == ""
txreq -url "/tune" -hdr "objsize-hint: 1KB"
rxresp
expect resp.status == 400
expect resp.body == "Value of objsize_hint is too small, minimum is 4096"
} -start
client c1 -wait
client c2 -wait
client c3 -wait
client c4 -wait
client c5 -wait
client c6 -wait
client c7 -wait
......@@ -40,10 +40,6 @@ varnish v1 -arg "-jnone -p debug=+vclrel -p vsl_mask=+expkill" -vcl {
set resp.http.e = fellow.tune(mem_reserve_chunks =
std.integer(req.http.mem-reserve-chunks));
}
else if (req.http.objsize-hint) {
set resp.http.e = fellow.tune(objsize_hint =
std.bytes(req.http.objsize-hint));
}
else {
set resp.http.e = "Unknown tunable header";
}
......@@ -249,24 +245,12 @@ client c6 -repeat 1 {
expect resp.body == "Value of mem_reserve_chunks must not be negative"
} -start
client c7 -repeat 1 {
txreq -url "/tune" -hdr "objsize-hint: 1MB"
rxresp
expect resp.status == 200
expect resp.body == ""
txreq -url "/tune" -hdr "objsize-hint: 1KB"
rxresp
expect resp.status == 400
expect resp.body == "Value of objsize_hint is too small, minimum is 4096"
} -start
client c1 -wait
client c2 -wait
client c3 -wait
client c4 -wait
client c5 -wait
client c6 -wait
client c7 -wait
# unconfigure fellow
varnish v1 -vcl {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment