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!
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