Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2958

Freelist algorithm causes storage fragmentation

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      The algorithm used for the freelist groups related sizes into "buckets" that are searched for a free entry. The algorithm stops at 30 entries and then goes to the next bucket. If all buckets are searched then a new extent is allocated. In a high insert / delete environment where the inserts occur throughout the delay and peak and then deletes peak at a separate time (for example a session cache for a web site) this algorithm results in very large freelists where the smallest items filter to the top of each bucket. The freelist becomes filled with items that are never reused and blocking items that can be reused. One option is to allocate only on the bucket size (256, 512, 1024, etc.) which would guarantee that all items in the freelist are reusable. The following pull request https://github.com/mongodb/mongo/pull/37 illustrates how this could be fixed.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                19 Vote for this issue
                Watchers:
                27 Start watching this issue

                Dates

                • Created:
                  Updated: