I’m running a Clojure app in EC2 that uses the peer library to connect to a Datomic transactor also running in EC2 and backed by DynamoDB. The data stored in Datomic is only a couple hundred MB worth, and DynamoDB confirms that.
The app instances had 4GB of RAM, the JVM was given 3 of them and Datomic was configured with a 1GB object cache and a 512MB memory index. Once put under load, the systems would quickly report being out of memory to AWS. Connecting to the app EC2 instance with VisualVM, I saw that the memory was being held by threads owned by Datomic. Huge amounts of memory, well above 1.5GB.
I increased the instance size to an 8GB RAM configuration, and bumped the object cache to 1.5GB and the memory index to 1GB. Since then I have never seen it run out of memory, but I need to ask:
- why does it seem that Datomic used well over its configured amount of memory?
- it seems like the min reqs for a stable Datomic peer is 8GB when I would expect to get along fine on 2 or 4, surely I’ve set something up wrong to cause that?