Advertisement
chadjoan

Hugin Laptop /etc/modprobe.d/zfs.conf

Feb 14th, 2023
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1.  
  2. # To print a list of zfs parameters, use this command:
  3. # modinfo zfs
  4. #
  5. # Tweaker links:
  6. # https://wiki.freebsd.org/ZFSTuningGuide
  7. # https://icesquare.com/wordpress/how-to-improve-zfs-performance/
  8. # https://www.freebsd.org/doc/handbook/zfs-advanced.html
  9.  
  10. # This is tuned for my Toughbook with 16GB RAM.
  11. # 512MB min, 2048MB max (approximately)
  12. # RAM is super scarce right now and browsers tend to chew through it like
  13. # nobody's business (it's 2021 now, and it keeps getting worse).
  14. # If the ARC is mostly being used for cached disk I/O, then I think it might
  15. # have a poor cost-to-benefit ratio in my workflow, which is mostly web
  16. # browsing, text editing, and playing media. I'm not on a webserver where
  17. # randos from the internet are all going to be asking for the SAME resource
  18. # over and over. Rather, I'll be doing something novel all the time, because
  19. # my gray matter already provides some soft-cache. The ARC is thus slightly
  20. # redundant. It'd still be helpful perhaps, but it comes at an enormous cost:
  21. # causing my browsers to page A TON and possibly forcing a bunch of in-kernel
  22. # disk-I/O and other mysterious hard-to-profile operations. So I'm going to
  23. # try limiting the ARC and see if we can take memory pressure off of other
  24. # parts of the system. I also prefer to have a little latency when I read
  25. # coldbits off the disk, than to have ARC and Chrome/Firefox constantly
  26. # battling for RAM while constantly churning coldbits without my knowledge
  27. # or request. I'm not sure if that's happening, but it'd make sense, and it
  28. # would be very non-consensual and rude. Hopefully, by asserting myself here,
  29. # we can get some sanity back. Maybe. We'll see.
  30. options zfs zfs_arc_min=512004096
  31. options zfs zfs_arc_max=2048004096
  32.  
  33. # Flush transaction groups every 2 second.
  34. # The default is probably higher, like 5 or 30. (Hard to tell which; there
  35. # seem to be differences between OSes, or even just what articles report.)
  36. # In principle, lowering this will cause it to write to disk in smaller,
  37. # more frequent, bursts. Raising it causes bursts of intense disk I/O, but
  38. # it happens less frequently. For servers, bursting might benefit from
  39. # economics of scale and thus be slightly more efficient.
  40. # For a desktop environment where responsiveness is more important than
  41. # throughput, I suspect that lowering this could thus help with occasional
  42. # stalling: we are effectively forcing it to interleave its disk activity
  43. # with everything else we are doing by placing a soft-cap on the amount
  44. # of spurious disk activity it can save up and dump on us all at once.
  45. options zfs zfs_txg_timeout=1
  46.  
  47. # I'm going to try turning off prefetching.
  48. # I'm not confident that this will help. It could always suck.
  49. # Prefetching tries to anticipate what disk sectors a program is going to
  50. # read before it reads them. This is neat if it can do so *well*. I'm skeptical.
  51. # For random I/O, which is more like what I do, it will probably have, like the
  52. # ARC, a poor cost-to-benefit ratio.
  53. # The cost is that if I'm doing a lot of random reads, then it might try to
  54. # grab a bunch of extra stuff EVERY TIME, thus multiplying the number of
  55. # reads performed. The hypothesis then looks like this: the system envisions
  56. # needing to do a bunch of reads (it doesn't), then the system becomes I/O
  57. # bound (and it doesn't necessarily appear in iotop because it could be
  58. # compression/encryption time in CPU or kernel threads), then the system
  59. # tries to prefetch based on new read requests in order to reduce I/O
  60. # pressure, thus issuing more read requests, and it all goes pear-shaped.
  61. # Thus, if we take this to its logical extreme, then it could explain some
  62. # of the nasty stalling and live-locking type of activity that's going on
  63. # in the system.
  64. options zfs zfs_prefetch_disable=1
  65.  
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement