Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cli driver for all clients #159

Merged
merged 1 commit into from
Apr 19, 2018
Merged

Add cli driver for all clients #159

merged 1 commit into from
Apr 19, 2018

Conversation

amcp
Copy link
Contributor

@amcp amcp commented Apr 13, 2018

Setup on EC2 Amazon Linux:

sudo yum update -y \
&& sudo yum upgrade -y \
&& sudo yum install -y java-1.8.0-openjdk-devel git emacs \
&& sudo yum remove -y java-1.7.0-openjdk \
&& git clone https://github.com/amcp/ndbench.git \
&& cd ndbench \
&& git checkout cli \
&& ./gradlew build

Test 1:

DISCOVERY_ENV=AWS ./gradlew run \
-Dndbench.config.cli.clientName=DynamoDBKeyValue \
-Dndbench.config.cli.bulkSize=1 \
-Dndbench.config.cli.timeoutMillis=180000 \
-Dndbench.config.dataSize=1000 \
-Dndbench.config.numKeys=1 \
-Dndbench.config.readEnabled=true \
-Dndbench.config.readRateLimit=20000 \
-Dndbench.config.writeEnabled=true \
-Dndbench.config.writeRateLimit=20000 \
-Dndbench.config.dynamodb.rcu=20000 \
-Dndbench.config.dynamodb.wcu=20000 \
-Dndbench.config.dynamodb.tablename=hires \
-Dndbench.config.dynamodb.consistentread=true \
-Dndbench.config.dynamodb.maxRetries=0 \
-Dndbench.config.dynamodb.requestTimeout=100 \
-Dndbench.config.dynamodb.maxConnections=400 \
-Dndbench.config.dynamodb.numReaders=200 \
-Dndbench.config.dynamodb.numWriters=200 \
-Dndbench.config.dynamodb.programmableTables=true

