Lambda disabling and enabling
There are some possibilities to control (enable/disable) lambdas during its’ work.
Manual control allows to enable or disable lambdas inspiring by user request. Automatically lambda clean up allows to automatically disable lambdas which are not being used for a specified time.
Manual lambda control
It is possible to temporarily disable a lambda and restore it using the switch lambda request. When a lambda is disabled, it will not exists in the Kubernetes cluster, but remains in the database. The alive (can be received by using get lambda request) parameter shows it’s status.
It it possible to delete such a lambda or restore such a lambda.
When a lambda restores, it creation in the Kubernetes cluster will be executed again in the same way as lambda creation during the first lambda creation.
Inactive lambdas cleanup
Inactive lambdas clean up may be useful in the case of many lambdas (which required a lot of Kubernetes cluster resources) supposed to be created and will not be in demand during some time. To free Kubernetes cluster resources it is possible to enable automatic inactive lambdas clean up. In the case of inactive lambda will be in demand again, it is possible to restore such lambda.
- Requirements:
the LUNA_SERVICE_METRICS setting to be enabled
the LUNA_LAMBDA_INACTIVE_LAMBDA_CLEAR_INTERVAL setting to be enabled and properly configured
When the active parameter in the LUNA_LAMBDA_INACTIVE_LAMBDA_CLEAR_INTERVAL setting is set to true, it will check every check_interval seconds and automatically disable lambdas which last_usage is older than the specified interval (taking interval_type into account). If lambda is newly created or updated, it will not disable such lambda even in case it’s last_usage is NULL until the lambda last_update_time is older than the specified interval.
Note
Eternal lambdas, lambdas which creation are in progress and lambdas which creation were failed will not be taken into account by the above procedure.