Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[to #375] use scanRegions request to warm up client - #383

Merged
zz-jason merged 11 commits into
tikv:masterfrom
birdstorm:use-scan-regions-request-to-warm-up
Dec 24, 2021
Merged

[to #375] use scanRegions request to warm up client#383
zz-jason merged 11 commits into
tikv:masterfrom
birdstorm:use-scan-regions-request-to-warm-up

Conversation

@birdstorm

@birdstorm birdstorm commented Dec 9, 2021

Copy link
Copy Markdown
Collaborator

use scanRegions request with limit to warm up client.

new configurations:

tikv.warm_up.enable default=true
tikv.grpc.warm_up_timeout_in_ms default=5000ms

@zz-jason zz-jason changed the title Use scanRegions request to warm up client [to #375] use scanRegions request to warm up client Dec 9, 2021
Comment thread src/main/java/org/tikv/common/TiSession.java Outdated

@zz-jason zz-jason left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could you add some test for this PR?

Signed-off-by: birdstorm <[email protected]>
Signed-off-by: birdstorm <[email protected]>
Signed-off-by: birdstorm <[email protected]>

private void doTest(TiConfiguration conf) throws Exception {
session = TiSession.create(conf);
long start = System.currentTimeMillis();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is it better to use System.nanoTime()?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think it is not necessary in unit test.

Comment on lines +133 to +135
doTest(conf);
conf.setWarmUpEnable(false);
doTest(conf);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how about:

elapsedWithWarmupMS  = doTest(conf)
conf.setWarmUpEnable(false);
elapsedWithoutWarmupMS = doTest(conf);
assertTrue(elapsedWithWarmupMS < elapsedWithoutWarmupMS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@birdstorm PTAL at this comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@zz-jason PTAL

Comment thread src/main/java/org/tikv/common/PDClient.java

@marsishandsome marsishandsome left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@marsishandsome

Copy link
Copy Markdown
Collaborator

/run-all-tests

Signed-off-by: birdstorm <[email protected]>

@zz-jason zz-jason left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@zz-jason

Copy link
Copy Markdown
Member

/merge

@ti-srebot

Copy link
Copy Markdown
Collaborator

/run-all-tests

@zz-jason
zz-jason merged commit 468e999 into tikv:master Dec 24, 2021
ti-srebot pushed a commit to ti-srebot/client-java that referenced this pull request Dec 24, 2021
@ti-srebot

Copy link
Copy Markdown
Collaborator

cherry pick to release-3.1 in PR #438

@birdstorm
birdstorm deleted the use-scan-regions-request-to-warm-up branch December 24, 2021 04:39
birdstorm added a commit to ti-srebot/client-java that referenced this pull request Dec 24, 2021
birdstorm added a commit to ti-srebot/client-java that referenced this pull request Dec 28, 2021
birdstorm added a commit to ti-srebot/client-java that referenced this pull request Dec 28, 2021
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.

4 participants