objectbox/objectbox-python

Seeking advice: Cache capacity reached; for optimal performance consider increasing the cache size

Closed this issue · 1 comments

I get this INFO logged in my app. It happened just now in my app adding entities, somewhere between adding the 8000th and 8500th. I've searched the source code and grep'ed the installed Python package. As far as I can tell, the message comes from a binary library - I can see the string in libobjectbox.so. I can't see where the source of this library is in the objectbox repos on GitHub.

How do I either:

  • increase the cache size?
  • or flush entries from the cache to reduce the size needed? My app does very little repetitive access to an entity, so the cache isn't really helping.

Here's the entity

 @Entity()
class ImHash:
    id = Id
    key = String(index=Index(IndexType.HASH), unique=True)
    cos_value = Float32Vector(index=HnswIndex(
        dimensions=62720,
        distance_type=VectorDistanceType.COSINE,
    ))

Found the vector_cache_hint_size_kb argument of HnswIndex. Setting this to a large value solved my problem.