Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singlefile profiles db #1931

Open
wants to merge 3 commits into
base: openssl
Choose a base branch
from

Conversation

hagen-i2p
Copy link

Patch to store peer profiles in one text file as json-hash-per-line

  • Greatly saves disk space, reduces inode usage and fs writes (from 880Mb dir with ~210k 4k-files -> one file about 20Mb in my case)
  • No extra deps: uses same boost/property_tree/json_parser as in I2PControl service
  • Atomic database save: uses save-then-replace method

Drawbacks:

  • In theory it uses slightly more memory just after start (as all known profiles loaded at startup). From the other side, profiles considered "useless" or "expired" will not be saved and live only in memory.
  • No lazy save/load for individual profile, all profiles saved at once with PEER_PROFILE_AUTOCLEAN_TIMEOUT interval (6h for now, may be tuned later)

@wekoq
Copy link
Contributor

wekoq commented May 19, 2023

I think, IsUseful can be inline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants