Active handles in the simple Nodejs Request keeps increasing exponentially

試著忘記壹切 提交于 2020-05-28 04:37:11

问题


I have written a simple node API whose sole purpose is just to notify the user that the internet is alive. I am hitting this API after every 3 seconds and it works fine till the active handles are around 4000 or less but after then my server stops responding till the time I restart the server. I am running this server through pm2. I have attached a link to the image of my server when I type "pm2 monit".Link - https://i.stack.imgur.com/zEgUd.png

const express = require('express');
        const app = express();
        app.get('/users', (req, res) => {
            res.set("Connection", "close");
            res.send({status:200, message:'request received'}).end();
        });

        app.listen(5005, () => {
          console.log('Listening on port 5005');
        });

来源:https://stackoverflow.com/questions/59861542/active-handles-in-the-simple-nodejs-request-keeps-increasing-exponentially

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!