joyent/node — Issue #2295: Crazy idea: Add priorized contexts
Author: thejh
Created: 2011-12-08 20:01:04+00:00
State: open

What do you think about this idea? Would only help when node is under maximum load or above, but might be somewhat helpful in that kind of situation.

When a server is under heavy load, there are some events that just need to work quickly (like an admin interface) and some that reduce CPU or RAM usage. For example, we might get notified that an HTTP request was cancelled, but because the event queue is too long, we continue working on it (e.g. with external API requests) and holding it in RAM (which in turn means longer GC cycles) until that close notification got through the queue.

My proposal is a "fast lane" that you can tell a context to use which would cause events from those contexts to be handled before all others.