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

Limit number of connections #4

Closed
Hitamashi opened this issue Oct 26, 2017 · 2 comments
Closed

Limit number of connections #4

Hitamashi opened this issue Oct 26, 2017 · 2 comments

Comments

@Hitamashi
Copy link

Hello,

I would like to ask about the number of connections that wstunnel can keep at a same time (for the server side).
I have done some tests and the result shows that it could hold around 500 connections.
Is there a limit in the number of connections that 1 process of wstunnel can hold? Is it set anywhere in the code?

Thanks

@erebe
Copy link
Owner

erebe commented Oct 26, 2017

Hello,
There is no limit regarding the number of connections.
But by default on Linux there is a limit of the maximum of number of file descriptor a process can open at the same time. This limit is by default 1024, which would explains your limit of ~500 connections as wstunnel open 2 file descriptors for every in-coming connections.

To get your current limit just do in a shell a ulimit -a and look at the line
Maximum number of open file descriptors (-n) 1024
to get your current maximum.

to increase the limit just do a ulimit -n 999999 as root in the shell where you launch wstunnel (server and client)

You can try with this setup, run each command in a dedicated shell
sudo -i; ulimit -n 999999; wstunnel --server ws://127.0.0.1:1110
sudo -i; ulimit -n 999999; wstunnel -L 1111:127.0.0.1:1112 ws://localhost:1110
sudo -i; ulimit -n 999999; python2 -m SimpleHTTPServer 1112

and use wrk to inject http request :
sudo -i; ulimit -n 999999; wrk -t10 -c1000 http://127.0.0.1:1111
and you can see that there is no error with the connections.

@erebe erebe closed this as completed Dec 4, 2017
@erebe
Copy link
Owner

erebe commented Dec 4, 2017

closing as no answer

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

No branches or pull requests

2 participants