-
Notifications
You must be signed in to change notification settings - Fork 27
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
Express Clustering #137
Comments
Why not using ZeroMQ? |
That is definitely something we can look into for going server-to-server. I was just planning on using Redis but if you have some good reasons why we should use that instead I'd be open to it. For now we are trying to keep things simple so anyone using spark-server only has to install spark-server to run it. I don't want them to have to spin up a MongoDB and ZeroMQ if they don't really need the extra services. |
Usually i use redis to share sessions cross web servers in php and store sensors data for time series. |
Alright, I did a bit of digging ZeroMQ it is. Thanks for the suggestion. In order to implement this we need to make sure that the spark-server will work with or without a ZeroMQ service running in the background. |
In our solution we use RabbitMQ as a Messaging Server, especially to provide a "Bumper" between our different Components. The Spark-API es a good example. You can use the API Perfect for commands, but it's problematic for events, cause if you update your Component you will lose Events as long as your connection to the SparkServer is not reestablished. I can provide a sample and documentation for this. I could also implement such a solution but i need a little help ;) to know at which place to implement such an extension. I Think there is no need to replace the complete API with a message queue. I Prefer RabbitMQ cause administration and production management is very good, and there are also very good Images to directly build as solution using Docker. https://hub.docker.com/_/rabbitmq/ To store data between Instances REDIS is a good and stable solution (i already implement such solutions). |
Did anyone ever get things working with a message bus? I can’t remember. |
Yep. We are using our fork, also for production. |
Awesome, I had someone ask about multi-server scaling. How many devices are you running? |
We are currently testing in our own enviroment (40-50 Devices). Real Live is planned starting next year 10.000 -> 100.000). We are running different spark_servers (managing 10-20 Devices in our demo) and a single RabbitMQ. |
Me no, |
@haeferer - check out https://github.com/Brewskey/particle-collider if you'd like to test the scaling. So you always reconnect the device to the same server? Aren't you worried about a case where you need to take a server down for maintenance? |
The loadbalancer will handle this Szenario. |
@jlkalberer Just a shy question - is clustering on a roadmap? We run the server with 400 devices (roughly half online) and sometimes it eats up all server CPU, slowing down the response. Possibility to spread the load over more processors/cores would be great.. Just asking, I know you are busy.. |
No, we aren't looking to add it. I tried to get it working a while back and ran into issues with the way we're dispatching events. We didn't change this much from the original I don't think you should be seeing issues with only 400 devices. There are other people using a single server with close to 1000. Are you calling a lot of functions/variables/webhooks? |
Thank you for the answer. There are not many calls, but they often come in batch of 10+ (when loading data from device). No webhooks, no variables. I will work it out. Thanks again.
—
Dalibor Farny
…--- original message ---
On Mon, May 21, 2018 at 11:36 pm, <[email protected]> John Kalberer wrote:
No, we aren't looking to add it. I tried to get it working a while back and ran into issues with the way we're dispatching events. We didn't change this much from the original spark-server so there are problems :/
I don't think you should be seeing issues with only 400 devices. There are other people using a single server with close to 1000.
Are you calling a lot of functions/variables/webhooks?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
--- end of original message ---
|
Use clustering to improve speed. We will want to do this at the HTTP server and allow it through settings on the COAP server (spark-protocol). We'll need a singleton way of passing events so you'll need to update EventPublisher (or whatever it is) to send data between the forks.
This should be really easy to implement on spark-server since we're stateless - https://github.com/Flipboard/express-cluster
The text was updated successfully, but these errors were encountered: