So what is Ensemble anyway?

Have you heard of Ensemble? Are you excited about Cloud/Service Orchestration? What? Ok you’re not alone if you are scratching your head.

Ensemble is an implementation of a new idea that has been taking shape the last couple of years. Ever since Amazon hooked up a remote API to thousands of machines to provide access to their virtual infrastructure (and called it macaroni? err.. AWS), people have been dreaming up ways to take advantage of what is basically a robotic “NOC guy”. No longer do you have to pre-rack servers or call your vendor frantically to get servers sent next-day to your colo. Right?

Naturally, the system administrators that would normally be in charge of racking servers, applied their existing tools to the job, to mixed success. Config management is really good at modelling identical hosts. But with virtual hosts instantly available, this left those thinking at a higher level wanting more. Chef in particular implemented a nice set of tools and functionality to allow this high level “service” definition with their knife tools and simple ruby API.

But how easy are Chef’s cookbooks to share and use without modification? How easy are they to integrate together? Puppet has modules that are also capable of similar functionality, and the recent integration of Mcollective, plus puppet Faces, has certainly added a lot of the same things Chef had to support this kind of application modelling, but again, the modules seem to require a lot of convention and assumption, and tweaking to get useful.

Its my opinion, that this is very much like the way tarballs+autoconf became the de-facto standard for distributing free software. It was *so much* better than writing a Makefile by hand, and it achieved an enormous amount of portability, so developers adopted it rapidly. In fact, it is still the dominant way to distribute portable open source applications.

But at some point, the limitations of this became clear. There was a need for something more concise, that could distribute both the source, and binaries, built for a platform. There was some limited early success with tarballs built by convention. But then, Enter RPM and DPKG. These included ways to express facts about software, like its dependencies, architecture, and the revisions made to it to work on the target platform. This allowed distributors of software to more easily maintain their systems, and enabled users to manage the software in their environments.

At that point, some smart guy figured out that we should be able to download and automatically configure all of the software needed for one application to work properly, just from its packaging information. To my mind, apt-get was my first experience with this, though FreeBSD ports authors may disagree there. Either way, this made it very easy for admins and users to install software without spending hours in the 7 levels of dependency hell.

In many ways, Service Orchestration is a way of bringing the benefits of packaging to the cloud. It should allow us to build out our cloud in a sane way, taking advantage of the knowledge that has been gained by others. For the bits that we need to finely tune, it should step aside and allow that without compromising the system.

Ensemble is an implementation of this idea, and Principia is a collection of “Formulas” for Ensemble. They are tightly coupled to Ubuntu, as they are in many ways meant to be the dpkg and apt-get for Ubuntu in the cloud.

Its pretty easy to try out Ensemble and Principia on Ubuntu. Right now you’ll need an EC2 account with an access key setup, though we’re working on making this work with just your local machine for rapid development.

Its been pointed out to me that the version of principia-tools that was available at the time of this writing didn’t include /usr/share/principia-tools/tests. I’ve uploaded a fixed version to the ensemble PPA, so if you tried these instructions and failed, please try updating principia-tools. If that fails, you can get the tests with bzr branch lp:principia-tools.


sudo add-apt-repository ppa:ensemble/ppa
sudo apt-get update
sudo apt-get install principia-tools
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxx
export AWS_SECRET_KEY_ID=0123456789ABCDEF
ensemble bootstrap
principia getall /some/path/for/formulas
/usr/share/principia-tools/tests/mediawiki.sh /some/path/for/formulas

What does this give you, well it should give you a 7 node mediawiki cluster of t1.micro’s in the us-east-1 region of EC2. I just ran it and now I have this:

machines:
  0: {dns-name: ec2-50-19-158-109.compute-1.amazonaws.com, instance-id: i-215dd84f}
  1: {dns-name: ec2-50-17-16-228.compute-1.amazonaws.com, instance-id: i-8d58dde3}
  2: {dns-name: ec2-72-44-49-114.compute-1.amazonaws.com, instance-id: i-9558ddfb}
  3: {dns-name: ec2-50-19-47-106.compute-1.amazonaws.com, instance-id: i-6d5bde03}
  4: {dns-name: ec2-174-129-132-248.compute-1.amazonaws.com, instance-id: i-7f5bde11}
  5: {dns-name: ec2-50-19-152-136.compute-1.amazonaws.com, instance-id: i-755bde1b}
  6: {dns-name: '', instance-id: i-4b5bde25}
