Skip to content

Created auto-scaling group within tutorial #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed docs/tutorial/.DS_Store
Binary file not shown.
127 changes: 127 additions & 0 deletions docs/tutorial/auto-scaling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
Fleet allows you to easily manage your auto-scaling group whereby you can set a min/max of servers for a particular environment.

When you describe an environment you can see min/max server pool limits in place as well as how many frontends a particular release is currently running:
```bash
$ fleet env describe prod
---------------- -------------------------
name prod
status RUNNING
whitelist allow-all
ssl certificate prod
created 2015-03-24 23:06:21+00:00
updated 2015-06-30 05:53:09+00:00
recycling ON
tracked branches fleet-deploy
previous release
'autoscaling min 2'
'autoscaling max 4'
---------------- -------------------------

Releases:
name status loaded updated 'frontends'
------- ---------- ------------------------- ------------------------- -----------
037205f * ACTIVE * 2015-06-30 05:37:51+00:00 2015-06-30 05:44:22+00:00 '2'

Endpoints:
-------- ------------------------------
admin admin.prod.ancora.f.nchr.io
adminssh adminssh.prod.ancora.f.nchr.io
www www.prod.ancora.f.nchr.io
-------- ------------------------------
```

## Limits

In the event that you need to serve more traffic you can simply expand your server pool 'limits' from 2/4 (min/max) to say 4/10 servers like so:

```bash
$ fleet env autoscaling limits prod 4 10
```

There are resources limits in place on your Fleet account for the total number of instances you can run. At any point you see for yourself how many instances you are running and what the current max amount is set to by running:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resources -> resource (no plural needed there)

"At any point you see for yourself how many instances you are running and what the current max amount is set to by running"
Missing word? "At any point you can see for yourself"
Also, better to use number rather than amount for instances.


```bash
$ fleet limits

name current max
--------- --------- -----
instances 16 60
```

## Desired

You have the option rather than waiting for your infrastructure to elastically scale you can explicitly set the 'desired' amount of servers you want in place. In this example increasing it to six (6) for production:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"You have the option rather than waiting for your infrastructure to elastically scale you can explicitly set the 'desired' amount of servers..." doesn't read right.

"You have the option rather than waiting for your infrastructure to elastically scale to explicitly set the 'desired' number of servers..." would work better.

Or possibly:
"Rather than waiting for your infratructure to automatically scale, you can explicitly set the 'desired' number of servers..."


```bash
$ fleet env autoscaling desired prod 6
```

## Recycling

Within each environment you have the option to turn 'ON' instance recycling which in the event that any frontend node fails a health check it will be recycled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly missing a few words?
"turn 'ON' instance recycling which in the event that"
to
"turn 'ON' instance recycling which means that in the event that"


```bash
$ fleet env prod recycling ON
$ fleet env describe prod
---------------- -------------------------
name prod
status RUNNING
whitelist allow-all
ssl certificate prod
created 2015-03-24 23:06:21+00:00
updated 2015-07-02 04:29:25+00:00
recycling 'ON'
tracked branches fleet-deploy
previous release
autoscaling min 2
autoscaling max 4
---------------- -------------------------

Releases:
name status loaded updated frontends
------- ---------- ------------------------- ------------------------- -----------
8ef9d2f * ACTIVE * 2015-06-09 01:50:25+00:00 2015-06-29 05:07:55+00:00 2

Endpoints:
-------- ------------------------------
admin admin.prod.ancora.f.nchr.io
adminssh adminssh.prod.ancora.f.nchr.io
www www.prod.ancora.f.nchr.io
-------- ------------------------------
```

We have a standard health check script stored on your frontends which for reference can be viewed on the admin node:

```bash

$ ssh deploy@adminssh.prod.ancora.f.nchr.io
$ cat health-checks/fleet-health-check.php

<?php

require('../app/public/app/Mage.php');

// Initialise Magento
Mage::app();

// Get a random value for tests
$rand = rand();

// Test database works
$product_id = Mage::getModel('catalog/product')->getCollection()->getAllIds(1);

// Test cache works
$cache = Mage::app()->getCacheInstance();
$cache->save($rand,'heathcheck',array(),5);
assert($cache->load('heathcheck') == $rand);
$cache->remove('healthcheck');

// Test sessions work
$session = Mage::getSingleton('core/session');
$session->setData('healthcheck',$rand);
assert($session->getData('healthcheck') == $rand);
$session->clear();

echo 'OK';

```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ pages:
- 'Create a release': 'tutorial/create-release.md'
- 'Staging environment': 'tutorial/staging-environment.md'
- 'Production environment': 'tutorial/production-environment.md'
- 'Auto-scaling groups': 'tutorial/auto-scaling.md'