@Han_Chris1 it must be something environmental. I cloned your repository, and the only thing I changed was to change the properties file to point to a node on localhost and different bucket name / user - I also had to change the query from myBucket to my bucket name…
I started the app with mvn compile quarkus:dev
One thing I noted is that quarkus opens the connections lazily, so the first query really takes longer until the client is fully bootstrapped - maybe there is a way in quarkus to load the resources eagerly?
Once the first request wen through, I used the wrk benchmarking tool. one thread, one connection - to test the latency. Note that my bucket was empty, since I wanted to make sure there isn’t much contributing to the perf on the SDK side (vs. i.e a longer running n1ql query).
Results:
wrk -c 1 -t 1 -d 30s http://127.0.0.1:8080/test_api/getAgentDetail/1
Running 30s test @ http://127.0.0.1:8080/test_api/getAgentDetail/1
1 threads and 1 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 0.99ms 361.20us 17.94ms 93.78%
Req/Sec 1.02k 128.03 1.20k 69.67%
30486 requests in 30.01s, 2.09MB read
Requests/sec: 1015.99
Transfer/sec: 71.44KB
it ran for 30s, with an average latency of a response at 1ms, max 17.9ms and that’s end-to-end.
Here is the diff for my changes:
diff --git a/src/main/java/com/test/api/query/StringQuery.java b/src/main/java/com/test/api/query/StringQuery.java
index 85e17d5..16685db 100644
--- a/src/main/java/com/test/api/query/StringQuery.java
+++ b/src/main/java/com/test/api/query/StringQuery.java
@@ -2,7 +2,7 @@ package com.test.api.query;
public class StringQuery {
- public static String getAgentDetail = "select * from myBucket use keys $agent_number";
+ public static String getAgentDetail = "select * from default use keys $agent_number";
}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index c75c810..eb68748 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -3,8 +3,8 @@ quarkus.http.test-port=9088
quarkus.swagger-ui.always-include=true
#Couchbase Connection
-cb_nodes=couchdb01
+cb_nodes=localhost
cb_uname=Administrator
-cb_pass=pass
-cb_bucket=myBucket
-query=select * from myBucket
+cb_pass=foobar
+cb_bucket=default
+query=select * from `default`