services:
  demo-wiki:
    formula: local:mediawiki-62
    relations: {cache: wiki-cache, db: wiki-db, website: wiki-balancer}
    units:
      demo-wiki/0:
        machine: 2
        relations: {}
        state: null
      demo-wiki/1:
        machine: 6
        relations: {}
        state: null
  wiki-balancer:
    formula: local:haproxy-13
    relations: {reverseproxy: demo-wiki}
    units:
      wiki-balancer/0:
        machine: 4
        relations: {}
        state: null
  wiki-cache:
    formula: local:memcached-10
    relations: {cache: demo-wiki}
    units:
      wiki-cache/0:
        machine: 3
        relations: {}
        state: null
      wiki-cache/1:
        machine: 5
        relations: {}
        state: null
  wiki-db:
    formula: local:mysql-93
    relations: {db: demo-wiki}
    units:
      wiki-db/0:
        machine: 1
        relations: {}
        state: null

At the top you see the machines that ensemble spun up in EC2 in the ‘machines’ section. The numbers there correspond to the ‘machine: #’ in the service/units definitions below. If you look through, you’ll see above that wiki-balancer is machine 4, which has a hostname of ec2-174-129-132-248.compute-1.amazonaws.com. If you go to that hostname, once all relations are up (I like to use ‘watch ensemble status’ to see when this happens), you should see a working mediawiki. But not just a working mediawiki, a scalable one. If you want to pour on the traffic, spin up 3 more demo-wiki’s to handle the app server load:


ensemble add-unit demo-wiki
ensemble add-unit demo-wiki
ensemble add-unit demo-wiki

These will of course take a minute or two to spin up. Once they’re ready they’ll show up in the status output:

services:
  demo-wiki:
    formula: local:mediawiki-62
    relations: {cache: wiki-cache, db: wiki-db, website: wiki-balancer}
    units:
      demo-wiki/0:
        machine: 2
        relations:
          cache: {state: up}
          db: {state: up}
          website: {state: up}
        state: started
      demo-wiki/1:
        machine: 6
        relations:
          cache: {state: up}
          db: {state: up}
          website: {state: up}
        state: started
      demo-wiki/2:
        machine: 7
        relations:
          cache: {state: up}
          db: {state: up}
          website: {state: up}
        state: started
      demo-wiki/3:
        machine: 8
        relations:
          cache: {state: up}
          db: {state: up}
          website: {state: up}
        state: started
      demo-wiki/4:
        machine: 9
        relations:
          cache: {state: up}
          db: {state: up}
          website: {state: up}
        state: started

How about a little test then? After I got to this point, I logged in as WikiSysop (change the password folks! its change-me) and imported the Wikipedia exports for “Ubuntu” and “EC2″. After that I used harvestman to spider the site and then saved all the urls in a file, urls.txt. Alright! Now lets fire up *siege* from a machine outside the cluster, but in the same availability zone / security group (so at least we’re only dealing with EC2′s latency and not my net connection), and see if we can take this cluster down!


$ siege -i -c 5 -f urls.txt
...
Transactions: 563 hits
Availability: 100.00 %
Elapsed time: 95.58 secs
Data transferred: 2.64 MB
Response time: 0.35 secs
Transaction rate: 5.89 trans/sec
Throughput: 0.03 MB/sec
Concurrency: 2.04
Successful transactions: 544
Failed transactions: 0
Longest transaction: 13.54
Shortest transaction: 0.00

This is, btw, the best run I got out of t1.micro’s. Sometimes it would get quite ugly:


Transactions: 892 hits
Availability: 99.55 %
Elapsed time: 221.69 secs
Data transferred: 3.64 MB
Response time: 0.61 secs
Transaction rate: 4.02 trans/sec
Throughput: 0.02 MB/sec
Concurrency: 2.45
Successful transactions: 849
Failed transactions: 4
Longest transaction: 27.41
Shortest transaction: 0.00

Lets try the whole thing over with m1.small. First I edit ~/.ensemble/environments.yaml and add an override for the default-instance-type:


ensemble: environments

environments:
  sample:
    type: ec2
    default-instance-type: m1.small
    control-bucket: ensemble-12345678901234567890
    admin-secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Then I re-run the whole test:


