mirror of
https://github.com/Zygo/bees.git
synced 2025-06-17 01:56:16 +02:00
subvol-threads: increase resource and thread limits
With kernel 4.14 there is no sign of the previous LOGICAL_INO performance problems, so there seems to be no need to throttle threads using this ioctl. Increase the FD cache size limits and scan thread count. Let the kernel figure out scheduling. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
15
src/bees.cc
15
src/bees.cc
@ -19,6 +19,10 @@
|
||||
#include <linux/fs.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
// setrlimit
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <getopt.h>
|
||||
|
||||
using namespace crucible;
|
||||
@ -647,6 +651,17 @@ bees_main(int argc, char *argv[])
|
||||
BEESLOG("using relative path " << relative_path() << "\n");
|
||||
}
|
||||
|
||||
BEESLOG("setting rlimit NOFILE to " << BEES_OPEN_FILE_LIMIT);
|
||||
|
||||
struct rlimit lim = {
|
||||
.rlim_cur = BEES_OPEN_FILE_LIMIT,
|
||||
.rlim_max = BEES_OPEN_FILE_LIMIT,
|
||||
};
|
||||
int rv = setrlimit(RLIMIT_NOFILE, &lim);
|
||||
if (rv) {
|
||||
BEESLOG("setrlimit(RLIMIT_NOFILE, { " << lim.rlim_cur << " }): " << strerror(errno));
|
||||
};
|
||||
|
||||
// Create a context and start crawlers
|
||||
bool did_subscription = false;
|
||||
while (optind < argc) {
|
||||
|
Reference in New Issue
Block a user