Environment
        Apache kylin 1.6.0
        Jdk1.8.0_72  64-Bit
        any one cube and any one SQL

Problem
        When the concurrency users count increase, many request’s response time 
become longer and longer, but some are normal.
       This is because when calcite parse the sql.
The function 
getBindable(org.apache.calcite.adapter.enumerable.EnumerableInterpretable ,line 
119) dynamic create a bindable instance. The bindalbe instance call 
loadClass(java.lang.ClassLoader line 401)  function which has a synchronized 
java code many times. So, one thead may wait for another.
After I change the following code, the performance become much better.
1,org.codehaus.janino.ByteArrayClassLoader
+static {
+       ClassLoader.registerAsParallelCapable();
+   }
2,org.apache.calcite.adapter.enumerable.EnumerableRelImplementor
line 159 return Expressions.classDecl(Modifier.PUBLIC,
-line 160         "Baz",
+line 160         "Baz"+System.currentTimeMillis(),
line 161         null,
line 162         Collections.<Type>singletonList(Bindable.class),
line 163         memberDeclarations);

Reply via email to