TheKoguryo's Tech Blog

 Version 2024.04.01

Warning

This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.

13.3 Autoscaling Test

Scale Out occurrence test

  1. Go to the Instance Pool and connect to the current Compute instance with SSH.

  2. Install the stress tool

    sudo yum-config-manager --enable ol7_developer_EPEL
    sudo yum install -y stress
    
  3. Perform stress

    sudo stress --cpu N
    
  4. Execution example

    Continue to apply the load by adjusting the number of CPUs of the Compute Instance to be used. Considering the Cool Down value determined when auto-scale is set, apply a load longer than that time.

    [opc@autoscalingwebserver ~]$ sudo stress --cpu 4
    stress: info: [21438] dispatching hogs: 4 cpu, 0 io, 0 vm, 0 hdd
    

Monitoring during load occurrence

  1. Open the navigation menu in the OCI console. Go to Compute > Instance Pools.

  2. Move to the detail screen of the instance pool to be autoscaling.

  3. Support monitoring of instance pools in Resources > Metrics.

  4. For Metric namespace, if you select oci_computeagent, you can view metric information about VMs in the instance pool. CPU load is being monitored as shown below.

    image-20220117184113272

Check Scale Out

  1. Autoscaling occurs as shown in the figure as the load continues to occur beyond the specified Cooldown.

    image-20220117184257200

  2. In Instance Pool details, you can see the result of server addition completed.

    image-20220117184339391

  3. You can see that a new server is added in the Load Balancer’s Backend Set.

    image-20220117184503043

  4. You can see that the average CPU load of the Instance Pool is cut in half due to the addition of servers.

    image-20220117184748590

  5. Connect to LB’s Public IP through a browser.

    image-20220117184851467

  6. Refresh your browser.

    image-20220117184916367

Check Scale In

  1. Stop the load given by the SSH connection terminal of the server No. 1.

    [opc@autoscalingwebserver-264316 ~]$ sudo stress --cpu 4
    stress: info: [7772] dispatching hogs: 4 cpu, 0 io, 0 vm, 0 hdd
    ^C
    [opc@autoscalingwebserver-264316 ~]$
    
  2. Check the decrease in the average CPU load of the Instance Pool in Monitoring image-20220117190510801

  3. As the load is reduced, autoscaling occurs as shown in the figure. image-20220117185740078

  4. Scale In becomes Scale In in the order of terminating the instances except first from the Load Balancer. image-20220117190057835

  5. Complete Scale In image-20220117190226922

  6. It was also confirmed that the Load Balancer’s Backend Set was deleted. image-20220117190320038



As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.

Last updated on 17 Jan 2022