graphite-project/carbon — pull request #231 by pratX (2014-03-21 16:30:40+00:00)
Title: Added the option to specify the minimum number of datapoints per update operation

Motivation:
1.) Avoid a large a number of small disk-writes.
2.) A more predictable write pattern across multiple carbon-cache instances i.e. every carbon-cache instance getting a share of disk I/O.

Modifications to meet the above points:
Modified writer.py to make carbon-cache do a whisper.update_many() only for those metrics which have more than MIN_DATAPOINTS_PER_UPDATE datapoints in cache. And this constraint is removed when the cache size grows above LOW_CACHE_SIZE, and comes back into effect when cache size shrinks below LOW_CACHE_SIZE.
LOW_CACHE_SIZE is set to 80% of MAX_CACHE_SIZE by default.