GithubHelp home page GithubHelp logo

Feature: retention period about strfry HOT 5 CLOSED

kroese avatar kroese commented on July 24, 2024
Feature: retention period

from strfry.

Comments (5)

hoytech avatar hoytech commented on July 24, 2024

Neat idea on the max DB size: The tough thing is figuring out a policy on which events to purge.

If you're OK with the time-based policy, you could put strfry delete --age $MAX_AGE_SECONDS into a cron-job.

from strfry.

kroese avatar kroese commented on July 24, 2024

Great, did not know that command existed! That will do for now..

from strfry.

kroese avatar kroese commented on July 24, 2024

Actually it didn't went like I expected.

When running the delete command which removed 5 million events, the database size was INCREASED with 5 GB afterwards. I am not sure how this works, maybe it causes some internal shuffling and lmdb needs to allocate more space to rearrange everything during a delete operation?

So next I did a compact which luckily decreased the size finally. But this cannot be run from the daily cron because A) it takes hours B) it requires to take strfry offline because the database files need to be swapped.

I will just keep the daily delete cron and hopefully it will keep the database the same size from now on. As lmdb is supposed to re-use the space from the deleted records for new data.

from strfry.

hoytech avatar hoytech commented on July 24, 2024

I think this behaviour makes sense: When you delete values from LMDB, it doesn't actually shrink the DB size, it just leaves it as free-space that will get used for subsequent writes.

So I think doing the compact one time is probably sufficient, and the DB size will grow up to the "high water mark" (the largest amount stored at any one given time), and stay there.

from strfry.

kroese avatar kroese commented on July 24, 2024

Yes. I didnt expect it to shrink it by the deletes, I was just surprised it growing so much by just deleting stuff.

from strfry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.