9

according to trickle's man page, http://linux.die.net/man/1/trickle i can limit the download speed of a process, e.g.

trickle -u 10 -d 20 ncftp to Launch ncftp(1) limiting its upload capacity to 10 KB/s, and download capacity at 20 KB/s.

how would I go about limiting google-chrome or firefox with trickle?

Edit: For those of you asking why I asked such an obvious question, I tried

trickle -u 10 -d 20 firefox

and I'm getting an error

trickle: Could not reach trickled, working independently: No such file or directory

firefox opens right after, but is definitely not rate limited...

tester
  • 565
  • 8
  • 18
  • 1
    The question belongs on Stackoverflow. It's recursive and never ends. – gparent Apr 03 '12 at 00:57
  • In all seriousness, I don't get it. You're answering yourself in the question. – gparent Apr 03 '12 at 00:57
  • 1
    I tried running `ubuntuone-syncdaemon` through trickle; using the daemon, I get rate limiting, without it, I don't. I wonder if some forking activity in the process leads to this problem ... either way it does seem to be a bug, so I'm not sure why the answer below got accepted. – David Fraser Jul 30 '13 at 10:26

2 Answers2

7

The "error" you're getting is more of a warning/notice than an error. trickle can be run standalone or as a client of trickled. It always looks for the default socket of the daemon and if not found it prints that message. You can safely ignore it.

And about rate limiting Firefox, I'm pretty sure it has to do with the forking of the process, as David Fraser mentioned. You can also see a warning about it in Arch's Wiki, where it says:

Warning: Trickle can only limit traffic of programs that do not fork, so shaping a FTP server's traffic won't really work that way!

In my own experience, I've tried to limit aws-cli tool for S3 upload unsuccessfully, but have been able to limit s3cmd instead. Both tools are written in python, but aws-cli are many different programs bundled through a main one while s3cmd is a single program. I'm guessing the same issue with forking is happening there.

So my short answer is: I don't think you can rate limit those browsers using trickle.

Sebastian Cruz
  • 232
  • 2
  • 6
3

I think the confusion stems from your comprehension of the man page. ncftp is the name of the process being limited, so to limit firefox you would do:

trickle -u 10 -d 20 firefox
gparent
  • 3,561
  • 2
  • 23
  • 28