GithubHelp home page GithubHelp logo

Comments (18)

indexzero avatar indexzero commented on May 13, 2024

We've been seeing this memory leak in production but hadn't been able to track it down yet.

We're running node 0.3.1 (for at least minimal https support), so that would explain where we don't see it.

Thanks for the heads up and I'll investigate and get back to you.

from node-http-proxy.

thegreatape avatar thegreatape commented on May 13, 2024

Interesting. I ran the same tests using node v0.3.1, with the same results - with the pool error handler in place, memory leaks occur. Without the error handler, it runs like champ under load. :-)

from node-http-proxy.

indexzero avatar indexzero commented on May 13, 2024

Nice. Will try siege myself, I'd only been using ab up till now, but this looks wayyy better.

Thanks again.

from node-http-proxy.

joelklabo avatar joelklabo commented on May 13, 2024

I'm having the same issue on 0.3.7, did anyone solve this?

from node-http-proxy.

indexzero avatar indexzero commented on May 13, 2024

All,

We will be dropping pool when we upgrade to 0.4.x in the next month or so because node.js > 0.3.6 does connection pooling for us.

In the meantime, let me know how the removal of the pool error handler works in prod. I don't think it's the cause and not handling it can cause uncaught exceptions under high load.

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

Hi, what's the status of this bug?.

I'm getting this error, on node 0.4:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace:
at Pool. (events.js:101:17)
at Object.proxyRequest (/usr/local/lib/node/.npm/http-proxy/0.3.1/package/lib/node-http-proxy.js:185:7)
at Server. (/Users/davem/Petromatch/repository/eclipse/petromatch-java/node/faye-server.js:12:3)
at Server. (/usr/local/lib/node/.npm/faye/0.5.5/package/faye-node.js:1952:22)
at Server.emit (events.js:45:17)
at HTTPParser.onIncoming (http.js:1078:12)
at HTTPParser.onHeadersComplete (http.js:87:31)
at Socket.ondata (http.js:977:22)
at Socket._onReadable (net.js:654:27)
at IOWatcher.onReadable as callback

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

oh, and node is definitely leaking.

from node-http-proxy.

indexzero avatar indexzero commented on May 13, 2024

Working on a update for node 0.4.0. A lot of this has to do with the pool dependency which we can remove using the http.Agent API in 0.4.0

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

thanks, rough eta?
node now at 760 Mb after 6 hours of very light dev testing (couple of connections)
ie: I wouldn't feel comfortable moving to production.

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

ps: I also posted this on the node.js google group, and had some interesting replies:

https://groups.google.com/d/topic/nodejs/TbHMjwMdRRY/discussion

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

note the following comment regarding the code I posted, which is based on the example in the node.js readme:

https://groups.google.com/d/msg/nodejs/TbHMjwMdRRY/eoDRenX0UCEJ

is it true that every request creates a new proxy which isn't garbage collected?

from node-http-proxy.

indexzero avatar indexzero commented on May 13, 2024

It is true that every request creates a new proxy. It is false that it is not garbage collected.

from node-http-proxy.

indexzero avatar indexzero commented on May 13, 2024

I replied to the thread here: https://groups.google.com/forum/#!msg/nodejs/TbHMjwMdRRY/eoDRenX0UCEJ

Will try to bang this out in the next week or so.

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

I replaced this (which I found on your site):

var server = http.createServer (function (req, res) {

new httpProxy
.HttpProxy (req, res)
.proxyRequest (8080, 'localhost', req, res)

})

with:

var server = httpProxy.createServer (8080, 'localhost')

Functionality is the same, and the leak does seem to be less, but will know later today.

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

Have you been following this:

https://groups.google.com/d/msg/nodejs/TbHMjwMdRRY/6YIi6ktiuOEJ

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

I ran node-inspector on my code, with v8-profiling.
As far as I can tell, HttpProxy is not being GC'd

Every request increments HttpProxy, ClientRequest and ServerResponse counts.
These counts never decrease, even if the system is left alone for some time.

I have a screen shot of the profiler, though I don't see a way to attached files here, so email me if you want to see the screenshot: dmoshal at gmail dot com.

from node-http-proxy.

indexzero avatar indexzero commented on May 13, 2024

I have fixed this issue in the v0.4.0 branch. Unfortunately, it is not stable due to a few bugs in the node.js http.Agent APIs that I am working to resolve.

We will push v0.4.0 when we can get these issues resolved in core; hopefully the aforementioned fixes will make it into 0.4.3

from node-http-proxy.

davidmoshal avatar davidmoshal commented on May 13, 2024

Thanks, I'm using nginx for now (without websockets)

Dave

On Thu, Mar 10, 2011 at 7:49 PM, indexzero <
[email protected]>wrote:

I have fixed this issue in the v0.4.0 branch. Unfortunately, it is not
stable due to a few bugs in the node.js http.Agent APIs that I am working to
resolve.

We will push v0.4.0 when we can get these issues resolved in core;
hopefully the aforementioned fixes will make it into 0.4.3

#21 (comment)

from node-http-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.