Questions tagged [pm2]

43 questions
5
votes
0 answers

Nginx load balancer in front of pm2 with nodejs cluster

I'm trying to setup a production environment with a frontend running nginx and a backend with multiple nodejs applications using pm2 for process management. The idea is to allow horizontal scalability on the backend (and optional vertical). Is good…
Jordifreek
  • 51
  • 2
4
votes
0 answers

Nginx, PM2, Node - No 'Access-Control-Allow- Origin' header

I have developed NodeJS server ran with express. I use PM2 to manage the application and then nginx to proxy requests to the application. My Express application has CORS, CSP etc set up. But, the server does not respond in production and fails…
BugHunterUK
  • 331
  • 1
  • 2
  • 10
2
votes
2 answers

Keeping server time in sync using ntpd

I understand ntpd has a -g option to allow a one time immediate clock set for large skews. Then the daemon runs and continuously adjusts. In the event of the skew becoming too large, the daemon exits with an error. With this understanding, is it…
Elliot
  • 121
  • 3
2
votes
1 answer

My Node.JS program running on an internet-facing server is printing impossible text to the stdout log. Have I been compromised?

(EDIT: Turns out the "strange behavior" is explained by a simple oversight. Keeping this question here in case anyone else overlooks it) I hope I am asking this question right. I have a simple web server application set up that does very little. It…
1
vote
1 answer

Calculate pm2 ram consumption on basis of hit or traffic

I have deployed loopback backend application in ec2 instance. I am using Pm2 server. How can I calculate ram and cpu for traffic or hit ?
1
vote
1 answer

pm2-logrotate rotates standard error but not standard output

pm2-logrotate rotates standard error but not standard output. This is the content of ~/.pm2/module_conf.json { "pm2-logrotate": { "max_size": "10M", "retain": "30", "compress": false, "dateFormat":…
Gibezynu
  • 11
  • 3
1
vote
1 answer

Is my docker node application using all available CPUs?

I've got a node app built using a standard node-alpine docker image deployed to Azure App Service. The App Service Plan is set to use 2-core VMs (instance type S2). A single node process will only use a single core at a time. Is Azure scaling the…
jiggy
  • 123
  • 4
1
vote
1 answer

NGINX - Serving a create-react-app application on one port and my api on another port

In my application i am using create-react-app and serving my site's frontend on the port 5000 by using "serve -s build" in a node pm2 process. I can get this working by using this configuration for my nginx. server { listen 443 ssl; server_name…
Loggggy
  • 11
  • 1
  • 2
1
vote
1 answer

"pm2 deploy production setup" command fails, Permission denied (publickey)

So I guess pm2 and SSH aren't configured correctly to work with each other on my machine. I'm perfectly able to SSH into my remote server manually using ssh user@hostname. The server is a DigitalOcean server running Ubuntu 16.04 if that makes a…
Jon Love
  • 13
  • 1
  • 6
1
vote
0 answers

Check if PM2 daemon is running and resurrect

There were some recent problems on Ubuntu server due to low RAM. The server didn't reboot but PM2 crashed. To avoid such situations in future, I'm looking for a way to check if PM2 daemon is running and resurrect it automatically if it's not. It is…
Estus Flask
  • 111
  • 4
1
vote
2 answers

Upgrade node 0.12.x to nodejs 4.4.x using pm2

I use PM2 to run my node processes in production (on Ubuntu 14.04). After upgrading from node 0.12.x to nodejs 4.4.x, the command to run node(js) changed from node to nodejs. I followed the instructions on the nodesource distribution installation…
steampowered
  • 593
  • 2
  • 10
  • 24
1
vote
0 answers

Shall I do load balancing in nginx, pm2 or both?

PM2 allows to run NodeJS apps on multiple instances, i.e., different cores, allowing load balancing using the same port. PORT=3000 pm2 start -i NUMBER_OF_CORES(e.g 2) app.js But I could also do load balancing in Nginx with different ports upstream…
1
vote
2 answers

cron is not restarting pm2

I've tried many things but cron just won't restart pm2. I set the crontab -e with: SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin */10 * * * * /usr/bin/node /usr/bin/pm2 restart all And the I type: cat /var/log/cron.log And it says: Apr 2…
pete
  • 21
  • 4
1
vote
0 answers

EC2 - ERR_CONNECTION_TIMED_OUT

I have a ec2 free tier instance running linux, apache web server and nodejs app. I have configured security group and it worked ok so far. But now i can not access server through DOMAIN or IP with port (port have opened in inbound rule). I use ssh…
TanIkemen
  • 11
  • 2
1
vote
1 answer

NodeJS and Redis Cluster - Error: connect EMFILE

I'm banging my head against the wall now for 3 days and counting. I hope you can tell me what am I doing wrong. I have a Redis cluster with 3 masters and 3 slaves. A NodeJS application wishes to use the redis to store and serve data quickly. All…
Bert
  • 984
  • 1
  • 11
  • 29
1
2 3