简体   繁体   中英

node.js seems to go into sleep mode when it's not in use

My node.js http server has a response time of 2-3ms on localhost. But when I don't use it for a minute the "first" requests take around 300-400ms. After that node.js is fast again.

var http = require('http');
var server = http.createServer(function(request, response){
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.end("Hello");
});
server.listen(90);

Is there some kind of sleep mode for V8 or does it drop the JIT information when they're not in use for a while?

正如jfriend00在他的评论中所说: node.js似乎在不使用时进入睡眠模式,这似乎是Windows问题,而不是node.js。

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