I’m trying to build the MVP for an webapp on Anvil, and I’m running into some performance issues with the free tier after some poking around.
Namely, initializing a server seems to take a long time (13-20 seconds) after the server gets kicked due to inactivity. This alone is making me consider moving up to a paid tier. Some questions…
Apx how long does it take to spin up a server on hobby and business tiers for the first user of the day?
Apx how long before a server is kicked due to inactivity on hobby and business tiers?
My only other experience with app dev is Google Cloud App Engine where we had a persistent instance. Iirc Anvil does not offer persistent server until the Enterprise tier. Is that correct?
30 seconds is the timeout for all server functions.
Correct.
In general, you really want to do a performance analysis before you’d upgrade to a paid tier just for performance. There are an awful lot of reasons that an app might start up slow, both on the client and server sides. If you do some forum searches on performance, you’ll see a variety of things to check.
Or, if you have a minimal app that demonstrates the issue, you can post a clone link here for others to take a look at.
There is the timeout for server calls, which is 30 seconds, after which the server call crashes.
There app Python process, which can take anywhere between 0.5 and 5 seconds to start up.
There is the cold start of a full environment, I imagine s container, which can take 15-20 seconds.
The 30 second timeout can be addressed using background tasks.
If all server calls are slow, you can enable the persistent server and avoid starting a new process and importing all the modules at each call. Even persistent servers are killed if unused, but here we are talking about the short import time.
I can’t say much about the cold start, which I think it’s a new container starting up. I have a dedicated server and I’ve seen it very few times. But I don’t think the persistent server is designed to address this… unless it is.