Janitor monkey swings in to clean up the cloud
Janitor Monkey is the latest of Netflix's Simian Army to be released as open source and comes six months after the last open source release, Chaos Monkey. Netflix use an army of "Monkey" applications to test, manage and maintain its large video delivery applications that are based on Amazon Web Services.
Janitor Monkey, as its name implies, is in charge of tidying up the cloud by searching with a set of rules, at scheduled times, for unused resources. On AWS, Janitor Monkey can clean up instances, EBS Volumes, EBS Volume snapshots and autoscaling groups. EBS volumes, for example, become eligible for cleanup if they haven't been attached to an instance in the cloud for thirty days, while instances can become eligible if they haven't been part of an auto-scaling group for three days. Janitor Monkey comes with a set of common rules for detection which, of course, can be customised to particular needs.
If any of the rules indicate a candidate for cleanup, it first marks the resource and then looks for the email address associated with it and sends a notification that in two business days it will go ahead with cleaning up. The owner of the resource can then approve the deletion or flag the resource to opt out of being managed by Janitor Monkey (until the flag is removed). Flag setting is managed through a REST interface. After the scheduled notification time has passed, Janitor Monkey deletes the resource but it doesn't have a problem if resource owners delete resources earlier. All the Janitor Monkey actions are logged in an Amazon SimpleDV table by default.
Netflix says that it has already deleted 5,000 resources for them and helped keep their costs down by freeing up engineers from hunting down unused resources. It believes that Janitor Monkey is generic enough that it should be possible to extend it to work with other cloud providers. It plans to add support for new resource types for Janitor Monkey to manage and to improve the rules system by supporting Edda, its query language for resources and their history. Janitor Monkey is available from the project's Github repository and is published under the Apache Licence 2.0.