summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-13 16:41:26 +0200
committerSimon Rettberg2021-04-14 13:17:59 +0200
commit0be00336f97a7ef3590ee803d4ad19e305aa1583 (patch)
treeb00b91b8c6d687ad4116405818e2cecb3e6cf44b /pkg
parent[CLIENT] Use SO_GETPEERCRED instead of braindead setuid crap (diff)
downloaddnbd3-0be00336f97a7ef3590ee803d4ad19e305aa1583.tar.gz
dnbd3-0be00336f97a7ef3590ee803d4ad19e305aa1583.tar.xz
dnbd3-0be00336f97a7ef3590ee803d4ad19e305aa1583.zip
[SERVER] Make prefetching synchronous
There is a race condition where we process the next request from the same client faster than the OS will schedule the async prefetch job, rendering it a NOOP in the best case (request ranges match) or fetching redundant data from the upstream server (prefetch range is larger than actual request by client). Make prefetching synchronous to prevent this race condition.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/config/server.conf2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/config/server.conf b/pkg/config/server.conf
index 5f0b2a0..95a71db 100644
--- a/pkg/config/server.conf
+++ b/pkg/config/server.conf
@@ -48,6 +48,8 @@ maxClients=2000
maxImages=1000
maxPayload=9M
maxReplicationSize=150G
+; Maximum number of bytes to prefetch when relaying client request to upstream server
+maxPrefetch=256k
; Log related config
[logging]