Configuration Configuration management in memory management in memory constrained constrained environment environment ___________________________ ___________________________ “Those 8MB of RAM are gonna be a little “Those 8MB of RAM are gonna be a little light for my Ruby stack” light for my Ruby stack” Matthieu CERDA Normation – CC-BY-SA normation.com
Who are you ? Name Matthieu CERDA Email : matthieu.cerda@normation.com Web site : http://www.normation.com Twitter : @Kegeruneku Job System engineer at Normation CFEngine Enthusiast, power user and trainer Rudder Integrator, packager Infrastructure Team member 2 Normation – CC-BY-SA normation.com
Configuration management ? ● Enable the user to manage from 0 to ∞ machines: ● Without making mistakes due to repetition ● Without having to provision every machine manually ● Ensuring a common and reliable base 3 Normation – CC-BY-SA normation.com
Effin' embedded systems, how do they work ? ● x 86 CPU's are not standard : ARM or MIPS CPUs are kings ● Embedded CPU's aren't war machines : Don't assume you will have a quad core one ● Low memory : Forget your 8G of RAM ● Everything has a cost : Do not assume your board has a SATA connector ● Not the same OSes : Goodbye Debian, RHEL or Windows, welcome OpenWRT, Montavista, VxWorks... 4 Normation – CC-BY-SA normation.com
Examples ● Routers: ● APU 1c ● x86_64 AMD G T40E @ 2x1 GHz ● 2 GB RAM / USB/SD/mSATA ● ALIX 2d13 ● x86_32 AMD Geode LX @ 400 MHz ● 256 MB RAM / SD 5 Normation – CC-BY-SA normation.com
Examples ● SOHO Routers: ● FON2303A ● MIPS Ralink 3052 @ 300 MHz ● 64 MB RAM / 8 MB Flash ● TL-MR3020 ● MIPS Atheros AR9330 @ 400 MHz ● 32 MB RAM / 4 MB Flash 6 Normation – CC-BY-SA normation.com
Configuration management in embedded environments ● Need to be compatible with memory/CPU constraints ● Problem with complex language stacks ● Hard to use interpreted languages ● Should not be too CPU intensive (SMP will not save you) ● Should be autonomous when possible ● Embedded environments often mean reduced networking capabilities 7 Normation – CC-BY-SA normation.com
Conventional GNU/Linux OSes ● Your average GNU/Linux OS ● Examples: Debian, Raspbian, Cubian, Fedora, Arch, … ● Provides and extensive library of tools already compiled for you: the main CM tools are here ! ● The most comfortable approach when you need a prototyping environment, that is affordable and easy to use: ● Boards are cheap ● Boards are legion ● Boards are powerful ● Shameless plug: CubieBoards/BeagleBones rock. 8 Normation – CC-BY-SA normation.com
GNU/Linux based derivatives ● GNU/Linux based, with additionnal constraints ● Examples: OpenWRT, Android / Replicant, MontaVista, ... ● Provide a complete compilation toolchain, but less utilities already builtin. Documentation is less accessible. ● The work to get CM tools to build is a bit more complicated, and the lack of packaging / CPU punch makes complex tools harder to impossible to use. ● A Ruby stack is hard to get ● A Python one is decently easy ● C based utilities are easy. ● SOHO routers are the easiest boards to get 9 Normation – CC-BY-SA normation.com
Proprietary software ● Nightmare mode of hobbyists / small companies ● Examples: VxWorks, Windows CE ... ● Provide a limited compilation toolchain, and nearly no open documentation (NDA's). You're on your own. ● It's basically a plug'n'pray approach, you have to build everything from scratch. ● No, really. Everything. ● You really don't want to mess with this. If you really want one, late WRT54G boxes would do the trick (VxWorks). 10 Normation – CC-BY-SA normation.com
Overview of the tools ● 3 families of tools: ● C based: CFEngine, Rudder … ● Ruby based: Puppet, Chef ● Python based: Salt. (Ansible ?) ● Of the three, C is the most efficient approach (CPU, memory wise) in the embedded world, the other two are usable if the CPU/mem constraints aren't too tight. 11 Normation – CC-BY-SA normation.com
Enough chit chat, time is candy! ● 2 “machines” used for the test ● CubieBoard 1 (A10 ARM CPU, 1GHz, 1 GB RAM) ● Wow, much power, very ARM, such rox. ● QEMU VM (Versatile ARM CPU, 64 MB RAM) ● Not really as powerful. Actually, a LOT less. ● Let's forget storage (NAND flash, HDD, …) constraints for now. 12 Normation – CC-BY-SA normation.com
Let's get ready to rumble ! ● 1 st round: CFEngine 3.6.0 vs Puppet 2.7.23 ● Idle memory occupation (Cubian) ● Nothing: ● 28 MB ● CFEngine (cf-execd, cf-serverd, cf-monitord): ● 33 MB (+5 MB) ● Puppet (puppetmaster): ● 51 MB (+23 MB) 13 Normation – CC-BY-SA normation.com
Let's get ready to rumble ! ● 1 st round: CFEngine 3.6.0 vs Puppet 2.7.23 ● Memory occupation (Cubian) ● Nothing: ● 28 MB ● CFEngine (cf-agent): ● 37 MB, 10s (+9 MB) ● Puppet (puppet apply): ● 57 MB, 16s (+29 MB) 14 Normation – CC-BY-SA normation.com
Conclusion ● Both tools are reasonably quick to run ● Puppet takes approximately + 20 MB compared to CFEngine ● 64 MB is not enough for Puppet ● Verdict: Configuration management ? Totally on those :) but be careful, RAM / CPU and time are precious :) 15 Normation – CC-BY-SA normation.com
Questions ? :) Questions ? :) 16 Normation – CC-BY-SA normation.com
Recommend
More recommend