From 9bf3ec8cd48c835e02ff96cd97d1581b2f9ba5b3 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Mon, 30 Jun 2014 22:50:14 +0100 Subject: Implemented rate limiter. Fixes #12. --- src/bindfs.1 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/bindfs.1') diff --git a/src/bindfs.1 b/src/bindfs.1 index b183a78..8ed5d2f 100644 --- a/src/bindfs.1 +++ b/src/bindfs.1 @@ -204,6 +204,23 @@ The read/write permissions are checked against the (possibly modified) file permissions inside the mount. +.SH RATE LIMITS +Reads and writes through the mount point can be throttled. Throttling works +by sleeping the required amount of time on each read or write request. +Throttling imposes one global limit on all readers/writers as opposed to a +per-process or per-user limit. + +Currently, the implementation is not entirely fair. See \fB\%BUGS\fP below. + +.TP +.B \-\-read\-rate=\fIN\fP, \-o read\-rate=\fIN\fP +Allow at most \fIN\fP bytes per second to be read. \fIN\fP may have one of the +following (1024-based) suffixes: \fBk\fP, \fBM\fP, \fBG\fP, \fBT\fP. + +.TP +.B \-\-write\-rate=\fIN\fP, \-o write\-rate=\fIN\fP +Same as above, but for writes. + .SH MISCELLANEOUS OPTIONS .TP @@ -375,6 +392,13 @@ This may constitute a security risk if you rely on bindfs to reduce permissions on new files. For this reason, as of version 1.11 bindfs runs in single-threaded mode by default. +Rate limiting favors the process with the larger block size. +If two processes compete for read/write access, the one whose read()/write() +calls specify the larger block size gets to read/write faster. +The total rate limit is maintained though, and clients with equal block sizes +and a similar rate of requests are treated fairly as long as the kernel orders +their requests fairly. + Please report bugs and/or send pull requests to \fBhttps://github.com/mpartel/bindfs/issues\fP. -- cgit v1.2.3