-
Notifications
You must be signed in to change notification settings - Fork 102
Configuration
NDBench leverages Guice to reduce repetition and in favor of a more readable configuration. The registration of the listener takes place in the web.xml. InjectedWebListener is the logical place where the injectors are created and configured.
bind(NdBenchMonitor.class).to(FakeMonitor.class);
bind(IClusterDiscovery.class).to(LocalClusterDiscovery.class);
bind(DataGenerator.class).to(StringDataGenerator.class);
To use NDBench on AWS, you need to replace LocalClusterDiscovery
with AWSLocalClusterDiscovery
.
NdBench configuration is backed by Netflix OSS - Archaius2 implementation.
The most straight-forward way to modify NdBench properties when you are running via Tomcat is by adding system property settings to the CATALINA_OPTS environment variable in the /bin directory of your Tomcat installation. For example, if you wished to change the number of writers in your benchmark to 10, you would stick the folllowing line at the very end of the file <TOMCAT_DIR>/bin/setenv.sh:
export CATALINA_OPTS=" -Dndbench.config.numWriters=10 ... {other settings} ..."
The approach for jetty and other containers would be similar.
Default Configuration prefix - ndbench.config.
. For example ndbench.config.numKeys
.
Note: Every config has to be prefixed with configuration prefix mentioned above
Archaius2 provides a variety of property sources which can be used to configure NDBench
Config Name | Default value | Description |
---|---|---|
numKeys | 1000 | Number of Keys to be generated and stored in memory of NdBench instance.. The number of keys you allocate may impact how your benchmark runs for plug-in clients that perform UPSERT style writes (that is: writes which create an object if the corresponding key is not present, and which update the object it if its key exists). This occurs with the Elasticsearch REST client, for example: if the number of writes you perform starts to exceed the number of keys alloted then you will see the document count in your test index cease to increase.) |
numValues | 200 | Number of values to be generated and stored in memory of NdBench instance |
dataSize | 128 | Data Size of each column/ item |
backfillStartKey | 1 | StartKey for the backfill to be started from |
useVariableDataSize | false | Indicates whether to use variable data size/ payload for generating the Values
|
dataSizeLowerBound | 1000 | Lower bound of data size in bytes in case of variable data size is generated |
dataSizeUpperBound | 5000 | Upper bound of data size in bytes in case of variable data size is generated |
useStaticData | false | Indicates whether to use static data/payload for generating the Values
|
preLoadKeys | false | Indicates whether keys to be generated and stored in it's in-memory(JVM) for the duration NdBench's runtime life cycle |
Config Name | Default value | Description |
---|---|---|
numWriters | 1 | Number of writer threads to used |
numReaders | 1 | Number of reader threads to be used |
numBackfill | 1 | Number of backfill threads to be used |
writeRateLimit | 100 | Number of writes per sec per NdBench instance |
readRateLimit | 100 | Number of reads per sec per NdBench instance |
Config Name | Default value | Description |
---|---|---|
writeEnabled | 1 | Number of writer threads to used |
readEnabled | 1 | Number of reader threads to be used |
backfillStartKey | 1 | Number of backfill threads to be used |
Config Name | Default value | Description |
---|---|---|
statsUpdateFreqSeconds | 5 | Debug log stats update frequency in seconds |
statsResetFreqSeconds | 200 | Debug log stats reset frequency in seconds |
Config Name | Default value | Description |
---|---|---|
autoTuneEnabled | false | whether or not the benchmark driver will attempt to use auto-tuning to find optimal read and write rate limits |
autoTuneRampPeriodMillisecs | 60 | the period within which the driver will attempt to raise a rate limit from its initial to its final value -- must be an integral multiple of autoTuneIncrementIntervalMillisecs. |
autoTuneIncrementIntervalMillisecs | 1 | the number of steps within which the driver will attempt to adjust a rate limit from its initial to its final value, as given by the formula: autoTuneRampPeriodMillisecs / autoTuneIncrementIntervalMillisecs |
autoTuneFinalWriteRate | 1000 | the upper bound on the write rate limit that the driver will attempt to adjust to if autoTuneEnabled is set to true |
Properties inherently use Archaius configuration.
But you can use any of the Archaius2 property source methods to supply properties whichever way you would like. (eg. application.properties or System properties)
Another way to provide your properties is by implementing IConfiguration interface.