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

Windows server websocket connections limitations #1019

Closed
Geckon01 opened this issue Jun 8, 2023 · 2 comments
Closed

Windows server websocket connections limitations #1019

Geckon01 opened this issue Jun 8, 2023 · 2 comments
Labels

Comments

@Geckon01
Copy link

Geckon01 commented Jun 8, 2023

I'm using windows server on my production enveronment. Main question is there any limitations in library for 250~ simultanious connection? I've noticed that my worker will not open any more connection than that.
Or is this the windows limitations?

@jupitern
Copy link

do you have event in php ini?
https://pecl.php.net/package/event/3.0.7RC1/windows

@SimonFrings
Copy link

@Geckon01 This sounds like a limitation to me and I think this has something to do with the amount of sockets you're using at the same time. I researched a little bit and stumbled upon an issue in reactphp/socket which sounds pretty similar to the problem you're describing: reactphp/socket#198. I think there's a lot of input in there which should lead to a conclusion.

To quote @clue from this ticket:

I just stumbled upon https://docs.microsoft.com/en-us/windows/desktop/winsock/maximum-number-of-sockets-supported-2 which suggests FD_SETSIZE defaults to 64 on Windows. I don't have a system to test this on right now, but this would suggest that any program that uses more than 64 sockets (or streams in ReactPHP) would be unable to check all of them on Windows.

On Unix platforms, this constant is usually defined as 1024, so it's much less of a problem here. As an alternative, you might be able to use one of the alternative loop implementations which provide ways to work around this limitation (e.g. using thread-pools to select() no more than 64 sockets per thread ref).

If you're using the default StreamSelectLoop, it may be a good idea to use one of the other loop implementations as per https://github.com/reactphp/event-loop#loop-implementations

I don't know what you're seeing exactly and I'm not sure what defaults you're using on your production environment, I think trying to change FD_SIZE or using a different loop implementation should be a good start to solve this issue.

I believe this should answer your question, so I will close this ticket for now. We can reopen this if you encounter the same issues again after trying out the solutions mentioned in here. If you do need to reopen the ticket, please provide some information about the steps you've taken so far, what worked and what didn't.

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

No branches or pull requests

3 participants