Skip to content

Database performance: reduce duplication #5898

Closed

Description

@calmh

The database becomes quite large in large setups and this reduces performance, due to writes and compaction. Currently we keep a copy of each file info for each peer. This is simple but wasteful, especially for the block list. There are attributes we need to remember per device (the invalid bits, for example) but it should be enough to keep one copy of the block list, keyed by folder/file name/version.

Activity

  1. added
    enhancement
    on Jul 28, 2019
  2. calmh commented on Jan 20, 2020

    @calmh
    MemberAuthor

    About the block list, here are database per-key-type sizes from a real world database:

    Data size per key type:
    00:  8074569 KiB
    01:  1759080 KiB
    02:    86389 KiB
    03:       32 KiB
    04:       34 KiB
    06:        4 KiB
    07:       16 KiB
    08:       22 KiB
    09:      121 KiB
    0a:        0 KiB
    0b:    12752 KiB
    
    Total block list data:  4773993 KiB
    Dedup block list data:    59735 KiB (1.3 %)
    

    (00 is the FileInfos, 01 the globals index)

    The block list data and dedup block list data is just how many bytes out of the fileinfos are the marshalled block list, and what it would look like if we stored each block list only once, keyed by the hash of the marshalled block list in this case. That's almost half of the database, 4.7 gigs of unnecessary block lists.

  3. added a commit that references this issue on Jan 21, 2020
    59620c1
  4. added this to the v1.4.0 milestone on Jan 24, 2020
  5. added 2 commits that reference this issue on Jan 30, 2020
    35caa6a
    32ba321
  6. added
    frozen-due-to-age
    on Jan 24, 2021
  7. locked and limited conversation to collaborators on Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions