Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-568

Document/improve how to shrink the size of the NodeJS SDK for deployment in AWS lambda

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 3.0.0-alpha1
    • None
    • docs, library
    • None
    • 1

    Description

      AWS lambda enforces strict limits on the size of an application that can be deployed and with our NodeJS SDK growing, we should investigate what can be done to shrink it either out-of-the-box or will flags.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          I believe the AWS lambda limit on package + dependancies is 250MB.  Last I checked, the Node.js SDK is nowhere near this limit.  What prompted your concern over the size?

          brett19 Brett Lawson added a comment - I believe the AWS lambda limit on package + dependancies is 250MB.  Last I checked, the Node.js SDK is nowhere near this limit.  What prompted your concern over the size?
          perry Perry Krug added a comment -

          According to the customer -

          In Lambda you have 2 limitations for "package" size:

          1. Zipped package - up to 50MB
          2. Unzipped package – up to 250MB

           

          So for example, when we are using Python platform, when we are using multiple libraries (such as: Couchbase, numpy, etc…), the total size of zipped package cannot exceed the 50MB.

           

          The issue was raised when we notice that from time to time, the CB package size is increasing, so for packages that we already been very close to the limit, we were not able to work with CB library new version.

          From quick test, I found the following:

          (CB nodejs library)
          v2.4.5 – 4MB~

          v2.6.2 – 5.5MB.~

          v2.6.5 – 5.3MB~

          and I have memory that in one case there was version with 7MB~ size.

           

          That was the issue.

          perry Perry Krug added a comment - According to the customer - In Lambda you have 2 limitations for "package" size: Zipped package - up to 50MB Unzipped package – up to 250MB   So for example, when we are using Python platform, when we are using multiple libraries (such as: Couchbase, numpy, etc…), the total size of zipped package cannot exceed the 50MB.   The issue was raised when we notice that from time to time, the CB package size is increasing, so for packages that we already been very close to the limit, we were not able to work with CB library new version. From quick test, I found the following: (CB nodejs library) v2.4.5 – 4MB~ v2.6.2 – 5.5MB.~ v2.6.5 – 5.3MB~ and I have memory that in one case there was version with 7MB~ size.   That was the issue.
          brett19 Brett Lawson added a comment -

          Hey Perry,

          This doesn't seem to match up with what I'm seeing.  Which is that the total size is 3.47MB, but the majority of that size is actually from two dependancies which are highly prevalent in Node.js, and it is extraordinarily likely a project will already be using those dependancies anyways.  Note also that our codebase is actually quite compact, there isn't much place to trim anything out.

           

          Cheers, Brett

          brett19 Brett Lawson added a comment - Hey Perry, This doesn't seem to match up with what I'm seeing.  Which is that the total size is 3.47MB, but the majority of that size is actually from two dependancies which are highly prevalent in Node.js, and it is extraordinarily likely a project will already be using those dependancies anyways.  Note also that our codebase is actually quite compact, there isn't much place to trim anything out.   Cheers, Brett

          People

            brett19 Brett Lawson
            perry Perry Krug
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty