-
1. Re: Is that normal permormance?
gustavonalle Apr 27, 2016 10:39 AM (in response to n.dobryukha)Could you re-run the benchmark annotating your .proto so that its fields are indexed? An example is [1]
Also, make sure to follow some guidelines [2] when measuring java code to avoid common pitfalls.
-
2. Re: Is that normal permormance?
n.dobryukha Apr 28, 2016 5:33 AM (in response to gustavonalle)I've changed book.proto with your recommendation. Is it correct now?
Also I've used a JMH for create benchmark - MyBenchmark.javaResults are in attached files.
Could you give any comments?
-
benchmark_100k.txt.zip 1.1 KB
-
benchmark_250k.txt.zip 1.1 KB
-
benchmark_500k.txt.zip 1.1 KB
-
-
3. Re: Is that normal permormance?
n.dobryukha Apr 29, 2016 8:59 AM (in response to n.dobryukha)Hey guys,
I need a piece of advice about improving of querying performance.
-
4. Re: Is that normal permormance?
gustavonalle Apr 29, 2016 11:01 AM (in response to n.dobryukha)Due to some configuration issues (ISPN-6577), your cache is running in non-indexed mode, that explains why the query performance is poor.
Try changing from
<replicated-cache name="booksCache" configuration="indexed-cache">
to
<replicated-cache name="booksCache" mode="SYNC" start="EAGER" remote-timeout="20000">
I run the benchmark on my environment and the perf with 500_000 went from
0.346 ±(99.9%) 0.015 s/op
to
0.003 ±(99.9%) 0.001 s/op
so about 2 orders faster.
-
5. Re: Is that normal permormance?
gustavonalle Apr 29, 2016 11:18 AM (in response to gustavonalle)Btw, when the cache is indexed you will notice it takes a while to put half a million entries. To speed-up the process you have 2 choices:
- Populate the cache with multiple threads instead of 1 as the benchmark is doing; or
- Enable async indexing, performance should be roughly the same as non-indexed caches at the cost of small delay to have the indexing done after the puts are finished (1 second or so). So you need to check when index is done, like:
int resultSize = 0; while(resultSize < MAX_CACHE_COUNT) { resultSize = Search.getQueryFactory(cache).from(Book.class).build().getResultSize(); }
To enable async use the following property:
<property name="default.worker.execution">async</property>