You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Joe Ammann <jo...@pyx.ch> on 2018/06/14 14:15:38 UTC

Performance of MultiSharedLock recipe

Hi

I have some issues with the performance of the MultiSharedLock. I use
(with Curator 4.0.0 and Zookeeper 3.5.3-beta) against a 3-node ensemble,
locking ~900 locks in one operation. Client is Java, using TLS to
connect to the ensemble.

When running just 1 thread acquiring such a MultiSharedLock, it takes
between 10-20 seconds to get all locks. Releasing them takes another
8-10 seconds. This seems really slow to me.

I executed some basic smoketests against my cluster (using
https://github.com/phunt/zk-smoketest, from one of the ensemble members
and without TLS). This gave me a - I think - relatively decent
performance of about 1000 persistent node creations and deletions per
second.

I realize that taking out (part of) the network latency and not using
TLS will obviously make operations faster. Still, I would not expect
performance to drop by an order of magnitude or more.

The code I'm using is really trivial, basically:

        List<String> paths = new ArrayList<String>();
        for (int i = 0; i < 1000; i++) {
            paths.add("/curator_test/multi_lock/" + new
UniqueId().toHexString());
        }
        InterProcessMultiLock lock = new InterProcessMultiLock(client,
paths);
        lock.acquire(1000, TimeUnit.MILLISECONDS);

Is there something I'm doing fundamentally wrong? Do you have some hints
for me where the performance might be lost?

I'll try a Java version without TLS, and also creating the nodes
directly from Java with ZK basic operation to see if I can find out more.

-- 
CU, Joe