Tony
Tony

Reputation: 243

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:

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?

Upvotes: 0

Views: 1015

Answers (1)

irakli
irakli

Reputation: 869

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?

Upvotes: 0

Related Questions