Transactions: 290 hits
Availability: 98.98 %
Elapsed time: 81.79 secs
Data transferred: 0.78 MB
Response time: 0.53 secs
Transaction rate: 3.55 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 1.89
Successful transactions: 277
Failed transactions: 3
Longest transaction: 1.50
Shortest transaction: 0.00

Oops! I forgot to add my 3 extra nodes. Note that these two m1.smalls are already almost keeping up. Now as I add these, I keep siege running. Its pretty cool to watch the response times drop as nodes come online to carry some of the load.

Now with 5 m1.small’s:


Transactions: 273 hits
Availability: 100.00 %
Elapsed time: 54.27 secs
Data transferred: 0.99 MB
Response time: 0.47 secs
Transaction rate: 5.03 trans/sec
Throughput: 0.02 MB/sec
Concurrency: 2.38
Successful transactions: 260
Failed transactions: 0
Longest transaction: 19.92
Shortest transaction: 0.00

And with higher concurrency raised from 5 to 10:


Transactions: 327 hits
Availability: 100.00 %
Elapsed time: 42.20 secs
Data transferred: 1.30 MB
Response time: 0.66 secs
Transaction rate: 7.75 trans/sec
Throughput: 0.03 MB/sec
Concurrency: 5.12
Successful transactions: 318
Failed transactions: 0
Longest transaction: 25.51
Shortest transaction: 0.00

And now if we add 2 more, for a total of 7 nodes, concurrency of 10 gets even better:


Transactions: 531 hits
Availability: 100.00 %
Elapsed time: 53.37 secs
Data transferred: 1.75 MB
Response time: 0.44 secs
Transaction rate: 9.95 trans/sec
Throughput: 0.03 MB/sec
Concurrency: 4.35
Successful transactions: 507
Failed transactions: 0
Longest transaction: 15.49
Shortest transaction: 0.00

And with 2 more (total of 9 units in demo-wiki serving the app):


Transactions: 354 hits
Availability: 100.00 %
Elapsed time: 34.41 secs
Data transferred: 1.23 MB
Response time: 0.41 secs
Transaction rate: 10.29 trans/sec
Throughput: 0.04 MB/sec
Concurrency: 4.22
Successful transactions: 337
Failed transactions: 0
Longest transaction: 11.45
Shortest transaction: 0.00

Anyway, this isn’t a Mediawiki benchmark. This is to show you how easy it is to scale up and down in response to load with Ensemble. We all know that scaling out works, these graphs show it nicely:

Response Time
Transactions per Second

Notice how the transactions/second went up all the time, but the response time went up drastically with the jump in concurrency. This is where you need to have the ability to scale quickly, and where, if you can live with the other limitations of EC2 or any other IaaS provider, the cloud should actually win you business, since better response time means more happy users.

Now that my siege is over, I can safely remove the unnecessary units one by one with ‘ensemble remove-unit demo-wiki/9′, etc. etc. There’s still a lot of room for sugar to be added. We could say “ensemble resize-service demo-wiki 5″ and it might just pick 5 to keep and remove the rest, or add 3 to fulfill the request. There are also a ton of other ideas just bubbling up that are really exciting.

Come say hi and hack on ensemble with us in Freenode, #ubuntu-ensemble and on the mailing list on the mailing list.

