#34 closed defect (fixed)

disk space resource limits on storage servers

Reported by: zooko Owned by: zooko
Priority: major Milestone: 0.5.0
Component: code Version:
Keywords: Cc:
Launchpad Bug:

Description

Currently if you run a storage server, then clients can ask you to store data, and you always say yes. Make it possible to configure a storage server to have a limit on how much disk space it will use, and when it is full it says no.

Change History (5)

comment:1 Changed at 2007-05-04T05:59:02Z by zooko

also mentioned in source:roadmap.txt

comment:2 Changed at 2007-06-06T21:56:24Z by warner

Implementation notes: I'm thinking of having the node do a 'du -s' of the storage directory on startup and keep that value around as its estimate of total storage used. Each time a lease request arrives, subtract the estimate from the max-space target to decide whether we'll accept the lease or not. Keep a list of pending incoming shares and count them against the storage space (so that four billion lease requests that arrive at the same time won't all be honored). When the bucket is closed, do a 'du -s' of the bucket and add it to the estimate. Likewise, when a bucket is deleted, do a 'du -s' first and remove that from the estimate.

Sound reasonable? I'll look to amdlib.utils.fileutil for 'du -s' code, so we have something that'll work on windows too.

comment:3 Changed at 2007-06-07T03:00:46Z by zooko

Sounds reasonable!

comment:4 Changed at 2007-07-04T00:43:55Z by warner

  • Resolution set to fixed
  • Status changed from new to closed

I just implemented this, in 9ddb92965161a067, c80ea7d69399b153, and 94e6e6160b24959c. Write a number of bytes (perhaps with a suffix like kB or Mb or G) to a file named 'sizelimit' in the client's base directory. It will be read at node startup and used to constrain the StorageServer? to that size.

It's not 100% accurate right now: buckets which are being filled count against the limit, but the metadata that goes into them is only counted once the bucket is closed. The whole storage pool is sized for real at startup, and the amount consumed is modified after that as buckets come and go. The sizelimit does not take into account space consumed by directories, but rather only pays attention to files.

comment:5 Changed at 2007-07-04T00:44:08Z by warner

  • Milestone set to 0.5.0
Note: See TracTickets for help on using tickets.