And so do we! Monkeys are really good – you can train them to do simple jobs, and they'll keep doing them over and over; you can even have lots of monkeys doing their jobs at the same time!
Here at Boom Towers, we have a large collection of monkeys. Normally, having lots of monkeys in a small space would be a recipe for trouble – but fear not! We have used our (slightly) more advanced brains to come up with a system for managing them. Today, we offer this technology to you – you too can become a Monkey Lord!
Great! First, we will need a couple of monkeys:
Monkey number one: let's train him to do a really simple task - just have it take a look at the front page of our website:
Monkey number two has a slightly more intricate job to do; it will log into our website, post a new story, and then update that story.
With our two test-monkeys prepared, let's head over to the website and see how they handle it...
They sure do!
If you're convinced already and want to start using it for your commercial sites, you can skip straight down to buy the commercial version; if you want to get to know it a bit better first, try the personal use / evaluation version, and then follow along with the examples.
If you have any issues running the demo versions, please let us know; we want you to be able to see how lovely they are :-)
Sure, here's a relatively simple example of how I've used it myself:
To start with, we have a theory that the profile page is slow; it runs ~14 moderately heavy database queries on every page load and there is no caching at all.
Step 1: Confirm our suspicion that the page really is slow.
It can be very tempting to optimise based on what you think should be slow, rather than looking at what is slow. So let's make a little monkey who loads the profile page and records how fast it loads.
with this simple monkey trained, we can run it a few times:
$ ./monkey-swarm --tribe civicboom --monkey profile -r 5 -w [...] ---- Results: num min max ave h/s url 5 1.244 1.323 1.263 0.79 GET /profile 5 0.059 0.091 0.080 12.44 POST /account/signin.json 10 0.059 1.323 0.672 6.61
So we see that signing in takes an average of 0.08 seconds, but then loading the user's profile takes 1.26 – if we define "acceptable" as "under one second", then it is clear that users have a problem as soon as they log in. (Our live server is about 4x as fast as my testing laptop, but even then, 0.31s has room for improvement)
Step 2: Make a guess at a solution.
Those who use Civicboom will see that our profile page has two parts – on the left side of the screen is the user's private information, articles, to-do lists, etc. On the right side of the screen is a list of featured articles – the latest questions, most active discussions, most viewed stories, etc. Since the information there is all totally public, and it doesn't matter if it is a few minutes out of date, what happens if we cache it?
(Shish goes away and adds the
@cacheable decorator to the
featured content list)
Step 3: Test that our solution actually helps.
$ ./monkey-swarm --tribe civicboom --monkey profile -r 5 -w [...] ---- Results: num min max ave h/s url 5 0.620 0.730 0.648 1.54 GET /profile 5 0.056 0.081 0.068 14.62 POST /account/signin.json 10 0.056 0.730 0.358 8.08
Hooray, we have doubled the speed of the profile page, and we have some hard numbers proving that we aren't just imagining the improvement \o/
Ok, here are some more advanced monkeys, part of our Civicboom testing tribe:
A monkey that looks at our API to find the most recently posted articles, then picks a few at random to look at:
A monkey who generates a random image to attach to an article:
What do you get when you buy Monkey Swarm?
These are not actual real monkeys in the mammal sense of the word! The monkeys we are using are software monkeys – short bits of code designed to autonomously interact with other computer systems.
Recent versions of Windows, Linux, and OSX are natively supported.
To be exact:
These tools are great for testing web servers, they tell you how long it takes to create a TCP connection, how many bytes per second get transferred, etc. They aren't so great for testing web sites though — Monkey Swarm will interact with your site at a higher level, logging in, browsing pages, uploading new data, etc.
Selenium uses one virtual user at a time, checking that your website works correctly; Monkey Swarm runs many virtual users and checks that your website performs well at scale. We recommend using both of them together, as both aspects are important for success.
Charles analyses your web traffic, Monkey Swarm creates traffic. As above, both of these levels are important to understand, so we recommend using both tools.
Feel free to email us at email@example.com; paid customers receive priority support, but we aim to answer all questions within a working day or two :-)