GCP Classroom Series – 18/Mar/2021

Autoscaling experiment

  • I have created an instance template with lamp image and instance size e2-medium (2VCPUs and 4GB of RAM) Preview

  • Now lets create a instance group with minimum 1 instance and maximum 5 instances Preview Preview Preview Preview

  • Now lets wait for the instance group to be launched and then create a load balancer Preview

  • Lets create a load balancer Preview Preview Preview

  • Now lets access the application using loadbalancer ip Preview

  • Now lets create artifical load on the cpu, for that lets login in to the vm and execute stress commands Preview

stress --cpu 8 --vm 2 --vm-bytes 128M --timeout 100m -v

Preview Preview

  • Now lets try to stop the stress command and see if the servers come down Wait for atleast 10 mins Preview
  • Number of instance were decreased as load on cpu decreased
  • Exercise:
    • Create a gcp image with tomcat 8 installed Refer Here
    • Also install stress
    sudo apt install stress -y
    
    • tomcat runs on port 8080
    • Now create an instance template with 2 VCPUs and 4 GB of RAM
    • Now create an instance group (min 1 and max 2) and a load balancer
    • Ensure you create port mapping in instance group with 8080
    • loadbalancer frontend port 80 and backend port 8080 Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin