Monday 27 March 2017

How Do I Prevent Exceeding Heroku (or any Server) Memory Limit?

Hey friends!Right now I have a node.js app in Heroku that has to do some image processing. Everything works super fine!Except when I have to process lots of images.Right now I'm using promises and graphicsmagick to handle the image processing. Vaguely whats happening right now is that a promise.all is happening in which for all image I resize it and then save it.But I don't limit anything.Since I really don't know how to limit anything.... Would limiting the promise concurrency improve something? Or do I need to call the garbage collector or something? I'm not well versed in these topics so I don't know what Info you need to be able to answer! Please ask anything you consider I must say!Is there any way to tell node "If you exceed this level of memory then wait a little before creating new calls to imageResize()" ?

Submitted March 27, 2017 at 05:36PM by sandalphone

No comments:

Post a Comment