Skip to content

Improve build performance of NodejsFunction on Mac (@aws-cdk/aws-lambda-nodejs package) #8544

@Dzhuneyt

Description

@Dzhuneyt

Using volumes in Docker on Mac specifically is a huge pain point due to performance issues. CPU often spikes to above 100% utilization when there is heavy read or write operations inside the container (as it happens with the parcel-builder Docker container that the CDK construct NodejsFunction uses internally.

This has been very well documented in https://docs.docker.com/docker-for-mac/osxfs-caching/ and the workarounds are also described.

I suggest we force Docker volume mounts within this construct to start using Docker volume in "delegated" mode, to improve build performance (speed) on Mac based deployment environments.

I think a good starting point is:
https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-lambda-nodejs/lib/builder.ts#L118

Use Case

Developing and deploying CDK stacks with many lambdas on a Mac machine.

Proposed Solution

Replace -v sourcevolume:targetvolume with -v sourcevolume:targetvolume:delegated

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-lambda-nodejseffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.in-progressThis issue is being actively worked on.os/macRelated specifically to MacOS behaviorp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions