From 077dd7c589dd9933bc9ef83eeb41389d683d59f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Mon, 14 Apr 2014 16:11:12 -0700 Subject: [PATCH 1/3] enable cache monitor on computes by default --- services/src/main/java/io/druid/cli/CliHistorical.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/io/druid/cli/CliHistorical.java b/services/src/main/java/io/druid/cli/CliHistorical.java index 8f0c8769397..9692375e264 100644 --- a/services/src/main/java/io/druid/cli/CliHistorical.java +++ b/services/src/main/java/io/druid/cli/CliHistorical.java @@ -26,6 +26,7 @@ import com.metamx.common.logger.Logger; import io.airlift.command.Command; import io.druid.client.cache.Cache; import io.druid.client.cache.CacheConfig; +import io.druid.client.cache.CacheMonitor; import io.druid.client.cache.CacheProvider; import io.druid.guice.Jerseys; import io.druid.guice.JsonConfigProvider; @@ -38,6 +39,7 @@ import io.druid.server.QueryResource; import io.druid.server.coordination.ServerManager; import io.druid.server.coordination.ZkCoordinator; import io.druid.server.initialization.JettyServerInitializer; +import io.druid.server.metrics.MetricsModule; import org.eclipse.jetty.server.Server; import java.util.List; @@ -77,10 +79,11 @@ public class CliHistorical extends ServerRunnable LifecycleModule.register(binder, ZkCoordinator.class); LifecycleModule.register(binder, Server.class); + binder.bind(Cache.class).toProvider(CacheProvider.class).in(ManageLifecycle.class); JsonConfigProvider.bind(binder, "druid.historical.cache", CacheProvider.class); JsonConfigProvider.bind(binder, "druid.historical.cache", CacheConfig.class); - + MetricsModule.register(binder, CacheMonitor.class); } } ); From 16bffe05884b05833c7906d5adf4dc8ac4f85ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Mon, 14 Apr 2014 16:23:54 -0700 Subject: [PATCH 2/3] default cache size to zero --- .../src/main/java/io/druid/client/cache/LocalCacheProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/io/druid/client/cache/LocalCacheProvider.java b/server/src/main/java/io/druid/client/cache/LocalCacheProvider.java index 716f5abab93..62cd3d9caaa 100644 --- a/server/src/main/java/io/druid/client/cache/LocalCacheProvider.java +++ b/server/src/main/java/io/druid/client/cache/LocalCacheProvider.java @@ -29,7 +29,7 @@ public class LocalCacheProvider implements CacheProvider { @JsonProperty @Min(0) - private long sizeInBytes = 10485760; + private long sizeInBytes = 0; @JsonProperty @Min(0) From ce250222bf3de0c35ab46bdc00061421d4c2d115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Mon, 14 Apr 2014 16:33:08 -0700 Subject: [PATCH 3/3] update docs --- docs/content/Broker-Config.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/content/Broker-Config.md b/docs/content/Broker-Config.md index 552320ac583..44ece979580 100644 --- a/docs/content/Broker-Config.md +++ b/docs/content/Broker-Config.md @@ -81,7 +81,7 @@ druid.server.http.numThreads=50 druid.request.logging.type=emitter druid.request.logging.feed=druid_requests -druid.monitoring.monitors=["com.metamx.metrics.SysMonitor","com.metamx.metrics.JvmMonitor", "io.druid.client.cache.CacheMonitor"] +druid.monitoring.monitors=["com.metamx.metrics.SysMonitor","com.metamx.metrics.JvmMonitor"] # Emit metrics over http druid.emitter=http @@ -106,16 +106,16 @@ The broker module uses several of the default modules in [Configuration](Configu |Property|Description|Default| |--------|-----------|-------| -|`druid.broker.cache.sizeInBytes`|Maximum size of the cache. If this is zero, cache is disabled.|10485760 (10MB)| -|`druid.broker.cache.initialSize`|The initial size of the cache in bytes.|500000| -|`druid.broker.cache.logEvictionCount`|If this is non-zero, there will be an eviction of entries.|0| +|`druid.broker.cache.sizeInBytes`|Maximum cache size in bytes. Zero disables caching.|0| +|`druid.broker.cache.initialSize`|Initial size of the hashtable backing the cache.|500000| +|`druid.broker.cache.logEvictionCount`|If non-zero, log cache eviction every `logEvictionCount` items.|0| #### Memcache |Property|Description|Default| |--------|-----------|-------| -|`druid.broker.cache.expiration`|Memcache [expiration time ](https://code.google.com/p/memcached/wiki/NewCommands#Standard_Protocol).|2592000 (30 days)| -|`druid.broker.cache.timeout`|Maximum time in milliseconds to wait for a response from Memcache.|500| -|`druid.broker.cache.hosts`|Memcache hosts.|none| -|`druid.broker.cache.maxObjectSize`|Maximum object size in bytes for a Memcache object.|52428800 (50 MB)| -|`druid.broker.cache.memcachedPrefix`|Key prefix for all keys in Memcache.|druid| +|`druid.broker.cache.expiration`|Memcached [expiration time](https://code.google.com/p/memcached/wiki/NewCommands#Standard_Protocol).|2592000 (30 days)| +|`druid.broker.cache.timeout`|Maximum time in milliseconds to wait for a response from Memcached.|500| +|`druid.broker.cache.hosts`|Command separated list of Memcached hosts ``.|none| +|`druid.broker.cache.maxObjectSize`|Maximum object size in bytes for a Memcached object.|52428800 (50 MB)| +|`druid.broker.cache.memcachedPrefix`|Key prefix for all keys in Memcached.|druid|