Replies: 1 comment
-
Same experience here. Also wish it was the default. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, the
publishAssetsInParallel
setting defaults totrue
. While I can appreciate this being useful for some cases, I'd be skeptical of it being a good default setting.The theoretical advantage is that if you have many assets that need to build and they take a long time to compile, you can parallelize. However, we've found this setting to actually be slower, more expensive, more difficult to debug, and more complicated to maintain.
I'll caveat this by noting that our usage of CDK is around serverless infra that makes primary use of Lambda Node runtimes with TypeScript and local esbuild compilation without Docker.
Regarding cost, I think it's perfectly reasonable to expect that cost would be higher in return for better performance. However, for our usage, we're seeing cost being as much as 20X higher despite being slower. Our build stages for Assets usually complete either under a minute or maybe within a few minutes. But having 20 CodeBuild projects run that all may take under a minute each but collectively get billed for a 1 minute duration minimum each costs way more.
Parallelization should theoretically make things faster, but the overhead of the project setup is actually the bulk of the time for us. Waiting for containers to queue and provision actually often takes minutes on its own. Even if we disregard that, the dependency install is where a lot of time goes and gets duplicated. We found our pipelines to build several minutes faster through the Asset stage with parallelization off.
The burden of CodeBuild project pollution with the randomly generated names from the CDK also makes things a bit of a mess to manage and keep track of. The CodeBuild console is full of noise. There is nothing meaningful about the project for Asset17 failing vs Asset14 at a glance.
Maybe this default is more appealing to users using non-TS runtime languages or building with Docker? If it turns out that this still makes sense to keep the existing defaults, maybe documentation should be updated to note that for serverless focused users, a setting of
false
would be better?Beta Was this translation helpful? Give feedback.
All reactions