-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Use of Multiple Business Worker in distributed system #83
Comments
Business workers has their own arrays which not be shared each other. |
Hi Walkor, We want to avoid single point of failure so need to understand:
Please help me the above queries. Thanks |
GatewayWorker also support |
Hi walkor, If we are using multiple gateway in different servers then how the connection from client will be distributed to all the gateways. All gateway will have different lanIP and SocketIp.
Thank you |
If there are multiple gateway servers, you need to add a load balancer before the gateway. |
Ok thank you for the prompt reply. According to our implementation we can only run one business worker in one server so if it goes down then how we can initiate it again from the same server or how to initiate another business worker from another server when first BW server goes down. Thank you |
When one business worker goes down the master process will immediately recreates a new available business worker.
GatewayWorker does not have this feature. |
But we are only running one business worker with single process so how it will recreates a new available business worker can you please explain? |
After the workerman starts, it will create two kind of processes: the master process and the child process. The child process is used to process business, and the master process is used to monitor the child process. If a child process goes down and exits, the master process will immediately recreate a new child process. Therefore, if a business worker process goes down and exits, a new business worker process will be generated immediately |
Hi Walkor, Can you please let me know how can I test this functionality to make the child process down and see if master is creating a new BW or not. I have tried by killing the BW but it's not initiating a new BW. Thank you |
Are you using windows? |
I tried in both but no luck. Can you please let me know the steps to check how it generate the BW again? |
Yes, it worked but what if the master business worker goes down. Is there any possibility? |
Master process does not run business code, it is stable enough. Don't worry about it. |
Hi Walkor, We are using multiple gateway in different server and if we kill one gateway from one server the connections are not transferring to server 1 gateway. We are using Mod Proxy Load balancer in Apache. Can you please help me on this? Thank you |
I'm not familiar with |
Ok lets keep it simple we have started a gateway 1 process and it creates master and child process. So when we kill the child process it recreates the child process again but we lost all the connected clients. How can we keep or transfer the connected clients in another gateway running. |
The killing of the business process does not affect the client connection, and all clients still maintain this connection with the gateway process. If the gateway process is killed, all connections will be disconnected and cannot be transferred to other processes. |
HI Walkor, We were running workerman previously and it has some arrays in the ws class but now we are using business worker with 4 instance but all of them have different arrays. We want to keep the arrays same in all the 4 running instances. Can you please help me on that?
Thanks |
PHP cannot share variables directly between processes. You can store arrays in redis so that other processes can read them |
Can I use channel server to update the variables in other instance? https://www.workerman.net/doc/workerman/components/channel-client-on.html |
Yes, you can. |
Can you send me an example how we can update the variables of another instance? |
Hi Walkor, Please send me the example as soon as possible. We have to use multiple instance of business worker one instance is not enough. Thank you |
Hi Walkor,
Currently we are using workerman in our current project and now we want to scale our socket server using GatewayWorker. We are thinking to use multiple gateway and business worker but we are storing clients array and lots of dynamic array on worker start. So my question is if we run multiple business worker then both business worker can share the same arrays or both business workers has their own?
We are populating dynamic array on workerstart from database and it's taking atleast 5min to populate.
Thanks
The text was updated successfully, but these errors were encountered: