2

I have set up apache geode for caching.

Cluster Configuration:
Locator: 1GB      - Mounted volume 2GB
Server2: 1GB      - Mounted volume 2GB
Server2: 1GB      - Mounted volume 2GB

Region configuration in cache.xml

<region name="answerCache">
    <region-attributes data-policy="PARTITION_PERSISTENT_OVERFLOW">
        <eviction-attributes>
            <lru-heap-percentage action="overflow-to-disk" />
        </eviction-attributes>
    </region-attributes>
</region>

Geode pushes the data to disk (based on LRU) when region fills with data. But I'm not getting any configuration where geode lets me delete entry from disk if its getting filled. I'm getting Out of memory error if disk gets full.

I want to apply LRU on disk writes as well so that least used entries can be deleted from disk.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
nandeesh
  • 753
  • 7
  • 16

2 Answers2

0

I don't think there's a feature like this embedded within Apache Geode at the moment and, according to how I see it, it wouldn't make much sense to add it either way. The overflow feature basically limits the region size in memory by moving the values of least recently used (LRU) entries to disk (values only), the keys are kept in memory with a "pointer" to the actual entry on disk so they can be recovered whenever needed.

If you want to remove entries from the disk-store, you first need to delete them from the actual Region on memory (Region.destroy, Region.remove, etc.), Apache Geode will handle the deletion process and remove the entry from disk as well, automatically.

Cheers.

Juan Ramos
  • 1,421
  • 1
  • 8
  • 13
  • Juan Ramos, I want to remove entries from disk, when disk is full ( based on LRU). Is there any work around.? may be using geode functions.? Because in memory pushes data to disk, but even disk has a limit to store data. – nandeesh Jan 05 '21 at 00:51
  • Hi there Nandeesh, the answer would be no: you can't manually remove entries from `disk`, even when using functions, as the `disk-stores` themselves are internally managed and kept in sync by Geode itself. Tampering with the data stored on them would make the memory copy of the cache inconsistent with what's stored on disk, that's why it's not allowed. – Juan Ramos Jan 05 '21 at 09:19
  • You have other ways to manage the `disk-store` capacity and get alerts whenever some thresholds are being reached, you should use that instead of trying to manually delete the data from them. Please have a look at [Disk Store Management](https://geode.apache.org/docs/guide/113/managing/disk_storage/managing_disk_stores.html) and, specifically, [Configuring Disk Free Space Monitoring](https://geode.apache.org/docs/guide/113/managing/disk_storage/disk_free_space_monitoring.html). – Juan Ramos Jan 05 '21 at 09:20
  • Thanks Juan Ramos – nandeesh Jan 05 '21 at 15:51
0

You can use GFSH disk store commands to manage disk stores. You can even use a GUI (https://github.com/ldom22/GGGUI)

ldpm
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 09 '22 at 02:29