Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
19d333e1
Unverified
Commit
19d333e1
authored
Jul 21, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and properly document reserve limits
Could have caused #5, related to #10
parent
40a4b16e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
fellow_tune.c
src/fellow_tune.c
+10
-16
vmod_slash.vcc
src/vmod_slash.vcc
+8
-0
fellow_vcl.vtc
src/vtc/fellow_vcl.vtc
+1
-1
No files found.
src/fellow_tune.c
View file @
19d333e1
...
...
@@ -63,21 +63,6 @@ stvfe_tune_check(struct stvfe_tune *tune)
assert
(
tune
->
dsksz
>=
tune
->
memsz
);
#ifdef DOES_THIS_MAKE_SENSE
/* the average object could be quite small, but larger chunks
* could be required, in which case it makes sense for the LRU
* to keep the larger chunks in the reserve
*/
l
=
log2up
(
tune
->
objsize_hint
);
if
(
tune
->
chunk_exponent
>
l
)
{
fprintf
(
stderr
,
"fellow: chunk_exponent limited to %u "
"(next pow2 of objsize_hint)
\n
"
,
l
);
tune
->
mem_reserve_chunks
<<=
(
tune
->
chunk_exponent
-
l
);
tune
->
dsk_reserve_chunks
<<=
(
tune
->
chunk_exponent
-
l
);
tune
->
chunk_exponent
=
l
;
}
#endif
#define CHUNK_SHIFT 10
l
=
log2down
(
tune
->
memsz
);
...
...
@@ -97,7 +82,7 @@ stvfe_tune_check(struct stvfe_tune *tune)
tune
->
chunk_exponent
=
l
;
}
sz
=
tune
->
memsz
>>
(
tune
->
chunk_exponent
-
1
);
sz
=
tune
->
memsz
>>
(
tune
->
chunk_exponent
+
3
);
assert
(
sz
<=
UINT_MAX
);
l
=
(
unsigned
)
sz
;
if
(
tune
->
mem_reserve_chunks
>
l
)
{
...
...
@@ -106,6 +91,15 @@ stvfe_tune_check(struct stvfe_tune *tune)
tune
->
mem_reserve_chunks
=
l
;
}
sz
=
tune
->
dsksz
>>
(
tune
->
chunk_exponent
+
3
);
assert
(
sz
<=
UINT_MAX
);
l
=
(
unsigned
)
sz
;
if
(
tune
->
dsk_reserve_chunks
>
l
)
{
fprintf
(
stderr
,
"fellow: dsk_reserve_chunks limited to %u "
"(less than 1/8 of disk size)
\n
"
,
l
);
tune
->
dsk_reserve_chunks
=
l
;
}
//lint --e{685,568} misc const comparisons
#define TUNE(t, n, d, min, max) \
if (tune->n < (min)) \
...
...
src/vmod_slash.vcc
View file @
19d333e1
...
...
@@ -529,6 +529,7 @@ fellow storage can be fine tuned:
- unit: scalar
- default: 4
- minimum: 2
- maximum: dsksize / 8 / chunk_bytes
specifies a number of chunks to reserve on disk. The reserve is used
to fulfill storage requests when storage is otherwise full. Because
...
...
@@ -538,11 +539,15 @@ fellow storage can be fine tuned:
fixed log space is full, might momentarily require additional space
before making room.
The value is capped suck that the number of reserved chunks times
the chunk size does not exceed 1/8 of the disk size.
* *mem_reserve_chunks*
- unit: scalar
- default: 1
- minimum: 0
- maximum: memsize / 8 / chunk_bytes
specifies a number of chunks to reserve in memory. The reserve is
used to provide memory for new objects or objects staged from disk
...
...
@@ -550,6 +555,9 @@ fellow storage can be fine tuned:
latencies in these situations at the expense of some memory
unavailable for caching.
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
...
...
src/vtc/fellow_vcl.vtc
View file @
19d333e1
...
...
@@ -12,7 +12,7 @@ varnish v1 -arg "-p debug=+vclrel -p vsl_mask=+expkill" -vcl {
dsksize = 100MB,
memsize = 1MB,
objsize_hint = 64KB);
fellow.tune(chunk_bytes = 256KB);
fellow.tune(chunk_bytes = 256KB
, mem_reserve_chunks = 999999, dsk_reserve_chunks = 99999
);
fellow.as_transient();
}
sub vcl_synth {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment