Skip to content

Experience Caching

Fetching experience data from cloud storage can potentially involve a large amount of data transfer depending on the size of the experience. In a lot of cases the experience data either doesn't change or at least doesn't change very often. Thus it is not particularly efficient or cost-effective to pull identical experience data for every test that requires it. For this reason we have introduced the experience caching feature.

How Does It Work?

When we run your workloads, they are supervised by a worker. That worker does jobs like pulling the experience data, collecting container metrics and collating and storing your logs and metrics. For the experience data, we mount a shared storage location that is unique and isolated to your organization and create a directory with the ID of the target experience. We then sync the contents of your experience location with that directory. That directory is then mounted in your workload container(s) at /tmp/resim/inputs in the case of your experience build and /tmp/resim/inputs/experience for metrics builds.

When we do this for the first time, we record a timestamp for when it was last updated. For subsequent uses of that experience, when we come to the sync job, we check each file in the cloud storage location's lastModified timestamp against our timestamp and only update or download files that are newer than that. Any files that do not exist in the cloud storage location are then deleted from our cache as well.

This means we're pulling the minimum subset of data every time, but ensuring we check the status of every file individually for changes.

What Do I Need to Do?

Absolutely nothing. We'll let you know if this feature is available to you, but please reach out if you need more info.

What Do I Need to Know?

The Experience Data is read-only

Because we share the experience data with potentially concurrent running jobs, we have to ensure its integrity. Thus the directory is mounted read-only. To clarify, in an experience job, the /tmp/resim/inputs directory is read-only, and in a metrics job, the /tmp/resim/inputs/experience directory is read-only.

How Do I Invalidate the Cache?

The easiest way to ensure the cached copy of a particular experience is pulled fresh is to "touch" (i.e. modify in some way) every file in the remote location. As we check the lastModified timestamp for every file individually, this will ensure it is definitely newer than the cached copy.

It should be noted that this shouldn't be necessary under normal circumstances, only if you experience any unexpected behaviour in your tests.

If you've done this and you're still experiencing unexpected behaviour, reach out to us and we'll help.