Larry
Larry
CDCloudflare Developers
Created by peachneo on 12/30/2024 in #durable-objects
Hmm is there some documentation
I did some experiments by setting a global variable and loged how often instances end up in the same memory space and it was rare and never more than 2 for my load. That said, I have never read a great discussion about how likely it is and how many is the likely max. That caused me to design my DOs to be stingy with memory which isn't as big of a problem as I thought it would be because the storage is so fast and cached. Now, I don't keep large structures in instance variables. If I need them, I fetch them from storage on every request and release the memory when the request is over.
4 replies
CDCloudflare Developers
Created by peachneo on 12/30/2024 in #durable-objects
Hmm is there some documentation
However, the instance sharing has been discussed here many times. Here is a linkk to one such reference: https://community.cloudflare.com/t/durable-object-shared-memory-allocation-wasm/572293
4 replies
CDCloudflare Developers
Created by peachneo on 12/30/2024 in #durable-objects
Hmm is there some documentation
In this official documention it mentions the memory sharing but not the implication that the total consumption for all instances that share memory cannot exceed 128MB: https://developers.cloudflare.com/durable-objects/reference/in-memory-state/
4 replies