Skip to content
afeinberg edited this page Apr 22, 2011 · 2 revisions

Quotas in Voldemort

For each store, assign a soft quota and a hard quota

Periodically, have a background thread scan the directories for each store (note, this requires an environment per store model with BDB) and find utilization statistics

When a store reaches a soft limit, we log a warning messages in the log. We also add the store to a list that is exposed through JMX to notify operations.

When a store reaches a hard limit, we quit allowing puts or updates to the store, until utilization goes back down.

Finding utilization:

With BDB storage engine, traverse all the files in the stores log directory, looking at File.length on each file.

Alternate option: don't always enforce a hard quota

Rather than enforce a hard quota in all cases, we could only enforce a hard quota when disk capacity runs low (beyond a threshold). Soft quotas are still enforced, and signal a failure in capacity planning. Finding 'df' can be done either via (once in a few hours) fork and shell out to df (the "acceptable, since fork is COW, but I'd rather not" way) or (the right, but may be difficult way) of using JNA to do a call to statfs(2) (with machine and platform specific code of extracting struct statf).

Clone this wiki locally