Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to add options for configuring the IO scheduler for NixOS #57577

Closed
CMCDragonkai opened this issue Mar 13, 2019 · 11 comments
Closed

Request to add options for configuring the IO scheduler for NixOS #57577

CMCDragonkai opened this issue Mar 13, 2019 · 11 comments

Comments

@CMCDragonkai
Copy link
Member

Right now there's no option for NixOS users to configure the IO schedulers for the disk block devices.

To do this right now, one has to write an activation script that iterates over each block device and sets the IO scheduler.

Something like this:

    system.activationScripts.diskScheduler = ''
      for path in "''${disks[@]}"; do
        echo noop >/sys/block/$(
          ${pkgs.coreutils}/bin/basename $(
            ${pkgs.coreutils}/bin/readlink -f $path
          )
        )/queue/scheduler
      done
    '';

It would be really nice and robust, if NixOS had dedicated option to do this. It would have to be configurable on each block device. So it would not correspond to the fileSystems option. Instead it would be more closer to the swapDevices option. Perhaps we should have a blockDevices option in general that organises all the options relating to connected block devices (which would have to be separate from udev like devices).

@CMCDragonkai CMCDragonkai changed the title Request to add options for configuring the IO scheduler Request to add options for configuring the IO scheduler for NixOS Mar 13, 2019
@tadfisher
Copy link
Contributor

The proper way to do this is to use udev.

For example, this is in my configuration:

  services.udev.extraRules = ''
    ACTION=="add|change", KERNEL=="[sv]d[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"
  '';

@worldofpeace
Copy link
Contributor

Maybe we should have option, just because it's such a common thing, that generates a udev rule like the one mentioned?

@CMCDragonkai
Copy link
Member Author

We need to be allowed to set the IO scheduler for different devices differently. I suggest 2 kinds of settings, one that allows us to set it to be the same for all (any block device), another that sets individual ones. They can be combined so that you can set the scheduler for all, and then individual override it for specific devices.

@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@Atemu
Copy link
Member

Atemu commented Jun 3, 2020

Still important to me.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@stale
Copy link

stale bot commented Dec 1, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 1, 2020
@fadenb
Copy link
Contributor

fadenb commented Dec 1, 2020

I think this still would be a nice functionality.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 1, 2020
@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Dec 15, 2020

For Linux 5.0, this should now be set to use none rather than noop. The none is the equivalent of noop, as there's no more noop.

This is quite important for using ZFS to prevent using other IO schedulers with ZFS.

When ZFS is given the full disk it would originally set it to noop automatically. But now apparently it doesn't work given that noop doesn't exist on Linux 5.0.

@stale
Copy link

stale bot commented Jun 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 16, 2021
@Atemu
Copy link
Member

Atemu commented Jun 16, 2021

Still important to me.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 16, 2021
@gshpychka
Copy link
Contributor

This should be closed - hardware.block.scheduler exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants