Capability & Cost for Memory-Intensive Server Side Functions

I have an app created in Anvil. The layout of the app is done in the Forms, and I have code running on my local (personal) machine callable with @anvil.server.callable to do the heavy number crunching. To make the response snappy, it has ~2GB of JSON objects loaded in memory. It works beautifully, but is dependent on (1) my local machine, and (2) my internet connection for anyone else to use the app.

This is not a showstopper- I have an extra workstation I can use effectively as a server. But I might prefer to do this on Anvil’s AWS-hosted servers. A few questions that arise are:

  1. What is the default memory allotment? And can we buy more?
  2. Can I do something in a server module like
    with open(“really_big_JSON.txt”) as handle:
    dictionary = json.load(handle)
  3. Will the variables loaded in memory in question (2) persist between users & sessions as the loading process is slow?

Thanks in advance.

Hi there,

2GB continuous memory usage isn’t the kind of thing we support on the Individual or Team plans. If you’re interested in a Business plan with the kind of dedicated memory resources to make that possible, drop us an email at contact@anvil.works, and we’d be happy to help.

Otherwise, if you’re happy hosting and managing a machine yourself, then running an uplink server (on your own machine or on AWS) is the way to go.