nodejs中的内存泄漏

时间:2012-12-28 15:09:15

标签: node.js

我正在使用http-proxy将请求转发到特定端口

这是代码:

var httpProxy = require('http-proxy');

options   = {
    hostnameOnly:true,
    router: {
        'appname.nodejs.mydomain.com':'127.0.0.1:8001',
        'otherapp.nodejs.mydomain.com':'127.0.0.1:8002'
    }
}
httpProxy.createServer(options).listen(80);

当我开始它工作得很好 但在线用户获得高于300的用户后,出现了警告

we have 338 users online.
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use      emitter.setMaxListeners() to increase limit.
Trace
    at Socket.EventEmitter.addListener (events.js:175:15)
at Socket.EventEmitter.once (events.js:196:8)
at ClientRequest.HttpProxy.proxyRequest (/usr/local/lib/node_modules/http-proxy/lib/node-http-proxy/http-proxy.js:316:12)
at ClientRequest.g (events.js:192:14)
at ClientRequest.EventEmitter.emit (events.js:126:20)
at ClientRequest.onSocket (http.js:1525:9)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
we have 339 users online.
你能否就这个问题给我任何建议?

0 个答案:

没有答案