bumpy-greece-4782
09/03/2024, 3:21 AMpulumi up
is very slow for a particular project that I have, which has 1500+ resources while the pulumi state file is over 8MB. It's unclear to me why Pulumi is taking so long (perhaps it's likely making a lot of network calls to the state file). What is the cause of this issue, and how can I speed this up?
I've seen some comments online saying to try
PULUMI_EXPERIMENTAL=true PULUMI_SKIP_CHECKPOINTS=true
but it's unclear to me what happens if I cancel the update before it completes.clever-sunset-76585
09/03/2024, 5:22 AMclever-sunset-76585
09/03/2024, 5:30 AMPULUMI_SKIP_CHECKPOINTS
. (I don't know what that does but just taking a guess based on its naming.)bumpy-greece-4782
09/03/2024, 5:11 PMbumpy-greece-4782
09/03/2024, 5:24 PMbumpy-greece-4782
09/03/2024, 5:25 PMclever-sunset-76585
09/03/2024, 5:32 PMwe use self-hosted backend (Azure)Ah well, that changes things. Yeah I don't know if Pulumi does JSON-patch for self-managed backends. I believe they do that for Pulumi Cloud. That allows the CLI to only upload smaller patch-style objects to their API.
is pulumi really uploading the entire state file for each resource update? (this was after 2 minutes)Yeah it's quite possible due to the CLI communicating with a non-Pulumi Cloud backend.
clever-sunset-76585
09/03/2024, 5:36 PMAlso when you say the update is slow, can you see the timings for the resources in your stack and tell if there are certain resources that contribute to the lengthy update time?
> what's one way of doing this you recommend? I've tried printing stuff out (using Python's print, but it gets lost when applying over this many resources)If you are running the stack up interactively through the CLI, it emits the timing for each resource at the end of the line.
clever-sunset-76585
09/03/2024, 5:37 PMbumpy-greece-4782
09/03/2024, 5:37 PMbumpy-greece-4782
09/03/2024, 5:44 PMIf you are running the stack up interactively through the CLI, it emits the timing for each resource at the end of the line.ah, so looking at some previous results, nothing really sticks out
bumpy-greece-4782
09/03/2024, 5:45 PMclever-sunset-76585
09/03/2024, 5:48 PMyeah, before doing that, would like to understand why it's slow.Agreed.
I'm guessing if we broke it up into other stacks, we could do things in parallel?Yes, mostly. You'd want to sequence them in some cases, like when you think there will be changes to stack outputs that downstream stacks might depend on etc.
clever-sunset-76585
09/03/2024, 5:59 PMPULUMI_SKIP_CHECKPOINTS
env var does help in your case since you are using a self-managed backend?
Lastly, is the region of your storage account the closest to where you are running the update from, since you mentioned you are running the update manually?bumpy-greece-4782
09/03/2024, 6:00 PMLastly, is the region of your storage account the closest to where you are running the update from, since you mentioned you are running the update manually?yes
clever-sunset-76585
09/03/2024, 6:02 PMtall-librarian-49374
09/03/2024, 6:57 PMI don't know if Pulumi does JSON-patch for self-managed backends.No, every operation writes the full file.