With node & express framework, we can create a little cluster for a little stability
Setup nginx load balancer by following configuration in /etc/nginx/nginx.conf
upstream nginx_backend {
server app1:3000 fail_timeout=30s max_fails=2;
server app2:3000 fail_timeout=30s max_fails=2;
server app3:3000 fail_timeout=30s max_fails=2;
}
server {
resolver 127.0.0.11 valid=30s;
location / {
proxy_pass http://nginx_backend;
}
}
- easy to setup
- lightweight
- start up quick
- can be slow
- nginx free version is not good