-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Is 12 minutes to deploy typical for Serverless users?
In my particular setup, excludeDevDependencies: true adds more than 8 minutes to the deploy process. Without that option, the deployment fails because the .zip file is too big. I added some tracing to zipService.js and here's what I've found. At this point I'm just trying to determine if this is unusual.
TL;DR globbing takes a full minute. Calling npm --list takes another 57 seconds. Assembling the .zip file takes 6 minutes.
Each log statement is prefixed with the [seconds, nanoseconds] since the process started.
Excerpt from running serverless deploy:
[ 12, 25190919 ] 'Starting excludeNodeDevDependencies'
[ 12, 47845106 ] 'Starting glob'
[ 72, 989709228 ] 'Globbed result is 1505 entries'
[ 73, 30495874 ] 'Calling npm for dev to /tmp/node-dependencies-fb71857233022597-dev'
[ 73, 118999339 ] 'Calling npm for prod to /tmp/node-dependencies-fb71857233022597-prod'
[ 130, 757156996 ] 'Reading and processing files dev to /tmp/node-dependencies-fb71857233022597-dev'
[ 130, 763286285 ] 'Reading and processing files prod to /tmp/node-dependencies-fb71857233022597-prod'
[ 130, 765558586 ] 'Have dev and prod dependencies'
[ 130, 800656639 ] 'Finished excludeNodeDevDependencies'
[ 130, 801608750 ] 'Setting params.include and .exclude'
[ 130, 802846434 ] 'Finished setting params.include and .exclude'
[ 559, 979770199 ] 'In zipFiles()'
[ 560, 7526350 ] 'Adding 20163 files to /usr/src/app/.serverless/saas-dash.zip'
To get these logs, I first added this at the top of the file.
const time = process.hrtime();Then, I added statements like this throughout every function (using console.trace didn't prove useful).
console.log(process.hrtime(time), "Example"));Full changes to zipService.js: master...Blissfully:zipservice_tracing
Additional Data
- Serverless Framework Version you're using: 1.23.0
- Operating System: Linux via Docker (node:6.10.1-alpine) on Mac