I'm running an application in the cloud with fairly elastic demand and need to make use of auto-scaling.
The application uses a pub/sub system to receive and process job requests. Each server subscribes to a queue and picks jobs off of that queue one-by-one until the queue is empty.
I'd like to be able to look at the length of the queue (how many jobs are currently enqueued) and create a policy along the lines of:
"If the length of the queue is longer than X, scale up. If the length of the queue is 0 (and has been for a specified amount of time) scale down.
The length of the queue can be found via an HTTP request to the server. The application has an endpoint that describes each queue and their current length in a JSON format.
I've been looking for a service/application that can do this, but haven't found much. I kind of get the feeling I'm going to need to code. Thought I'd ask here first in case anyone knew of a solution.
Side ask: Is this a problem people have ran into in the past? It seems like specific scaling policies like this are fairly common. If I do go the development route, would open-sourcing be useful?