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

Limits #35

Closed
sm2017 opened this issue Nov 30, 2017 · 8 comments
Closed

Limits #35

sm2017 opened this issue Nov 30, 2017 · 8 comments
Labels

Comments

@sm2017
Copy link

sm2017 commented Nov 30, 2017

@walkor if we have many powerful machines
How many gateway and business worker can exist in workerman system ??

If we choose libevent or event as main event loop

@walkor
Copy link
Owner

walkor commented Nov 30, 2017

Generally speaking , For each machine
gateway->count = the_count_of_cpu_for_current_machine;
and
business->count = the_count_of_cpu_for_current_machine*2;
is the recommended value.

@sm2017
Copy link
Author

sm2017 commented Nov 30, 2017

No I ask about connection limits . As you know each gateway is connected to business workers and vise versa . So if we increase gateways each business worker must handle more connections

My question is about distributed system

@walkor
Copy link
Owner

walkor commented Dec 1, 2017

In theory, the number of gateway processes can't exceed 1000, and business can't exceed 60000 In the whole distributed system.
In fact, I think the best number of gateway processes is less than 200, and business is around 200-600 In the whole distributed system.
I don't have so many servers, so the above data is my guess value.

@sm2017
Copy link
Author

sm2017 commented Dec 1, 2017

Can you explain why??

In theory, the number of gateway processes can't exceed 1000, and business can't exceed 60000

How you calculate 1000? And 60000?
If we use select we have a 1024 limitation but for event and libevent the limit is 100k (if I'm wrong correct me)

Please explain in details .Please check your Gitter , I want to chat you

@walkor
Copy link
Owner

walkor commented Dec 1, 2017

src/Lib/Gateway.php called stream_select in getBufferFromAllGateway method which limit gateway process count can not exceed 1000. Of course, this can be changed to use event to process.

About business count , 60000 is not inaccurate. It is limited by open files of linux kernel configuration maybe 65535 or other values.

@sm2017
Copy link
Author

sm2017 commented Dec 1, 2017

To handling 100 million concurrent connection , is there any recommendation?

@sm2017
Copy link
Author

sm2017 commented Dec 6, 2017

@walkor please reply

@walkor
Copy link
Owner

walkor commented Dec 8, 2017

Don't put all 100 million connections in the same cluster.
You can scatter connections in multiple clusters.
There is no business communication between clusters is better.

@walkor walkor closed this as completed Aug 18, 2018
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
@walkor @sm2017 and others