Skip to content

Configuration

Vinay Chella edited this page Jun 27, 2017 · 27 revisions

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.

Default Implementation

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

How to Use Configuration and Properties.

NdBench configuration is backed by Netflix OSS - Archaius2 implementation.


Default Configuration prefix - ndbench.config.. For example ndbench.config.numKeys.

Configurations at component level

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

Data generator configurations

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

Threads/ Workers configurations

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

Tasks(Write/Read) configurations

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

Debug configurations

Config Name Default value Description
statsUpdateFreqSeconds 5 Debug log stats update frequency in seconds
statsResetFreqSeconds 200 Debug log stats reset frequency in seconds

How to Use Properties:

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.