search for: init_bucket

Displaying 2 results from an estimated 2 matches for "init_bucket".

2019 Mar 05
0
[PATCH nbdkit] Add new filter for rate-limiting connections.
.../* Maximum capacity of the bucket. */ + uint64_t level; /* How full is the bucket now? */ + struct timeval tv; /* Last time we updated the level. */ +}; + +/* Initialize the bucket structure. Capacity is expressed in + * rate-equivalent seconds. + */ +extern void init_bucket (struct bucket *bucket, + uint64_t rate, double capacity); + +/* Take up to N tokens from the bucket. If we couldn't take N tokens, + * then *N is updated with the number of remaining tokens that we are + * waiting for. Returns the length of time we should sleep (which...
2019 Mar 05
2
[PATCH nbdkit] Add new filter for rate-limiting connections.
For virt-v2v we have been discussing how to limit network bandwidth. The initial discussion has been around how to use cgroups to do this limiting, and that is still probably what we will go with in the end. However this patch gives us another possibility for certain virt-v2v inputs, especially VDDK. We could apply a filter on top of the nbdkit plugin which limits the rate at which it copies