Layer7 API Management

Expand all | Collapse all

Active Concurrent Requests Count

Jump to Best Answer
  • 1.  Active Concurrent Requests Count

    Posted 06-13-2017 06:52 AM

    Is there any variable which stores the total number of active threads  connected to the gateway server?

     

    Thanks,

    Adarsh



  • 2.  Re: Active Concurrent Requests Count

    Posted 06-13-2017 08:59 AM

    We expose this variable per request:

     

    ${request.listener.concurrency}


    For inbound HTTP and HTTPS requests, this returns the number of request threads active within the thread pool that is handling the current request, at the time the current request was dispatched to a handler thread.

     

    Ref: Message Layer Context Variables - CA API Gateway - 9.2 - CA Technologies Documentation 

     

    Although this is not variablized you can also use the commands specified here to get a better picture of the connections:

    Troubleshooting Gateway application failures, performance concerns, and service outages 

     

    Regards,

    Joe



  • 3.  Re: Active Concurrent Requests Count

    Posted 06-14-2017 06:22 AM

    Thanks Joe for your response.

     

    I tried to run a load test with multi threads[25+] for one of the endpoint and tried to capture the value of ${request.listener.concurrency}. But the value always remains 1.

     

    And also the output of below command remains zero.

    ss -o state established \( sport = :8443 ) \ dst 0.0.0.0\0 | egrep -v Recv-Q|wc -l 

    Is there something that I am missing here?

     

    Regards,

    Adarsh

     



  • 4.  Re: Active Concurrent Requests Count
    Best Answer

    Posted 06-19-2017 02:13 AM

    Hello Adarsh,

    A rough calculation of concurrent connection is,

    netstat -anpt|grep <gateway pid>|grep -v LISTEN|awk '{print $6}' | sort | uniq -c

     

    you can get the <gateway pid> from

    ps aux|grep Gateway.jar

     

    But it also includes the connections between gateway and database, gateway and ESM, etc.

    If you know the client ip(s), you may add more filter.

     

    Regards,

    Mark



  • 5.  Re: Active Concurrent Requests Count

    Posted 06-21-2017 06:54 AM

    Thank you Mark.

     

    Is there anyway I can get this concurrent connections count via API?

     

    Regards,

    Adarsh



  • 6.  Re: Active Concurrent Requests Count

    Posted 06-26-2017 02:33 AM

    Hello Adarsh,

    There should be no direct way to do so.

    But ss command, netstat command, etc. can be put in a bash script, if you know how to write a cgi for httpd with a bash script, you should be able to get the output with a http call.

     

    Regards,

    Mark



  • 7.  Re: Active Concurrent Requests Count

    Posted 06-28-2017 05:59 AM

    Many thanks Mark.