cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matija Gobec <matija0...@gmail.com>
Subject Re: Does Java driver v3.1.x degrade cluster connect/close performance?
Date Mon, 06 Mar 2017 12:01:02 GMT
Interesting question since I never measured connect and close times.
Usually this is something you do once the application starts and thats it.
Do you plan to misuse it and create a new cluster object and open a new
connection for each request?

On Mon, Mar 6, 2017 at 7:19 AM, Satoshi Hikida <sahikida@gmail.com> wrote:

> Hi,
>
> I'm going to try to update the DataStax's Java Driver version from 2.1.8
> to 3.1.3.
> First I ran the test program and measured the time with both drivers
> v2.1.8 and v3.1.3.
>
> The test program is simply Build a Cluster and connect to it and execute a
> simple select statement, and close the Cluster.
>
> The read performance was almost the same for both version (around 20ms),
> However, the performance of connecting to the cluster, and closing the
> cluster were significant different.
>
> The test environment is as following:
> - EC2 instance: m4.large(2vCPU, 8GB Memory), 1 node
> - java1.8
> - Cassandra v2.2.8
>
> Here is the result of the test. I ran the test program for several times
> but the result almost the same as this result.
>
> | Method               | Time in sec (v2.1.8/v3.1.3)|
> |-----------------------|------------------------------------|
> | Cluster#connect |                       1.178/2.468 |
> | Cluster#close     |                       0.022/2.240 |
>
> With v3.1.3 driver, Cluster#connect() performance degraded about 1/2 and
> Cluster#close() degraded 1/100.  I want to know what is the cause of this
> performance degradations. Could someone advice me?
>
>
> The Snippet of the test program is as following.
> ```
> Cluster cluster = Cluster
>     .builder()
>     .addContactPoints(endpoints)
>     .withCredentials(USER, PASS)
>     .withClusterName(CLUSTER_NAME)
>     .withRetryPolicy(DefaultRetryPolicy.INSTANCE)
>     // .withLoadBalancingPolicy(new TokenAwarePolicy(new
> DCAwareRoundRobinPolicy(DC_NAME))) // for driver 2.1.8
>     .withLoadBalancingPolicy(new TokenAwarePolicy(DCAwareRoundRobinPolicy.builder().build()))
> // for driver 3.1.3
>     .build();
>
> Session session = cluster.connect();
> ResultSet rs = session.execute("select * from system.local;");
>
> session.close();
> cluster.close();
> ```
>
> Regards,
> Satoshi
>
>

Mime
View raw message