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 <./_static/api.html#operation/switchLambda>`_. 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 <./_static/api.html#operation/getLambda>`_) parameter shows it's status. It it possible to `delete such lambda <./_static/api.html#operation/deleteLambda>`_ or `restore such lambda <./_static/api.html#operation/switchLambda>`_. When lambda restores, it creation in Kubernetes cluster will be executed again in the same way as `lambda creation <./creation_pipeline.html#creation-pipeline>`_ during `first lambda creation <./_static/api.html#operation/createLambda>`_. 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 <./_static/api.html#operation/switchLambda>`_. 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.