dependencies {
compile project(':ndbench-core')
compile project(':ndbench-api')
compile (project(':ndbench-cass-plugins')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the rest of the plugins in build.gradle when CLI support for them is implemented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

* @author amcp@amazon.com
*/
public class NdbenchEntrypoint {
public static class Args {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull out to a separate class or figure out how to use Archaius interface for CLI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

* - add command line arguments for all generic and client-specific parameters
* -
*
* @author amcp@amazon.com
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name not email

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,346 @@
/*
* Copyright 2018 Amazon Web Services, Inc.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Netflix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

});

try {
driver.init(dynamodb); //TODO make database client configurable
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an argument for the driver

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not implementing other drivers now, so put this feedback off.

@@ -31,7 +31,7 @@ public RandomStringKeyGenerator(boolean preLoadKeys, int numKeys) {

@Override
public String getNextKey() {
int randomKeyIndex = kRandom.nextInt(getNumKeys());
int randomKeyIndex = kRandom.nextInt(numKeys);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix in another pr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#163 fixes #160

@@ -4,7 +4,6 @@ repositories {
}
}


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all the noise changes in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -252,8 +252,8 @@ public String writeSingle(String key) throws Exception {

private List<WriteRequest> generateWriteRequests(List<String> keys) {
return keys.stream()
.map(key -> ImmutableMap.of(partitionKeyName, new AttributeValue(key),
ATTRIBUTE_NAME, new AttributeValue(this.dataGenerator.getRandomValue())))
.map(key -> ImmutableMap.of("id", new AttributeValue(key),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the partitionKeyName field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -15,7 +16,7 @@
private static final Logger Logger = LoggerFactory.getLogger(AutotuneTest.class);


@Test
@Ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

investigate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

settings.gradle Outdated
@@ -1,3 +1,13 @@
rootProject.name='ndbench'
include 'ndbench-web','ndbench-api','ndbench-core','ndbench-cass-plugins','ndbench-sample-plugins','ndbench-dyno-plugins','ndbench-es-plugins','ndbench-geode-plugins','ndbench-janusgraph-plugins', 'ndbench-evcache-plugins', 'ndbench-dynamodb-plugins'

include 'ndbench-web'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this change in a different PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed #161 in #164

@amcp amcp force-pushed the cli branch 3 times, most recently from 536f570 to d0216bc Compare April 14, 2018 16:56
@amcp amcp changed the title [WIP] Add cli driver Add cli driver for all clients Apr 14, 2018
@amcp
Copy link
Contributor Author

amcp commented Apr 14, 2018

evcache causes exceptions related to Eureka on startup. Any ideas?

@amcp amcp force-pushed the cli branch 4 times, most recently from 2914272 to a14dc44 Compare April 14, 2018 17:41
@amcp
Copy link
Contributor Author

amcp commented Apr 14, 2018

Also, seems like the properties are not getting initialized, despite my customizations:

DISCOVERY_ENV=AWS ./gradlew run \
-Dndbench.config.cli.clientName=DynamoDBKeyValue \
-Dndbench.config.cli.bulkSize=25 \
-Dndbench.config.cli.timeoutMillis=360000 \
-Dndbench.config.dynamodb.maxConnections=112 \
-Dndbench.config.dynamodb.numWriters=35 \
-Dndbench.config.dynamodb.numReaders=77 \
-Dndbench.config.dataSize=1000 \
-Dndbench.config.numKeys=10000000 \
-Dndbench.config.readEnabled=true \
-Dndbench.config.readRateLimit=3000 \
-Dndbench.config.writeEnabled=true \
-Dndbench.config.writeRateLimit=3000

Result:

17:41:49,395  INFO NdbenchEntrypoint:43 - Starting driver in CLI with loadPattern=random, windowSize=-1, windowDurationInSec=-1, bulkSize=1, timeout(ms)=360000, clientName=InMemoryTest

@amcp amcp force-pushed the cli branch 5 times, most recently from 3d24ba5 to 049dd24 Compare April 15, 2018 04:14
@amcp
Copy link
Contributor Author

amcp commented Apr 15, 2018

@ipapapa I fixed the system property issue by modifying build.gradle. The following command now works:

DISCOVERY_ENV=AWS ./gradlew run \
-Dndbench.config.cli.clientName=DynamoDBKeyValue \
-Dndbench.config.cli.bulkSize=25 \
-Dndbench.config.cli.timeoutMillis=360000 \
-Dndbench.config.dataSize=1000 \
-Dndbench.config.numKeys=100000000 \
-Dndbench.config.readEnabled=true \
-Dndbench.config.readRateLimit=3000 \
-Dndbench.config.writeEnabled=true \
-Dndbench.config.writeRateLimit=3000 \
-Dndbench.config.dynamodb.consistentread=true \
-Dndbench.config.dynamodb.maxRetries=0 \
-Dndbench.config.dynamodb.requestTimeout=100 \
-Dndbench.config.dynamodb.maxConnections=62 \
-Dndbench.config.dynamodb.numWriters=36 \
-Dndbench.config.dynamodb.numReaders=26

@ipapapa
Copy link
Contributor

ipapapa commented Apr 15, 2018

In regards to Eureka, I am aware of the issue. It is also reported in #134 (cc @smadappa). I got sidetracked last week, but I am planning to work unless @smadappa beats me to it :)

@ipapapa
Copy link
Contributor

ipapapa commented Apr 15, 2018

LGTM... @vinaykumarchella ?

@amcp amcp force-pushed the cli branch 6 times, most recently from 93ce80a to f6569b2 Compare April 18, 2018 04:18
keys.add("T" + i);
}
logger.info("Preloaded " + numKeys + " keys");
keys.addAll(IntStream.of(getNumKeys()).boxed().map(i -> "T" + i).collect(Collectors.toList()));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a peek for the info statement

@vinaykumarchella
Copy link
Contributor

Just back from short vacation, will go through it today and provide my comments on this

import org.slf4j.LoggerFactory;

/**
* This class is a CLI entry point to facilitate quick testing of the Netflix Database Benchmark.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Netflix Database Benchmark --> Netflix Data Benchmark (NdBench)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Integer.valueOf(cliConfigs.getBulkSize())
);
long millisToWait = Integer.valueOf(cliConfigs.getCliTimeoutMillis());
logger.info("Waiting " + millisToWait + " ms for reads and writes to finish");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this deviate the goal of NdBench being run continuously without a preset time? Can we have default to run indefinitely and being in CLI, you can stop with program interruption inputs (e.g., CTRL+C etc.,). also if needed we can provide the functionality to set the time, lets say - default getCliTimeoutMillis would be 0 or -1, setting it to positive number goes through the timeout functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With programmatic tables and large amounts of IOPS, it is easy to forget to delete the table after a Control-C and incur extra cost. The timeout is an extra safeguard to control the cost of experiments. I agree about overloading the meaning of non-positive numbers. Will fix.

@vinaykumarchella
Copy link
Contributor

Overall looks good, provided minor feedback above

Partially addresses Netflix#118
Copy link
Contributor

@vinaykumarchella vinaykumarchella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vinaykumarchella vinaykumarchella merged commit 218c44c into Netflix:master Apr 19, 2018
@amcp amcp deleted the cli branch April 19, 2018 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants