Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Jacky_Liu1
Product and Topic Expert
Product and Topic Expert
509

Background Introduction

In some situation, customers find existing application can meet their requirements functionally. But customers have concerns about the performance. For example, we have build mission Add Printing Labels to Your User Experience for SAP S/4HANA Cloud with CAP Node.js, but customers have concerns for high concurrency situation. Then does customer need to adjust the existing code? The answer is no need. Customer can add Application Autoscaler Service Binding To Deployed Application and create Scaling Policy for the deployed application.

Steps:

Step 1. Add Application Autoscaler Service Binding To Deployed Backend Application

Go to your BTP subaccount Cloud Foundry Space in which the backend application has been deployed. Find the backend application.

Jacky_Liu_0-1747397432113.png

Jacky_Liu_1-1747397444271.png

Jacky_Liu_2-1747397453684.png

Jacky_Liu_3-1747397461579.png

Jacky_Liu_4-1747397469920.png

The following Json file defines the Scaling Policy. I will explain it a little later .

{
  "instance_min_count": 1,
  "instance_max_count": 5,
  "scaling_rules": [
    {
      "metric_type": "memoryused",
      "breach_duration_secs": 600,
      "threshold": 90,
      "operator": ">=",
      "cool_down_secs": 300,
      "adjustment": "+1"
    },
    {
      "metric_type": "memoryused",
      "breach_duration_secs": 600,
      "threshold": 30,
      "operator": "<",
      "cool_down_secs": 300,
      "adjustment": "-1"
    }
  ]
}

Jacky_Liu_5-1747397568067.png

Jacky_Liu_6-1747397588778.png

Jacky_Liu_7-1747397630378.png

Step 2. Restart your backend application.

Jacky_Liu_8-1747397649412.png

Step 3. You can check your scaler history in Application Autoscaler Dashboard.

Jacky_Liu_9-1747397673981.png

Jacky_Liu_10-1747397681489.png

Jacky_Liu_11-1747397698254.png

Explanation for Scaling Policy

You can define a policy to scale your application instances either dynamically or based on schedule.

If you want to scale your application instances based on memory or CPU usage, response time, throughput, or custom metrics. You can use Dynamic Scaling Policy

If you want scale your application instances based on schedules, you can use Schedule-Based Scaling Policy.

 

The Ends!

Thanks for your time!

Jacky Liu