Deploying and scaling Xojo Web apps with GPU access

I’m building some Xojo Web apps that shell out to python to do AI stuff.

Using Xojo for the interface has been quite nice, shells have been playing well with all the helpers and it’s been relatively smooth so far.

The challenge is deployment and scaling. Right now I’m doing all my development on a Windows box with a local RTX 5090. The python code should be fairly portable over to Linux and whatever GPUs are available (as long as they have CUDA), but I’m wondering if anyone else here has deployed a Xojo Web app with these kinds of hardware requirements.

There are a few ways to architecture something like this, some better than others, and I just wanted to see if anyone else has gone down any of these paths.

You could go VPS with GPU or leased bare-metal. You’re paying for the hardware 24/7 whether you use it or not under this approach, and if you suddenly get an influx in usage you have to act quickly to spin up new servers, while maintaining a shared database and come up with some kind of load balancing scheme to move users between servers. It gets complicated and expensive fast.

You could also just buy or build the servers yourself and colocate them like a maniac (lol). As an independent dev this is just not in my financial budget, nor my time budget to manage all those servers.

The way I’m leaning right now is using something like RunPod where you basically build an API in a docker container that spins up on demand. You set thresholds for spinning up a copy of your container on additional hardware, set timeouts for spindowns, and pay for what you use. Your Xojo web app acts as a frontend to make the API calls, download the output and present it to your user.

Unfortunately this approach means customers might have longer wait times during spinups, but it really seems the most sensible path for what I’m doing.

Has anyone tried anything like this before with Xojo Web apps?

Docker container deployed on demand is the best solution in my opinion, as well as cost effective. But build the docker image once and just load it. Don’t rely on the server to build the container each time it has to start.

1 Like