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 specified time.
Manual lambda control
It is possible to temporarily disable lambda and restore it using switch lambda request. When 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 lambda or restore such lambda.
When lambda restores, it creation in Kubernetes cluster will be executed again in the same way as lambda creation during 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:
LUNA_SERVICE_METRICS setting to be enabled
LUNA_LAMBDA_INACTIVE_LAMBDA_CLEAR_INTERVAL setting to be enabled and properly configured
When active parameter in 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 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 lambda last_update_time is not older than specified interval.
Note
Eternal lambdas, lambdas which creation are in progress and lambdas which creation were failed will not be taken into account during the above procedure.