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

Disable throttling? #4

Open
andrakis opened this issue Jan 29, 2017 · 5 comments
Open

Disable throttling? #4

andrakis opened this issue Jan 29, 2017 · 5 comments

Comments

@andrakis
Copy link

Hello,

The Docker image is working great, nice and easy to get going, quite liking. But I'd like to know how to disable the bandwidth throttler (I'm running on my local network.)

At the moment I've managed to find the file throttle.py in my /var/lib/docker/aufs/diff/... directory. I modified the throttler so that it sends as fast as possible, and this is working for me.

I suspect there might be a better way of doing this. Are you able to explain the best way to disable throttling?

@benjamincburns
Copy link
Owner

Should be a command line arg or config item. This code is a bit of a hack, could use a bunch of clean-up on things like that. Will look into it when I have some time unless someone decides to do it for me.

@benjamincburns
Copy link
Owner

benjamincburns commented Jan 30, 2017

FWIW, I started working on a rewrite of this in nodejs, but this was during the nodejs/io.js split, and it required patches to the node file I/O API. Now that io.js has been merged (and I think my patch was accepted) I may just dust that one off instead.

@andrakis
Copy link
Author

Hello,

Having needed to implement the throttling disable again, I thought it might be useful to show the relevant one line change in limiter.py:

diff --git a/limiter.py b/limiter.py
index 1abf8bb..c31fbfd 100644
--- a/limiter.py
+++ b/limiter.py
@@ -9,6 +9,8 @@ class RateLimitingState(object):
         self.last_check = time.time()

     def do_throttle(self, message):
+       return True
+
         current = time.time()
         time_passed = current - self.last_check

My personal custom version adds a flag, enabled, which makes this a bit prettier, however the above patch is all that is actually required.

@bsapwindows
Copy link

bsapwindows commented Jun 6, 2018

Hi @andrakis , not sure if you are still around. About throttling, may I ask what's the maximum speed did you get after you disabled it? Mine relay is not getting faster, it's roughly 10KB/s to 60KB/s when I wget a binary file from Linode server, that's not so different from throttling... Do you have any idea what's causing this? Thanks in advance.

@tennox
Copy link

tennox commented Mar 13, 2023

I found the nodejs implementation to be a bit faster

docker run -it --privileged -p 8080:80 krishenriksen/node-relay:latest

(got to ~500KB/s vs ~60KB/s on the bellenottelling/websockproxy)
But still quite a bit from 5000KB/s I get on the host OS 😢 )

Also found this go port - but did not manage to get it to work (doesn't seem to be a drop-in replacement - or I'm doing something wrong 🤔 )

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

No branches or pull requests

4 participants