Golang Memory Benefit for Cloud Foundry BOSH

May 12, 2014 James Bayer

Several different areas of the Cloud Foundry codebase have recently been using Go for some new components or rewriting several existing components in Go that were originally written in Ruby. The Cloud Foundry BOSH team has been implementing the BOSH agent in Go and it is almost ready for production as Greg Oehmen notes on the mailing list. Each VM that BOSH creates and manages has an instance of the BOSH agent, so as you scale the number of VMs that BOSH manages, the memory footprint of all the agents is noticeable. This is especially true on developer machines when using a light-weight version of BOSH called BOSH-lite, which uses Linux Containers instead of VMs to get much faster feedback cycles during development. We recently discovered that in a 13 instance Cloud Foundry configuration, the Go version of the BOSH agent saves nearly 1GB of memory compared to the Ruby version!

go_total_mem_bosh_agents

go_avg_mem_bosh_agent

number of agents 13
memory (MB) saved per go agent 61
memory saved using go 87%
Ruby Golang
total mem (MB) all agents 907 114
avg mem (MB) per agent 69.8 8.8

The new BOSH stemcells with the Go agent are available on the bosh artifacts page as well as by using the CLI command:

 bosh public stemcells --full

To add up all of the memory used for BOSH agents on your system, you can use a command like this one from the BOSH-lite VM:

ps aux | grep bosh_agent | awk '{print $6}' | awk '{s+=$1} END {print s}'

Thanks to David Stevenson for providing the raw data and congratulations to the entire BOSH team on this significant improvement.

About the Author

Biography

Previous
Strolling down the Happy Path
Strolling down the Happy Path

A highly-functioning software team has parallel development and design cycles. Developers and PMs work on b...

Next
Getting Started with Angular: Dealing with Scopes/Controllers
Getting Started with Angular: Dealing with Scopes/Controllers

A common source of confusion among new Angular developers is scopes. The parent-child scope model is confus...

×

Subscribe to our Newsletter

!
Thank you!
Error - something went wrong!