From d9a8aefcc58e58d4e9e0a68686779caf5ad8310a Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 18 Apr 2011 14:25:38 +0100 Subject: [PATCH] updated readme with thread_safe and buffer info --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 7ff82b6..c01fba5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ view\_stats.rb: class ViewStats include Redistat::Model end + + # if using Redistat in multiple threads set this + # somewhere in the beginning of the execution stack + Redistat.thread_safe = true ### Simple Example ### @@ -187,6 +191,12 @@ By default when fetching statistics, Redistat will figure out how to do the leas It is also intelligent enough to not fetch each day from 3-31 of a month, instead it would fetch the data for the whole month and the first two days, which are then removed from the summary of the whole month. This means three calls to `hgetall` instead of 29 if each whole day was fetched. +### Buffer ### + +The buffer is a new, still semi-beta, feature aimed to reduce the number of Redis `hincrby` that Redistat sends. This should only really be useful when you're hitting north of 30,000 Redis requests per second, if your Redis server has limited resources, or against my recommendation you've opted to use 10, 20, or more label grouping levels. + +Buffering tries to fold together multiple `store` calls into as few as possible by merging the statistics hashes from all calls and groups them based on scope, label, date depth, and more. You configure the the buffer by setting `Redistat.buffer_size` to an integer higher than 1. This basically tells Redistat how many `store` calls to buffer in memory before writing all data to Redis. + ## Todo ##