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