6

I am using the "aws-sdk:^2.576.0" and "amazon-qldb-driver-nodejs:0.1.0-preview.2", and following the node-sdk's sample code for qldb. I am calling the node-sdk functions via the REST APIs exposed.

So for the read table operation, i.e., SELECT * query (scanTable from the sample code), following is the latency breakdown:

enter image description here

I'm getting a new session for every transaction from the session pool using pooledQldbDriver.getSession() and have a decent internet connection of nearly 100mbps.

Is this much latency expected? Am I doing something wrong, and how can it be reduced further?

PrashantNagawade
  • 426
  • 1
  • 6
  • 24
  • 1
    Hi Prashant. How are you measuring latency? Is this client side? And, what region are you running in and what is your latency to that region? The short answer is "no". But I will need more information to help you narrow down the problem. – Marc Dec 13 '19 at 18:11
  • Hi Marc, I'm running on the region us-west-2 from India. I'm measuring the latency at client-side using `console.time()`. I haven't done complete benchmarking yet, but this is what I'm getting for now. Will changing the region or the sdk from node to java affect the current latency? Thanks! – PrashantNagawade Dec 16 '19 at 05:30
  • 1
    Yes, significantly. Right now what you're measuring is the latency between your browser and us-west-2, not the latency of QLDB. You should select the endpoint with the lowest latency from https://docs.aws.amazon.com/general/latest/gr/qldb.html. – Marc Dec 16 '19 at 22:34
  • 2
    Or preferably start an EC2 instance or Lambda in the same region and run the test there. It cuts the round trip through your ISP and wifi out of the loop. – Trenton Dec 16 '19 at 22:43

1 Answers1

3

(As per the comments in your question.)

Right now you're measuring the latency between India and us-west-2, not the latency of QLDB operations. Please use a region that has lower latency (https://docs.aws.amazon.com/general/latest/gr/qldb.html) or rely on the server-side metrics that you should be able to find in the CloudWatch console.

Marc
  • 928
  • 5
  • 8