-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPU-intensive handling #23
Comments
Hi @cliffano, |
How about having node-toobusy as something that Kraken can optionally setup, just like it does with lusca security stuffs? This won't be something that Kraken needs to implement. I'm seeing this as a common need across node.js apps since all risks the same problem under extreme load. I understand that what goes into Kraken suite is not going to satisfy everyone. |
tl;dr 😬 Thanks, @cliffano! Yeah, internally we've been having some discussions about this for a while now. First, the role of something like toobusy seems like it could be different to different applications. For some apps it might suffice to treat event loop saturation as an error, merely returning a 503 and moving on. For others, the role of this instrumentation may be more focused toward ops concerns, like you mentioned above. Which leads me to configuration. The power in Finally, and this is a big one, there are other interesting tools out there to solve this problem, and I hesitate to lock developers into a solution. Yahoo has a pair of tools called process-watcher and monitr that handle this in a slightly different way, so at the very least this implementation would need super-smart defaults or a dead easy way to enable/disable. Regarding your 'rule of thumb' question, we've mostly been attempting to walk the fine line between providing just enough, but not prescribing too much and exposing configuration for the space between. |
Thanks @totherik for the detailed feedback. I'm sorry for the late reply, I was offline for several days last week. Kraken definitely provides the foundation of what most web apps will need, but at the same time various organisations will have various needs, and using toobusy/process-watcher/monitr could be one of them. Just an idea: one solution is to create a module which could be composed of various custom tools and hooked up to Kraken's application lifecycle. This would allow an organisation to bundle the stuffs that are "too much for Kraken" into this module, and leave Kraken with the "just enough" parts. Re unintrusive API, I think Kraken's application lifecycle is a good start for extension points. Re ops stuff. I know this is crazy but there are still a number of organisations with a tall fence between dev and ops. It is sometimes necessary for dev team to bundle ops-related stuffs inside the app due to problems on ops team, e.g. lack of funding, ops team can't add foobar to their setup. Sad but true. |
Hey @cliffano I think we can keep this one around. The more I think about it the more I think we could provide an unintrusive opt-in config settings for Secondly, I like the idea of providing additional bolt-on functionality and in some ways it may be more straightforward once issue #50 gets sorted out. |
Renaming to track better. |
This is probably borderline question and feature request.
How will KrakenJS handle the situation where the application logic is CPU intensive? Where requests keep getting accepted, the event loop grows, and eventually the process runs out of memory.
Is there any plan to add something like toobusy module to identify this situation so Kraken would no longer accept more requests when the process is already 'busy'.
Or would this be considered an OPS problem that shouldn't be handled by Kraken?
Edit: or is it the responsibility of the application to move the CPU-intensive task to a separate process outside of Kraken?
The text was updated successfully, but these errors were encountered: