Skip to content

Commit

Permalink
Allow to configure virtofsd's --thread-pool-size
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored and astro committed Jun 27, 2024
1 parent a2dbaa2 commit 3692c11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nixos-modules/host/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ in
--socket-group=${config.users.users.microvm.group} \
--shared-dir "$SOURCE" \
--rlimit-nofile ${toString serviceConfig.LimitNOFILE} \
--thread-pool-size `nproc` \
--thread-pool-size ${toString config.microvm.virtiofsd.threadPoolSize} \
--posix-acl --xattr \
${lib.optionalString (config.microvm.virtiofsd.inodeFileHandles != null)
"--inode-file-handles=${config.microvm.virtiofsd.inodeFileHandles}"
Expand Down
9 changes: 9 additions & 0 deletions nixos-modules/host/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@
'';
};

virtiofsd.threadPoolSize = mkOption {
type = with types; oneOf [ str ints.unsigned ];
default = "`nproc`";
description = ''
The amounts of threads virtiofsd should spawn. This option also takes the special
string `\`nproc\`` which spawns as many threads as the host has cores.
'';
};

virtiofsd.extraArgs = mkOption {
type = with types; listOf str;
default = [];
Expand Down

0 comments on commit 3692c11

Please sign in to comment.