What are the key steps involved in enabling autoscaling for my application?
To enable autoscaling for your application through a standalone monitoring script:
1. Integrate the provided acquia-autoscaling.js file into your project.
This script collects and exposes the performance metrics necessary for auto-scaling decisions.
2. Place the acquia-autoscaling.js file in the root of your project directory.
3. Modify the start command of your package.json to include the acquia-autoscaling.js file.
4. Install the prom-client dependency in the package.json with the following command:
For example, if your original start command was node server.js, change it to:
"start": "NODE_OPTIONS='-r ./acquia-autoscaling.js' node server.js"
For example, if your original start command was next start, change it to:
"start": "NODE_OPTIONS='-r ./acquia-autoscaling.js' next start"
This ensures that the monitoring script runs before your application starts. It makesthe metrics available and enables us to scale your application based on these metrics.
Place NODE_OPTIONS='-r ./acquia-autoscaling.js'
immediately before the main entry point command of the Node.js application as shown in the preceding example. Placing it elsewhere in the startup command does not enable autoscaling.
Note: Autoscaling is not enabled if the monitoring script is not configured
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.