33 thoughts on “So what is Ensemble anyway?

  1. Pingback: Ubunite | Blog | Who We Follow: Ubunite's RSS Digest June 8, 2011

  2. I enjoy viewing revolutionary content such as this with good quality information compiled and talked about. I believe that if you had dug even a tiny bit further, this post might nearly become a good academic article or even a useful academic resource. I have added your website to my RSS reader in order to see for what you might have in the near future.

  3. I enjoy experiencing innovative content such as this with such high quality information gathered as well as discussed. I think if you dug even a tiny bit deeper, this post might almost become a good academic write-up or even a useful academic resource. I just added your blog to my own RSS reader in order to watch for what you might have in the near future.

  4. Even when all customers of your family see each other each day, connection continues to be needed. This is essentially the obvious way to enhance the call one of several relatives as well as help make your romance one to the other tougher. It really is fantastic to do something out of doors but once the climate is certainly not good or maybe it is really pouring birds exterior, you can look at different kinds of in house online games and things to do that can genuinely make absolutely everyone feel good. This is a great alternate you could remember to consider. Below are the video games or pursuits that you can do indoors.Hide and seek is among the most in-demand games ever performed and also this can definitely be practiced indoors. An individual ought to be an InchesitInches who definitely are sensible of trying to find other members of the family that are trying to hide. Web site that is to be identified devoid of in contact withVersusreaching the house basic will then function as up coming “it.” But when you are think that it’s not a very good choice, it is possible to take a look at charade which happens to be another indoor activity. During this sport, ideally, there needs to be two organizations. There’ll be an affiliate that should act on the phrase that is definitely authored on a piece of paper whilst the other members are typically in-control of guessing the phrase. The team with the most details might be expressed as being the victorious one.Other than hide and seek and charade, a large collection of cards and games are one of several suitable decisions that you could explore. Games include Menagerie, Ancient House maid, Moving, Rock, Slapjack and many others. For games, it is possible to opt for Scrabble, Mentally stimulating games, Monopoly, Relatives Feud and Pieces. When you have plenty of choices to look at, you just need to choose the brains behind you feel is actually exciting.On the flip side, if you think enjoying the activities that have been already mentioned aren’t going to be good enough, you possibly can decide on other suggestions which the majority of the close relatives have pursuits in. By way of example, if you’d prefer in order to cookAndmake in order your son or daughter, then you can choose this task that allows you to relationship with your family. You possibly can designate each representative to undertake some section of the this bakingVersuscooking approach making sure that anyone will like. Guarantee that anyone actually gets to get involved in this sort of action. And when foodis cooked or the wedding cake is prepared, then you can definitely try to eat it jointly considering the family. Everybody will truly be content you can eat the berry of their labour. In addition to cookingPerthis baking, also you can think about various other activities like artwork, moving, singing, examining, observing motion pictures and plenty of extra.These are merely extremely methods to relationship with the fam these really are helpful. You do not have to suit your needs commit big money because these very simple issues can definitely carry joy to everybody particularly if the family members are entire. It may not be genuinely necessary that these products ought to be done each day. Once or perhaps rare occasions per 30 days will do.

  5. Whether or not all customers of your family see the other person daily, developing continues to be vital. This can be basically the best way to reinforce the partnership one of several members of the family and perhaps build your partnership one to the other more robust. It’s good some thing outside the house but once the climatic conditions is not that excellent or maybe it can be pouring down rain outdoors, you can think about several types of interior games and exercises that can actually make absolutely everyone feel happy. This is a great different that one could take into consideration. In this article are some of the video game titles or maybe the pursuits that can be done in the house.Hide and seek is probably the most favored games ever before played which can actually be exercised inside your home. Anyone really needs to be an Half inchitInches who definitely are sensible of trying to get other members of your family that are hiding. Web site which is to be found devoid of pressingOrreaching your property bottom should become the up coming “it.” But in case you are reckon that this is not a really good option, it is possible to check into charade that is another household online game. During this recreation, if at all possible, there has to be two organizations. You will have an associate that can act up the term that is definitely authored on certificates even though the people are working-handle of estimating the saying. The team with more things might be proclaimed because winner.In addition to hide and seek and charade, quite a number of card and games will also be among the suitable decisions you could consider. Games involve Menagerie, Old Cleaning service, Running, Natural stone, Slapjack and more. For games, you are able to opt for Scrabble, Mentally stimulating games, Monopoly, Family members Feud and Checkers. When you have a lot of options to see, you simply need to pick the one which you believe really is exciting.Conversely, if you feel that participating in the video games which are already stated will never be up to scratch, you may opt for other considerations which almost all the close relatives have interests in. For example, if you value to cookOrprepare if you want your children, then you could get this to action that allows you to connect with the family. You’ll be able to designate each associate to do some the main preparing your receipeeVersuspreparing course of action to make sure that everybody will love. Be sure that all people actually gets to attend like exercise. Once the food is baked and the pastry is cooked, then you can take in it with each other with all the current relatives. Every person will certainly be happy to consume the fruit of the crews. Apart from food preparation/preparing, also you can consider a few other pursuits like artwork, bouncing, performing, reading, looking at motion pictures and a lot of much more.Mentioned incredibly solutions for connection with the family nevertheless these are actually effective. There’s no need for yourself devote a ton of money as these straightforward issues can certainly provide happiness to every person particularly family members are total. It is not seriously necessary that these matters carried out each day. Once weekly or perhaps few times per month will do.

  6. Even if all customers of ones own see the other each day, connecting continues to important. This really is basically the easiest method to strengthen the link one of several close relatives as well as build your marriage to one another healthier. It is definitely good to do something out-of-doors but in case the temperature isn’t that very good or maybe it is pouring birds external, you can look at different types of inside online games and exercises which could actually make all people feel good. This is a great different that one could consider. Right here are the game titles or perhaps the actions you can apply inside your home.Hide and go seek has become the preferred video games ever before played which will be done in your own home. Anyone ought to be an InchitIn . who definitely are sensible of searching for other loved ones who are trying to hide. The first one that is to be found without in contact withVersusattaining your property basic will likely then really do the next Init.In . But if you’re think that this may not be a good selection, you may look into charade which is a further in house game. In this particular game, ultimately, there must be two organizations. It will have a user which will act out the phrase that’s composed on certificates whilst the people are typically in-charge of speculating the term. The group with things might be announced because victor.Other than hide and go seek and charade, a large collection of greeting card and games are among the list of best alternatives that you could check into. Games incorporate Menagerie, Previous House maid, In business, Jewel, Slapjack and many other. For board games, you can choose Scrabble, Chess, Monopoly, Spouse and children Feud and Checkers. When you have plenty of choices to check out, less costly decide on one which you would imagine is really enjoyable.On the flip side, if you think that participating in the video games which are already mentioned will never be suitable, you’ll be able to select other considerations which the majority of the close relatives have interests in. As an illustration, job to cookVersusfarrenheit as a way young kids, you’ll be able to get this action that allows you to attachment with the family. You may designate every fellow member to complete a clear part of the preparing your receipee/cooking process to ensure that every person will delight in. Make sure that everyone actually reaches take part in this kind of hobby. And when food is cooked properly or maybe the wedding cake is baked, you’ll be able to feed on it together together with the family. All people will obviously be happy you can eat the fresh fruit of these labor. Apart from preparing foodOrthe baking, additionally you can contemplate a few other pursuits like painting, dance, vocal range, studying, watching motion pictures and a lot of far more.These are just incredibly methods to attachment with the fam but these can be extremely efficient. It is not necessary for you devote lots of money as these easy points can certainly carry delight to all people specifically if the household is complete. It is not really crucial that these items should be carried out each day. Once every seven days or even a few times monthly will perform.

  7. Hello! I know this is somewhat off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

  8. excellent post, very informative. I ponder why the other specialists of this sector do not understand this.
    You should proceed your writing. I’m sure, you have a huge readers’ base
    already!

  9. Greetings from California! I’m bored to death at work so I decided to check out your website on my iphone during lunch break. I enjoy the knowledge you present here and can’t wait to take a look when
    I get home. I’m shocked at how fast your blog loaded on my phone .. I’m not even using WIFI, just 3G .
    . Anyhow, very good blog!

  10. Undeniably believe that which you said. Your favorite reason appeared
    to be on the internet the simplest thing to be aware of.

    I say to you, I certainly get irked while people consider worries
    that they just do not know about. You managed to
    hit the nail upon the top and also defined out the whole thing
    without having side-effects , people could take a signal.

    Will probably be back to get more. Thanks

    Look into my blog post rozliczenie pit online

  11. hello there there and thank you for your information and facts – I’ve surely
    picked up something new from suitable in this article. I did however know-how a few specialized problems
    using this website, considering the fact that I knowledgeable to
    reload the website a great deal of times prior to I could get it to load effectively.

    I had been wanting to know if your internet host is Alright?
    Not that I am complaining, but gradual loading situations times will
    from time to time impact your placement in google and can destruction your superior
    top quality rating if ads and internet marketing with Adwords.
    In any case I am including this RSS to my e-mail and could appear out for a great deal
    much more of your respective intriguing information. Be certain that you
    update this all over again really soon..

    My blog … Online Psychic (http://Www.Yoururl.Com)

  12. Very good post. I merely stumbled on the blog plus sought to mention that I’ve really loved browsing a blog posts.
    In any case I’ll be subscribing on your rss feed and I
    hope we write once again very soon!

  13. After going over a number of the blog posts on your web site, I really like your way of blogging.
    I saved it to my bookmark webpage list and will be checking back soon. Please check out my web site too
    and tell me your opinion.

  14. Thanks for any other informative website. Where
    else may I am getting that kind of information written in such a perfect way?
    I’ve a challenge that I am just now running on, and I have been on the look out for such information.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>