websockproxy
websockproxy copied to clipboard
Disable throttling?
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?
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.
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.
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.
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.
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 :cry: )
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 :thinking: )