C
C
CrazyOne2015-08-18 19:19:58
Nginx
CrazyOne, 2015-08-18 19:19:58

The application on NodeJS periodically falls off, what's the matter?

Hello!
I've been dealing with the problem for a week now, googled, looking for a solution, while everything is deaf.
There is a site built on NodeJS, Express framework as a Forever daemon, as an Nginx proxy.
While there is no load, in development. The following happens, everything works well, no errors, a week passes, the following is in the logs:
qwLXcWv.jpg
It feels like the application stops responding to Nginx, everything is fine in the logs, I look in the console, there is a process with a node, Nginx is in order, load on the server at the same time there are no memory leaks either, everything is within the normal range.
It just happens randomly. Only reloading the NodeJS application helps.
I thought that something was wrong with the framework, but the probability is small, because nothing supernatural happens, ordinary GET requests.
Maybe someone faced with a similar situation, help with advice.
The Nginx config is the following:

server {
    listen 80;
    charset utf-8;

    server_name bbs.info;
    server_name_in_redirect off;

    root /var/node/bbs.info/data;
    index index.html;

    access_log off;
    error_log /var/node/bbs.info/logs/nginx.error.log;

    client_max_body_size 20M;

    location / {
        proxy_pass http://127.0.0.1:801;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;

        proxy_connect_timeout 60;
        proxy_send_timeout 60;
        proxy_read_timeout 60;
        proxy_redirect off;
    }

    error_page 500 502 503 504 /50x.html;

    location = /50x.html {
        root /usr/share/nginx/html;
    }
}

PS I tried to change the demon from Forever to PM2, it worked for a week and I felt better, but then again.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Romanov, 2015-08-18
@Kaer_Morchen

I had a similar one too, nginx + node.js (Forever) configuration. The application simply stopped responding, although it was in the processes itself, nothing went further than nginx, the logs were without errors. I did a restart manually and everything worked, it happened several times, and then the bang and it went away, that it was the devil knows.

P
pomeo, 2015-08-22
@pomeo

Are you running node(127.0.0.1:801) as root? It's not good

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question