Cost Optimization
In the cloud-native era, Huawei Cloud's FunctionGraph offers a serverless platform for on-demand code execution. As services grow more complex, controlling costs while leveraging FunctionGraph's agility and elasticity is crucial.
This section outlines strategies for cost optimization to help you use FunctionGraph efficiently, ensuring stable operations and minimizing expenses.
Reducing the Execution Memory
FunctionGraph charges you based on the memory size. If you configure too much memory for a function, you will be billed for extra fees. You can adjust the memory based on the monitoring data. For details about the memory usage, see Viewing FunctionGraph Monitoring Data. For details about the memory configuration, see Configuring General Information About a Function.
Enabling the Dynamic Memory of a Function
FunctionGraph allows you to enable dynamic memory for a function. After dynamic memory is enabled, the resource specifications used by the function instance can be set when the function processes a specified request, minimizing resource usage and reducing costs. For details, see Configuring the Dynamic Memory of a Function.
Configuring Maximum Instances of a Function
FunctionGraph allows you to configure the maximum number of instances for a function to prevent excessive instance usage. You can configure the maximum number of instances based on the elastic instance metric. For details, see Viewing FunctionGraph Monitoring Data.
Configuring a Proper Number of Reserved Instances
FunctionGraph reserved instances are billed based on their running duration. Enabling too many reserved instances will incur extra costs. You can reduce the number of reserved instances manually or by the auto-scaling policies. For details, see Reserved Instance Management.
Enabling Idle Mode for Reserved Instances
You can enable the idle mode for reserved instances to save money. For details, see Reserved Instance Management.
Optimizing Function Timeout
FunctionGraph billing is based on function execution duration and times. If a function times out, you will be billed for it. To reduce costs, optimize or disable the function promptly. You can determine whether a function times out based on the execution duration. For details about the monitoring metrics, see Viewing FunctionGraph Monitoring Metrics.
Configuring Heartbeat Detection for a Function
The heartbeat function monitors user functions for issues like deadlocks, memory overflow, or network errors. If it detects an abnormality, FunctionGraph terminates the instance to prevent unnecessary costs from failed retries. For details, see Configuring Heartbeat Detection for a Function.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot