lambda-warmer | A module to optimize AWS Lambda function cold starts | Cloud Functions library

 by   jeremydaly JavaScript Version: 2.0.1 License: MIT

kandi X-RAY | lambda-warmer Summary

kandi X-RAY | lambda-warmer Summary

lambda-warmer is a JavaScript library typically used in Serverless, Cloud Functions, Pytorch, Nodejs applications. lambda-warmer has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i lambda-warmer' or download it from GitHub, npm.

A module to optimize AWS Lambda function cold starts
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              lambda-warmer has a low active ecosystem.
              It has 475 star(s) with 54 fork(s). There are 16 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 4 open issues and 10 have been closed. On average issues are closed in 617 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of lambda-warmer is 2.0.1

            kandi-Quality Quality

              lambda-warmer has 0 bugs and 0 code smells.

            kandi-Security Security

              lambda-warmer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              lambda-warmer code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              lambda-warmer is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              lambda-warmer releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lambda-warmer
            Get all kandi verified functions for this library.

            lambda-warmer Key Features

            No Key Features are available at this moment for lambda-warmer.

            lambda-warmer Examples and Code Snippets

            No Code Snippets are available at this moment for lambda-warmer.

            Community Discussions

            Trending Discussions on lambda-warmer

            QUESTION

            Lambdas stop invoking after a period of time
            Asked 2018-Oct-30 at 22:18

            Here's my setup:

            A Python 3.6 lambda function, which I want to keep pre-warmed at a certain concurrency level (say, 10). The lambda's initialization is painful enough that I don't want to inflict this cost on visitors at random. I call these lambdas "workers"

            A Node lambda function which runs every 5 minutes to try to pre-warm 10 instances. It uses the Event invocation type for 9 of them, and RequestResponse for 1. There's only either one or zero of this lambda running at any one time. I call this a "warmer".

            I followed the guidelines at [https://www.jeremydaly.com/lambda-warmer-optimize-aws-lambda-function-cold-starts/], namely:

            • Don’t ping more often than every 5 minutes
            • Invoke the function directly (i.e. don’t use API Gateway to invoke it)
            • Pass in a test payload that can be identified as such
            • Create handler logic that replies accordingly without running the whole function

            Here's a problem: this works great for several minutes. Then, as I watch the logs, I start to get timeouts from my worker lambda invocations. The timeouts quickly take over all the invocations that the warmer is trying to launch.

            Now, no worker lambdas are prewarmed any more. But the warmer keeps on trying, on a Cloudwatch event cron schedule, suffering 100% timeouts. Finally, Lambda stops trying to launch my worker lambdas at all. It feels like some aspect of Lambda's getting its state scrambled. The only way to recover is to re-deploy the lambda. That buys me another hour with pre-warmed lambdas working.

            Questions:

            • How do I get visibility into why my worker lambdas start timing out, and then become completely non-responsive?
            • What is the definition of a "Concurrent Execution"? On the main Lambda dashboard it shows me this chart of them. Yet, it seems to have more than twice as many Concurrent Executions as I'm requesting.

            Here's the warmup lambda code (Node):

            ...

            ANSWER

            Answered 2018-Oct-29 at 15:39

            It was the warmer (Node) lambda going haywire, even though all the logs pointed at the worker (Python) lambdas. After setting context.callbackWaitsForEmptyEventLoop = false, the problem disappeared.

            Source https://stackoverflow.com/questions/53017599

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install lambda-warmer

            Install Lambda Warmer from NPM as a project dependency.

            Support

            I've created a number of custom scripts to do similar cold start mitigation, but I figured I'd share this more complete version to save everyone some time (including my future self). If you would like to contribute, please submit a PR or add issues for bug reports and feature ideas.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i lambda-warmer

          • CLONE
          • HTTPS

            https://github.com/jeremydaly/lambda-warmer.git

          • CLI

            gh repo clone jeremydaly/lambda-warmer

          • sshUrl

            git@github.com:jeremydaly/lambda-warmer.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Cloud Functions Libraries

            Try Top Libraries by jeremydaly

            dynamodb-toolbox

            by jeremydalyTypeScript

            lambda-api

            by jeremydalyJavaScript

            serverless-mysql

            by jeremydalyJavaScript

            data-api-client

            by jeremydalyJavaScript

            dynamodb-streams-processor

            by jeremydalyJavaScript