Hello everyone! I want to use the localstack persistance feature. My first attempt was to set the policy to SNAPSHOT_SAVE_STRATEGY: ON_SHUTDOWN and SNAPSHOT_LOAD_STRATEGY: ON_STARTUP. However, when shutting down the container via docker desktop or by just shutting down windows the state does not get saved. So I tried using SNAPSHOT_SAVE_STRATEGY: SCHEDULED but now my api calls are very slow and setting up my infrastructure runs into an endless loop because of snapshot service interrupting any api calls. Is there a way to increase the saving interval from 15 seconds to like 5 minutes? This would help a lot.

Also I get these errors when deploying my infrastructure using pulumi and SNAPSHOT_SAVE_STRATEGY: SCHEDULED enabled:

2023-06-30T10:55:52.792  WARN --- [   asgi_gw_3] l.snapshot.manager         : waiting on snapshot save timed out, this can cause data corruption
2023-06-30T10:55:58.062  WARN --- [   asgi_gw_4] l.snapshot.manager         : waiting on snapshot save timed out, this can cause data corruption
2023-06-30T10:55:58.065  WARN --- [   asgi_gw_0] l.snapshot.manager         : waiting on snapshot save timed out, this can cause data corruption
2023-06-30T10:56:00.738  WARN --- [   asgi_gw_2] l.snapshot.manager         : waiting on snapshot save timed out, this can cause data corruption
2023-06-30T10:56:01.739  WARN --- [   asgi_gw_1] l.snapshot.manager         : waiting on snapshot save timed out, this can cause data corruption
2023-06-30T10:56:02.662  WARN --- [   asgi_gw_7] l.snapshot.manager         : waiting on snapshot save timed out, this can cause data corruption

Hi @Cedric,

Can you please share your docker-compose.yml or the command which you use to start LocalStack with all the environment variables? Please download the latest version of our Docker image docker pull localstack/localstack-pro.

Could you please share what type of API calls you are making that are being affected by the slowness?

Hi @Cedric,

We have implemented a new variable to set the interval: SNAPSHOT_FLUSH_INTERVAL. You can use a custom interval time for the snapshots. Time is set in seconds. Please download the latest release of LocalStack docker image.

1 Like