Closed billiegoose closed 8 years ago
Good idea and fair point. Wanna give it a try?
How this would work:
needle
would have to use a custom http.Agent
with maxSockets
--throttle
flag in cmd.js
Hmm, well I tried your suggestion, but I'm not sure if I got it to work. I tried adding a custom http.Agent but then needle complains for https requests. Then I tried modifying both http.globalAgent and https.globalAgent but it didn't seem to have any effect on memory usage. Plus, I just realized as I was doing this that version 2.x came out and I was still using version 1.x. Not sure how that will effect memory usage.
If 'ied install' starts to fail for me more frequently, you can bet I'll look into this again, but for now I've got more to work on my database performance... ah, devops.
Hello! I love this project for many reasons. One of which is that after refactoring my app, I discovered that
npm
is horrible about using memory. I'm running my apps on small cloud servers with only 512MB RAM - my app runs fine, but the OS kills 'npm install' because it eats too much memory.In contrast,
ied
not only uses much less memory, but the install runs 5 times faster. I attribute this toied
basically having a superior design. However, about 1 out of every 4 times I run the installer, it still gets killed for too much memory. I can only assume the difference is in the network - perhaps when NPM repository is slower more requests queue up and memory usage increases?Anyway, my question is: how hard would it be to throttle the installer? And is that the best way to minimize memory consumption?
Addendum: Mostly asking in case you say "oh, that would be really hard! don't try that!". But if you think its easy I'll happily dive in and contribute the code my time permitting.