On Mon, Nov 25, 2013 at 6:39 PM, Steve Freegard <st...@stevefreegard.com> wrote:
> On 23/11/13 15:22, Ben Noordhuis wrote:
>> I can't really reproduce that.  Below is what IMO the test case
>> reasonably should look like and that has RSS hovering around 60 MB
>> with --max_old_space_size=64.  Tested with HEAD of v0.10 and master on
>> a x86_64 FC20 system.
>>
>>
>
> I tried this on both 0.8 (with process.nextTick instead of setImmediate)
> and 0.10 and it does not show a leak or excessive memory usage.
>
> However - this would have been quite different to what was happening in
> Haraka with the bug that we had there; we would have been calling
> fs.unwatchFile(name), fs.watchFile(name) per line of data or per buffer
> which could have been potentially thousands of watchers per second in
> the same stack.  I was also running 0.8 on all of the machines that were
> exhibiting this problem.
>
> What I think happened here is that the fs.watch/unwatchFile functions
> saturated the thread pool to the point that all the threads were busy
> and it couldn't keep up which caused the RSS to grow with all of the
> in-flight requests.
>
> Regards,
> Steve.

Right, that sounds plausible.  The thread pool can be a bottleneck and
I'm afraid there is currently no real fix for that.  In v0.10, you can
scale it up with the UV_THREADPOOL_SIZE environment variable (clamped
to 1-128, default 4.)

Making it scale up and down automatically is the subject of ongoing
research but it's surprisingly hard to get right.  Not in the sense of
implementing it, that's trivial, but doing so without introducing
performance regressions however is not.  :-/

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to