Search code examples
javasemaphoreignite

Ignite Semaphore doesn't support high traffic?


I have a ignite 5 Client + 1 Server cluster, the client receive request from network and send the REQ to ignite server for further processing, in my case, i want to add concurrent limitation for the incoming Request, i use code like this:

public boolean handleEntrustRequest(TestEntrustInfo TestEntrustInfo) {

    if(!concurrencySemaphore.tryAcquire()){

        return false;
    }

    try {
        return handleEntrustRequestReal(TestEntrustInfo);
    }finally {

        concurrencySemaphore.release();
    }

}

I try to set the limitation number to 100000, i.e. no limitation for incoming request.

In low concurrent traffic, such as around 50~100 the code runs smoothly, but with higher traffic, I could see Request could not send to Client normally, the request seems hangs and then timeout, but if i remove above code the incoming Request with 1000 concurrent traffic could be processed quickly.

in this link: https://cwiki.apache.org/confluence/display/OPENWHISK/2018-02-14+OW+Tech+Interchange+-+Meeting+Notes I saw this words:

New LB, the state is consistent even locally, slots to invokers impl. with semaphores (low level of concurrency);

Also paste the jstack: please check it here https://textsave.de/text/E5yRP0iEqSxkzwqw


Solution

  • as Roman says, using client specific semaphore is enough to solve this issue.