Skip to content

Singlefile profiles db#1931

Open
hagen-i2p wants to merge 3 commits into
PurpleI2P:opensslfrom
hagen-i2p:singlefile-profiles-db
Open

Singlefile profiles db#1931
hagen-i2p wants to merge 3 commits into
PurpleI2P:opensslfrom
hagen-i2p:singlefile-profiles-db

Conversation

@hagen-i2p

Copy link
Copy Markdown

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

wekoq commented May 19, 2023

Copy link
Copy Markdown
Contributor

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.

2 participants