简体   繁体   中英

PM2 error with Node.js application

I am running a Node.js application with MongoDB on Ubuntu. As lightweight server I am using NGINX. My current system information are:

  • System load: 0.01
  • Processes: 77
  • Usage of /: 16.9% of 19.56GB
  • Users logged in: 1
  • Memory usage: 57%
  • Swap usage: 0%

After reload a site I am getting following message with pm2 logs command

PM2 App [app] with id [0] and pid [8180], exited with code [0] via signal [SIGKILL] PM2 Starting execution sequence in -fork mode- for app name:app id:0 PM2 App name:app id:0 online

I recognize if I am using less data then I am getting the error not so many times. Maybe I will need more memory space or what could be the problem?

My NGINX configuration looks like:

sudo vi /etc/nginx/sites-available/default


server {
    listen 80;

    server_name example.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Many thanx for your help

More Information:

I have recognized that my size(around 9 GB) of db is bigger then the storage size(aroung 3 GB):

db.stats()
{
    "db" : "testDB",
    "collections" : 3,
    "objects" : 9632,
    "avgObjSize" : 974.0099667774086,
    "dataSize" : 9381664,
    "storageSize" : 3354624,
    "numExtents" : 0,
    "indexes" : 3,
    "indexSize" : 159744,
    "ok" : 1
}

Maybe it will help to resize the mongodb space? How can I do that?

There isn't enough information in the error message you posted to diagnose the problem. It looks like your node script is hitting some problem and exiting, but doesn't say what the underlying error is. Can you post more of the error message?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM