问题
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