• badmin@lemmy.today
    link
    fedilink
    arrow-up
    2
    ·
    17 days ago

    There is an ancient fully user-space simple tool called netbrake that works by LD_PRELOADING a library that overrides some functions like recv/sendto (similar to eatmydata’s approach*). It may just work if you don’t have special requirements. If you’re curious, you can see the full list of overridden symbols with:

    readelf -s /path/to/libnetbrake.so | grep -v UND
    

    If you want a possibly fail-safe (kernel level) solution, you may find with a web search a helpful approach combining tc with cgroups.

    Neither solutions need systemd.


    * The realization that people growing up with SSD’s probably never heard of eatmydata just sunk in.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      17 days ago

      Thanks for the tip. I will look into it. My use case would be to limit download speed for applications that do not have such a setting (such as Firefox, just an example).

      • badmin@lemmy.today
        link
        fedilink
        arrow-up
        1
        ·
        17 days ago

        such as Firefox

        You can use the cliget extension which generates full CLI commands for major CLI tools. Such tools have many options (e.g. curl’s --rate-limit).

        • thingsiplay@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          16 days ago

          Firefox was just one example of tool that doesn’t provide a limit by itself. I’m looking for a solution that could be applied to any program.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      15 days ago

      Hey, I wanted to thank you. Just tried netbrake and it is exactly what I was looking for, for years! How is it that I never came across this tool, no one else ever suggested it. Thank you, this really solved the long standing issue. Have a nice day.