-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Scaling Parse Server #244
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
Comments
The easiest approach I found so far for scaling NodeJS instance is the following setup: Loadbalancer incl. SSL termination (HAProxy or ELB if on AWS) -- balance between multiple hosts --> NGinX (Gzip & Cache) -- balance between multiple NodeJS instances --> one NodeJS instance per CPU hard bound to a single CPU |
@duergner thanks for the info.. the last stack I built was basically 2 haproxy's (one for fail over) a stack of node.js servers then couchbase as the database. One thing to consider with the node.js stack and a process running on each cpu core is the amount of requests that the actual server can handel, this is where you get deep into sysctrl settings which can be a big pain. I'm personally trying to avoid building this system again due to limited resources on my side but it would be good to hear peoples advice. I might try to set up a aws full stack this weekend and run some benchmarks with Jmeter/Apache Benchmark etc... Also another thing is making sure your database can scale. While not a walk though or full howto this was a decent article posted last about scaling.. http://highscalability.com/blog/2016/1/11/a-beginners-guide-to-scaling-to-11-million-users-on-amazons.html I just hope the parse-server can scale, and on top of that we should all be running profiling tools to see where performance bottle necks are. |
Stupid question: Scaling PS via Heroku ? |
Potential alternative to Heroku.. http://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk |
You can also use google app engine, as they support autoscaling node etc... It would end up being a containerized docker. I am wondering about the statelessness of the system, maybe some data would need to be shared across servers for optimization (memcached/redis) like a cache for active users and sessions etc.. |
@flovilmart I have tried them all, Heroku, GCloud, AWS.. I had such a headache with GCloud and some how spun up several servers etc.. I followed the docs but was a pain.. others might have different opinions. |
@gateway, The doc is pretty bad indeed, but auto scaling is configured in the app.yaml. Would you want an example? |
@flovilmart I'm leaning more towards aws system with maybe mongo db cloud interface to deploy mongo db's into aws that gives me visual overview of the database, backup and scaling.. So Elastic Bean Stalk running some c4.large parse servers, then 2-3 mongodb managed by mongo cloud, with the newrelic plugin to monitor all servers, transaction traces.. etc |
Anyone used cluster in node.js on aws servers? I'm looking at using some c4.large boxes with the elastic beanstalk system and they are specked with 2 vCPU's and since node.js runs on one thread ideally in this case it could launch and use both thread on this box. Any thoughts, feedback or suggestions on if this is a good approach and if show how would one set this up since I never messed with cluster |
@gateway you can use pm2 with cluster mode |
@OliverNicolini could you explain how I would do this, let's say I have 2 cores on a server how would I use this? Also I assuming I need to limit the amount of memory used in the server to make sure the OS can still run. What about if a node.js instance crashes ? |
@gateway {
"apps" : [
{
"name" : "parse-server",
"cwd" : "path/to/parse-server/",
"script" : "index.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"instances" : 2, \\ number of cores,
"max_memory_restart": "100M",
"exec_interpreter" : "node",
"exec_mode" : "cluster",
"autorestart" : true
}
]
} This will spawn 2 instances of your parse server restart them if they reach 100Mb of memory as well as restarting them if they crash. |
@OliverNicolini thanks man! Ill test this out.. is their a rule of thumb on cpu cores and node.js instances? meaning if I have 4, should I do 3 node.js instances to keep one core for the OS? |
I'm building a Java/Kotlin app using the Google cloud api's to provision a Mongo server with persistent disk and node.js servers in an auto-scaling group on Compute Engine. 15% - 40% cheaper on Google cloud than AWS by their numbers, which makes it way cheaper than Heroku, even with a reasonable network egress allowance. |
Is Google Cloud Accessible by China Market? |
Not sure, this article says HTC uses the google cloud everywhere except China where it uses Azure http://www.businessinsider.com.au/htc-chooses-google-cloud-platform-over-amazon-alibaba-2015-6?r=US&IR=T |
Ya, previously i use Google App Engine and found that it don't have accessibility in china, and that's the pain. I wish to know more about accessibility of those cloud/server provider around the world. |
Ok, but will adding more web Dynos on my heroku sever actually scale my Parse server so it can servers more and more requests? |
Would like to know about the statelessness of the parse server too. So that we can deploy multiple parse server instance. :) |
Yeah that should work very well on heroku, the separate instances don't need to share state. |
I am closing this out as we're trying to cut down on the number of non-issues. This will help us focus on the issues that are actively preventing people from migrating their production apps to Parse Server. As an alternative, I suggest opening a new discussion at Server Fault, a Q&A site dedicated to "questions about managing information technology systems in a business environment". |
@hramos I do have to say nobody is really answering anything on Server Fault, its not been really helpful and while I know the parse crew is quite busy it would be nice to have some questions answered, esp when it comes to scaling or running on more than one core. |
@gateway yes but this is also not an 'ISSUE' on parse-server, this applies to anything that is an express app backed by mongodb. |
So with all the new stuff coming out where the team at Parse is converting their GO version of the Parse server to Node.js I would like to hear from the Parse team on
the best way we can scale horizontally. I havent used Node.js in some time and I know their are some packages to help scale but I would like to get some professional advice
on how this would work, how to deploy code across the server, how to deal with cloud code etc.. is it set up to scale?
Here are some things I have found but not personally used.
The idea is to make sure that each serve can handle x amount of requests and you probably need to have a load balancer/s (for fail over) in front to check the health and send the request to each parse server.
Anyhow I'm curious if anyone has any thoughts on this?
The text was updated successfully, but these errors were encountered: