Scaling the compute layer

  1. Let's create a second instance with a larger capacity (t2.large), as follows:
aws ec2 run-instances --image-id ami-14c5486b --key-name BookShelfApp --instance-type t2.large --security-group-ids sg-bddd92cb --user-data file://bootstrap.txt
Store the results on a spreadsheet.
  1. To switch traffic over to our larger instance, we will implement the floating IP cloud pattern (http://en.clouddesignpattern.org/index.php/CDP:Floating_IP_Pattern) by reassociating the virtual IP from the active to the passive instance, as shown in the following diagram:
  1. Issue the following command by using your new instance ID and the previous IP's ID allocation:
aws ec2 associate-address --instance-id i-096a8c337e10e9edf --allocation-id eipalloc-d300d8db
  1. Perform the load test again and write down the results, in order to establish a quantitative benchmark, as follows:
ab -n 1000 -c 10 -k -H "Accept-Encoding: gzip, deflate" http://52.44.105.242/
  1. My results are depicted in the following table:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.187.113