Vite build takes 7× longer in fly machines

What the title says. Is CPU throttling the issue?

Help me understand the following graph

Correct me if I’m wrong but I believe vite would build inside your dockerfile and serving your app would have it already bundled and no compilation needed. Likewise for other nodejs based apps that compile some JS/css assets.

Can you share your Dockerfile and talk a bit about your app?

If we were to pre-build static files, can do that via S3/R2, don’t even need Docker

For this usecase, the build has to happen on the machine. Unfortunately can’t share much about the app itself is confidential. Should be reproducible with any Vite-based apps.

I see now. For this would very likely want to use performance machines to prevent throttling.

We have some docs that explain these graphs here:

Yeah, I’ve used performance machine 8gb and 16gb one, it’s suprising that neither had any effect

Lemme try to ask the team!

Got some feedback from the team. Perhaps the throttle here really is rootfs speed.

Would you mind trying building your vite app with its contents inside a volume?

I created a volume, copied the files to it, but no luck; it takes the same amount of time.
This is the Disk I/O graphs, I don’t know how to make sense of these

When you mention vite is 7x slower, is it in comparison to what?

Also, if you can send me a couple machine IDs we can take a look from our end too. One machine with and another without volume if possible.

You can send to lubien [at] fly [dot] io

1 Like

I am not sure if there is enough information to go on here. Maybe you could create a public repo with a Vite project that is complex enough to take a non-trivial amount of time, so that readers could try it. Are you comparing it to the same operation on a dev laptop?

Off the top off my head, if a better machine CPU and a volume hasn’t helped, I’d next try a RAM disk, in case Vite builds are generally write-heavy.

1 Like

Can you confirm if youre moving your source code to your volume before building it?

Yes, 1st time I spun up a machine, mounted the volume, copied the code. Now everytime I spin up a machine and mount the volume the code is already there.

This might be important. Example from my setup: build on vite@8.0.0-beta.0 on dev machine takes about 2.5s, on the beefiest Depot builder (16 CPU, 32GB RAM), it takes about 12s. The cloud machines are just slower.

1 Like

Got it. I was under the assumption that you were copying always.

Just copying the source from the image rootfs to the volume if it’s fairly big would totally trigger io limiting. For node based projects, moving node modules around is the killer - they’d need to move only their actual code to the volume before doing things in there

Can you share a minimal app we could reproduce this issue?

Slowing down is fine, but knowing why would really help work around it

I sent you a email will the machine details

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.