Site icon Learning & Doing

Autoscaling an Instance Group with Custom Cloud Monitoring Metrics

Instance

“Autoscaling an Instance Group with Custom Cloud Monitoring Metrics”

Pengantar

Aplikasi penskalaan otomatis menggunakan skrip Node.js yang diinstal pada instance Compute Engine. Skrip melaporkan nilai numerik ke metrik pemantauan Cloud. Anda tidak perlu mengetahui Node.js atau JavaScript untuk lab ini. Menanggapi nilai metrik, aplikasi menaikkan atau menurunkan grup instance Compute Engine secara otomatis sesuai kebutuhan.

Praktikum

Task 1. Creating the application

Uploading the script files to Cloud Storage

Task 2. Create a bucket

gsutil cp -r gs://spls/gsp087/* gs://<YOUR BUCKET>

Task 3. Creating an instance template

Task 4. Creating the instance group

Task 5. Verifying that the instance group has been created

Task 6. Verifying that the Node.js script is running

Task 7. Configure autoscaling for the instance group

Metric type: Cloud Monitoring metric

Metric export scope: Time series per instance

Metric identifier: custom.googleapis.com/appdemo_queue_depth_01

Utilization target: 150

Utilization target type: Gauge

Minimum number of instances: 1

Maximum number of instances: 3

Task 8. Watching the instance group perform autoscaling

Task 9. Autoscaling example



    11:27 Autoscaling Group starts with a single instance. The aggregate custom metric target is 150.

    11:31 Initial metric data acquired. As the metric is greater than the target of 150 the autoscaling group starts a second instance.

    11:33 Custom metric data from the second instance starts to be acquired. The aggregate target is now 300. As the metric value is above 300 the autoscaling group starts the third instance.

    11:37 Custom metric data from the third instance starts to be acquired. The aggregate target is now 450. As the cumulative metric value is above 450 the autoscaling group starts the fourth instance.

    11:42 Custom metric data from the fourth instance starts to be acquired. The aggregate target is now 600. The cumulative metric value is now above the new target level of 600 but since the autoscaling group size limit has been reached no additional scale-up actions occur.

    11:44 The application script has moved into a low metric 15 minute period. Even though the cumulative metric value is below the target of 600 scale-down must wait for a ten minute built-in scale-down delay to pass before making any changes.

    11:54 Custom metric data has now been below the aggregate target level of 600 for a four node cluster for over 10 minutes. Scale-down down now removes two instances in quick succession.

    11:56 Custom metric data from the removed nodes is eliminated from the autoscaling calculation and the aggregate target is reduced to 300.

    12:00 The application script has moved back into a high metric 15 minute period. The cumulative custom metric value has risen above the aggregate target level of 300 again so the autoscaling group starts a third instance.

    12:03 Custom metric data from the new instance have been acquired but the cumulative values reported remain below the target of 450 so autoscaling makes no changes.

    12:04 Cumulative custom metric values rise above the target of 450 so autoscaling starts the fourth instance.

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Autoscaling an Instance Group with Custom Cloud Monitoring Metrics. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

Exit mobile version